我加载文件并分两步生成日期:
A = LOAD 'foo.txt' USING PigStorage('\\u001') AS (
bar:chararray
,baz:int
);
B = FOREACH A GENERATE
ToDate(bar, 'yyyy-MM-dd HH:mm:ss') AS bar
,baz
;
如何一步完成?
以下引发错误(mismatched input '(' expecting RIGHT_PARAN
:
A = LOAD 'foo.txt' USING PigStorage('\\u001') AS (
ToDate(bar:chararray, 'yyyy-MM-dd HH:mm:ss') AS bar
,baz:int
);
或
A = LOAD 'foo.txt' USING PigStorage('\\u001') AS (
ToDate($0, 'yyyy-MM-dd HH:mm:ss') AS bar
,baz:int
);