Extract first line of CSV file in Pig

后端 未结 2 1448
情话喂你
情话喂你 2021-01-23 09:31

I have several CSV files and the header is always the first line in the file. What\'s the best way to get that line out of the CSV file as a string in Pig? Preprocessing with se

2条回答
  •  温柔的废话
    2021-01-23 09:58

    If your CSV comply with CSV conventions of Excel 2007 you can use already available loader from Piggybank http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java?view=markup

    It has an option to skip the CSV header SKIP_INPUT_HEADER

提交回复
热议问题