請幫助建議。僅加載4個字段的2個字段 - Pig to Hive表
場景:使用Pig將數據從HDFS存儲到Hive。
我有從mySQL中挖出的文件,它有4個字段Ord_Id, Cust_Id, Cust_name, Ord_date
。我喜歡將僅2個字段Ord_Id和Cust_Id存儲到Hive。我怎麼能這樣做?請建議。
下面的代碼不能執行:
pig -useHCatalog
orders = LOAD '<HDFS_file_path>' USAGE PigStorage(',') AS (Ord_Id:Int, Cust_Id:Int, Cust_name:chararray, Ord_date:chararray);
STORE orders INTO 'pig_demo.orders' USAGE org.apache.hive.hcatalog.pig.HCatStorer();
感謝。