Giter Club home page Giter Club logo

mongo-pig-examples's Introduction

Welcome to Mortar!

Mortar is a platform-as-a-service for Hadoop. With Mortar, you can run jobs on Hadoop using Apache Pig and Python without any special training.

Getting Started

Here we've included some example scripts that explore using MongoDB with Hadoop. These scripts use a sample of tweets from a single day loaded into a readonly publicly available MongoDB instance. To start using them:

  1. Signup for a Mortar account

  2. Install the Mortar Development Framework

  3. Clone this repository to your computer and register it as a project with Mortar:

    git clone [email protected]:mortardata/mongo-pig-examples.git
    cd mongo-pig-examples
    mortar register <your-handle>-mongo-pig-examples
    

Mortar project names share one global namespace so you'll need to pick a unique name. For this example you can prepend your Mortar handle to "mongo-pig-examples" in order to generate a unique name.

Once you've setup the project, use the mortar illustrate command to show data flowing through a given script. Use mortar run to run the script on a Hadoop cluster.

For lots more help and tutorials on running Mortar, check out the Mortar Help site.

Examples

characterize_collection:

This pig script will return some basic information about a MongoDB collection. Output is:

  1. Field Name. Embedded fields have their parent's field name prepended to their name. Every field that appears in any document in the collection is listed.
  2. Unique value count. The number of unique values associated with the field.
  3. Example value. An example value for the field.
  4. Example value type. The data type of the example value.
  5. Value count. The number of times the example value appeared for this field in the collection

Each field is listed up to five times with their five most common example values.

mongo_schema_generator:

This pig script will return a single text field which is the Pig schema of the collection loaded. This schema can be copied directly into the MongoLoader constructor to load the collection. See Using MongoDB with Mortar for an explanation of why you might like to load your collection using a schema.

hourly_coffee_tweets:

This pig script will go through a small sampling of a single day's worth of Tweets and count the number of times coffee was tweeted bucketed into two hour time blocks of the tweeter's local time.

mongo-pig-examples's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.