我有一个日期 chararray 2014-11-02 16:57:29。我想把它转换成 long 我该怎么做?
DEFINE ISOToUnix org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix();
DEFINE CustomFormatToISO org.apache.pig.piggybank.evaluation.datetime.convert.CustomFormatToISO();
ISOin = LOAD '/user/sample/test.csv' USING PigStorage() AS (dt:chararray, dt2:chararray);
toUnix = FOREACH ISOin GENERATE ISOToUnix(CustomFormatToISO(dt, 'YYYY-MM-DD HH:MM:SS')) AS event_time;
DUMP toUnix;
test.csv 包含 2014-11-02 16:57:29 2014-11-02 13:13:05
我正进入(状态
[POUserFunc (Name: POUserFunc(org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix)[long] - scope-5 Operator Key: scope-5) children: null at []]: java.lang.NullPointerException .
有人可以帮帮我吗。谢谢