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