Java UDF to CONCAT multiple fields in Apache Pig

unit test java pig script

JAVA UDF – CONCAT multiple fields in Apache Pig

PigUnit Tests

PIG Script – CONCAT multIple fields in apache pig

In order to use this UDF, just need to pass all the values that you will want to concatenate. Using a customized UDF could give you flexibility on how you want to concatenate multiple fields and still looks cleaner in your PIG script.

This UDF will be a little easier to read than CONCAT function.