zoltanctoth
zoltanctoth

Reputation: 2927

Hadoop Pig ISO Date to Unix Timestamp

I have a list of items in Pig consisting of ISO 8601 (YYYY-MM-DD) formatted date strings:

(2011-12-01)
(2011-12-01)
(2011-12-02)

Is there any way to transform these items into UNIX timestamps apart from implementing my own functions in Java?

Upvotes: 4

Views: 6808

Answers (1)

Arnon Rotem-Gal-Oz
Arnon Rotem-Gal-Oz

Reputation: 25909

You need a UDF to do that = The good news it has already been done. Pig also comes with "piggybank" UDFs contributed by the community including date convert

Upvotes: 6

Related Questions