Git Product home page Git Product logo

pig-samples's Introduction

pig-samples

Collection of Pig scripts that I use for my talks and workshops about Pig and Hadoop.

Slides

You can find the slides that I used from my slideshare account. You can also checkout, some of my other talks as well.

File list

Pig files

The following are the pig files that are present in this repository.

  • load-store.pig - Load and store example
  • multi-delimiter.pig - Explain how to load data using multiple delimiters
  • data-bag.pig - Explain the bag data structure
  • lookup.pig - Explains how to lookup to a particular column in a relation
  • group-by.pig - Explains how group up operator works
  • filter-by.pig - Demonstrates the filter by operator
  • count.pig - Demonstrates the count operator
  • order-by.pig - Demonstrates the order by operator
  • distinct.pig - Demonstrates the distinct operator
  • limit.pig - Demonstrates the LIMIT operator
  • join.pig - Demonstrates the JOIN operator
  • count-words.pig - Count the number of words in a text file
  • strip-quote.pig - Strips quotes from tweets. Demonstrates UDF
  • get-twitter-names.pig - Finds twitter usernames from tweets. Demonstrates UDF
  • from-vim.pig - Finds all tweets that were tweeted from Vim. Demonstrates Filter UDF functions
  • stream-shell-script.pig - Demonstrates how shell commands can be executed in Pig through Streaming
  • stream-python.pig - Streams data through a python script
    • strip.py - This python script would be invoked by Pig and the data will be streamed through it

UDF directory

The /udf directory contains the Java source code for the UDF that are consumed by the pig scripts. The following are the Java files that are present in this directory.

  • StripQuote.java - An Eval UDF function that strips quote from strings
  • GetTwitterNames.java - An Eval UDF function to get the twitter names in a tweet
  • FromVim.java - A filter UDF function

Data directory

The /data directory contains the data files that are used by these samples. The following are the files that are present in this directory.

  • dropbox-policy.txt - A copy of dropbox policy document. This file is used for doing word analysis.
  • tweets.csv - A dump of my tweets that I got from twitter.
  • data-bag.txt - A simple data file to explain bag data type
  • nested-schema.txt - A simple data file to explain nested data schemas
  • simple-tuples - A simple data file to explain simple tuples
  • multi-delimiter.txt - A simple data file that contains data that have multiple delimiters

other files

  • clean.sh - A shell script to clean pig log files and output data files

License

The library and the example are released under released under BeerWare license.

I would, however, consider it a great courtesy if you could email me and tell me about your project and how this code was used, just for my own continued personal gratification.

Contributions

All contributions (even documentation) are welcome :)

If you would like to contribute to this project, then just fork it in github and send a pull request.

pig-samples's People

Contributors

sudar avatar

Stargazers

 avatar Spacial avatar Tiago Pavloski avatar

Watchers

James Cloos avatar Marcio Junior Vieira 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.