Created
August 14, 2013 13:37
-
-
Save infectious/6231152 to your computer and use it in GitHub Desktop.
Piggybank ISOToUnix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register /home/hadoop/.versions/pig-0.11.1.1/lib/pig/piggybank-0.11.1.1-amzn.jar; | |
define ISOToUnix org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix(); | |
data = load 'data_file.txt' using PigStorage('\t') as (user_id:int, datetime:chararray); | |
data = limit data 10000; | |
pdata = foreach generate | |
user_id, | |
ISOToUnix(datetime) / 1000 as timestamp:long; | |
dump pdata; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment