0
votes

I wanted to convert userinput:chararray to date, so I am planning to use the ToDate(userinput,'dd/MM/yyyy') function. I have searched the forum to see if people have used it but I am not sure if I need to register anything like piggybank.jar to use this function. My pig version is 0.14.

Please advise

1

1 Answers

1
votes

Ref : http://pig.apache.org/docs/r0.12.0/func.html#to-date

Its an inbuilt function, you need not register any jar. There are 4 overloaded ToDate() functions

  1. ToDate(milliseconds)

  2. ToDate(iosstring)

  3. ToDate(userstring, format)

  4. ToDate(userstring, format, timezone)

For your usecase #3 or #4 would help.