Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to make a PIG UDF

How to make a PIG UDF

A C# Developers intro...

Stuart Lodge

November 06, 2012
Tweet

More Decks by Stuart Lodge

Other Decks in Technology

Transcript

  1. Simple UDF Script -- myscript.pig REGISTER myudfs.jar; A = LOAD

    'student_data' AS (name: chararray, age: int, gpa: float); B = FOREACH A GENERATE myudfs.UPPER(name); DUMP B;
  2. So… let’s write this UDF… 1. Start Eclipse 2. Create

    a new Java Project 3. Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR
  3. So… let’s write this UDF… 1. Start Eclipse 2. Create

    a new Java Project 3. Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR
  4. So… let’s write this UDF… 1. Start Eclipse 2. Create

    a new Java Project 3. Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR
  5. So… let’s write this UDF… 1. Start Eclipse 2. Create

    a new Java Project 3. Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR
  6. So… let’s write this UDF… 1. Start Eclipse 2. Create

    a new Java Project 3. Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR
  7. 1. Start Eclipse 2. Create a new Java Project 3.

    Add pig.jar as an external Jar 4. Write our UDF class 5. Compile to a JAR So… let’s write this UDF…