0

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

Balduz
  • 3,560
  • 19
  • 35
Bimal
  • 17
  • 5

1 Answers1

1

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.

Murali Rao
  • 2,287
  • 11
  • 18
  • Thank you. I was travelling on the plane and researching so could not test it. Planning to use #3. Thank you for confirming. – Bimal May 29 '15 at 13:37