Search code examples
hadoopapache-piganalytics

Converting chararray to int in pig?


in Pig Analytics I have a database that has date in 'dd-MMM-YYYY' like 11-Dec-1985.Thats the birthdate.How do i get the age from it?And do some other Operations.Basically after exctracting how do i convert chararray to int type or any other possible way you suggest i can do. Thanks.


Solution

  • Can you use pig's ToDate builtin UDF ? http://pig.apache.org/docs/r0.17.0/func.html#to-date