grunt> data = LOAD 'file' USING PigStorage(';') AS (f1: chararray, f2: chararray);
grunt> t = FOREACH data GENERATE TOTUPLE(f1, f1) as t;
grunt> DESCRIBE t;
t: {t: (f1: chararray,f1: chararray)}
grunt> t = FOREACH t GENERATE t AS t:tuple(f3:chararray, f4:chararray);
grunt> DESCRIBE t;
t: {t: (f3: chararray,f4: chararray)}
如果你愿意,你可以省略 tuple 关键字:
grunt> t = FOREACH t GENERATE t AS t:(f5:chararray, f6:chararray);
grunt> DESCRIBE t;
t: {t: (f5: chararray,f6: chararray)}
1条答案
按热度按时间4uqofj5v1#
您可以为复杂数据类型提供模式,就像为基本数据类型提供模式一样:
如果你愿意,你可以省略
tuple
关键字: