pig tutorial - apache pig tutorial - Apache Pig - ToDate(milliseconds) Function - pig latin - apache pig - pig hadoop
What is ToDate(milliseconds) Function in Apache Pig ?
- The ToDate(milliseconds) function will generate a DateTime object which is done according to the given parameters which is given in the function.
- The ToDate(milliseconds) function uses scalars as parameters which is done in the ToDate(milliseconds)function
- ToDate(milliseconds) function converts the ISO or the customized string or the Unix timestamp to the DateTime object.
- Ensure that we have a file named date.txt in the HDFS directory /pig_data/.
- This file contains the date-of-birth details of a particular person, id, date, and time.
- We have loaded the file into Pig with a relation name called date_data which is given below:
- Now you can calculate the DateTime object which is corresponding to the date-of-birth of the employee.
- We need to verify the content of this relation by using the Dump operator which is given below:
- The above statement stores the result in the relation named todate_data.