pig tutorial - apache pig tutorial - Apache Pig RTRIM() - pig latin - apache pig - pig hadoop
What is RTRIM()?
- The function RTRIM() is same as the function TRIM(). It removes the unwanted spaces from the right side of a given string (tailing spaces).
Syntax:
- The syntax of the RTRIM() function is as follows −
Example:
- Assume we have some unwanted spaces before and after the names of the employees in the records of the wikitechy_emp_data relation as shown below.
- Using the RTRIM() function, we can remove the heading spaces from the names as shown below
- The above statement returns the copy of the names by removing the tailing spaces from the names of the employees.
- The result is stored in the relation named rtrim_data.
- Verify the result of the relation rtrim_data using the Dump operator as shown below.