flink parserror数值\u值\u非法\u字符

epggiuax  于 2021-06-21  发布在  Flink
关注(0)|答案(1)|浏览(255)
DataSet<Tuple3<Integer, Integer, Integer>> text1 = env.readCsvFile("/home/maple/Downloads/2.18.0_rc2/dbgen/lineitem.csv")
            .includeFields("1110000000000000")
            .types(Integer.class, Integer.class, Integer.class);

它是由dbgen自动生成的csv文件。一定有异常

Caused by: org.apache.flink.api.common.io.ParseException: Line could not be parsed: '149924|9005|292|6|37|33818.00|0.08|0.02|A|F|1994-12-14|1995-01-16|1994-12-15|TAKE BACK RETURN|RAIL|xcuses across the fina'
ParserError NUMERIC_VALUE_ILLEGAL_CHARACTER 
Expect field types: class java.lang.Integer, class java.lang.Integer, class java.lang.Integer 
in file: /home/maple/Downloads/2.18.0_rc2/dbgen/lineitem.csv

为什么?
顺便问一下,我能不能不写 .includeFields("1110000000000000") 如果我只需要前三列?

oymdgrw7

oymdgrw71#

evn.readCsvFile() 返回一个 CsvReader . 我假设异常是因为您没有将分隔符字符串设置为 "|" ,默认分隔符为 "," .

相关问题