Friday 15 July 2011

apache pig - Pig CSVExcelStorage remove header -



apache pig - Pig CSVExcelStorage remove header -

i've seen there constructor accepts header command parameter

csvexcelstorage(string delimiter, string multilinetreatmentstr, string eoltreatmentstr, string headertreatmentstr)

however haven't found value of "skip_input_header" constant.

i dont know why want constant value of skip_input_header if intention remove header during load, please check below example

input.csv name,age,location a,10,chennai b,20,banglore pigscript:(with skip_input_header) register '/tmp/piggybank.jar'; = load 'input.csv' using org.apache.pig.piggybank.storage.csvexcelstorage(',', 'no_multiline', 'unix', 'skip_input_header'); dump a; output: (a,10,chennai) (b,20,banglore) pigscript:(without skip_input_header) register '/tmp/piggybank.jar'; = load 'input.csv' using org.apache.pig.piggybank.storage.csvexcelstorage(',', 'no_multiline', 'unix'); dump a; output: (name,age,location) (a,10,chennai) (b,20,banglore)

apache-pig

No comments:

Post a Comment