Monday, April 27, 2015

USER DEFINED FUNCTION IN PIG HADOOP

Embedded Mode :

 When we are not getting the desired functionality through built in transformation operator in Pig then we ahead with UDF.

Steps For Developing Pig UDF(USER DEFINED FUNCTION)

  1. Write a Class that will extend the base class of EVAL FUNCTION syntax :Eval Function<string>
  2. In order to write business logic we need to overwrite method called execute which takes tuple input 
    exec(tuple input)
  3. We need to dependent compilation Jar File for compilation purpose we have to create our own jar file to be deployed in hadoop environment.
  4. Add the same Jar file Main Script Using REGISTER Keyword.
    Register is the First Line of any script.







No comments:

Post a Comment