我有一个csv文件,里面大约有50列。我只想从中读取特定的列。我有办法做到吗?例子:csv有,col1,col2,col3,col4,col5,col6,…,col50我要装货
load 'path to file' as (col1, col18, col47);
我想做那样的事。
uqjltbpv1#
加载它而不是投影它:
REGISTER 'piggybank.jar' DEFINE CSVLoader org.apache.pig.piggybank.storage.CSVLoader(); A = LOAD 'data.csv' USING CSVLoader(); B = FOREACH A GENERATE $0 AS col1, $17 AS col18, $46 AS col47; ...
1条答案
按热度按时间uqjltbpv1#
加载它而不是投影它: