使用Apache Pig将它们加载到HBase中时,我需要忽略CSV文件中的几列。
CSV文件示例:
No,Name,City
1,a,ny
2,b,la
3,c,chi
我是否可以只将No
和City
加载到HBase而忽略Name
?
答案 0 :(得分:0)
raw_data = LOAD 'hdfs//Sample.txt' USING PigStorage(',') AS (No:int,Name:chararray,City:chararray);
selected_data = FOREACH raw_data GENERATE $0 as No,$2 as City;
STORE selected_data INTO 'hbase://YourTable' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('YourTable:City');