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")
如果我只需要前三列?
1条答案
按热度按时间oymdgrw71#
evn.readCsvFile()
返回一个CsvReader
. 我假设异常是因为您没有将分隔符字符串设置为"|"
,默认分隔符为","
.