91
Apache Pig CONCAT Function
The Apache Pig CONCAT function is used to concatenate two or more expressions. The generated result of expression must have identical types. However, if any sub-expression is null, the generated expression is also null.
Example of CONCAT Function
In this example, we concatenate the first two fields of each tuple.
Steps to execute CONCAT Function
- Create a text file in your local machine and insert the list of tuples.
- Check the tuples inserted in the text files.
- Upload the text files on HDFS in the specific directory.
- Open the pig MapReduce run mode.
- Load the file that contains the data.
- Now, execute and verify the data.
- Let’s return the concatenation of two fields of each tuple.
Here, we got the desired output.
Next TopicCOUNT Function