有没有办法在现有表中添加额外的列?例如,为所有行添加额外列user
,null
列设置为date
2015-02-01
答案 0 :(得分:0)
你能试试吗?
<强>输入强>
49586,Winter Wonderland,2013,2.8
49587,Top Gear: Series 19: Africa Special,2013,3.1
49588,Fireplace For Your Home: Crackling Fireplace with Music,2010,7.3
<强> PigScript:强>
A = LOAD 'input' USING PigStorage(',') AS (serial:long,title:chararray,year:int,score:float);
B = FOREACH A GENERATE serial,title,year,score, null AS (user:long) ,'2015-02-01' AS (date:chararray);
DUMP B;
<强>输出:强>
(49586,Winter Wonderland,2013,2.8,,2015-02-01)
(49587,Top Gear: Series 19: Africa Special,2013,3.1,,2015-02-01)
(49588,Fireplace For Your Home: Crackling Fireplace with Music,2010,7.3,,2015-02-01)