flink ParserError NUMERIC_VALUE_ILLEGAL_CHARACTER

时间:2019-02-17 18:00:10

标签: java csv apache-flink

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 个答案:

答案 0 :(得分:0)

/tmp/cc4RcEeE.o: In function `main': main.cpp:(.text+0xe): undefined reference to `std::cout' main.cpp:(.text+0x13): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' main.cpp:(.text+0x1d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' main.cpp:(.text+0x28): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' main.cpp:(.text+0x2f): undefined reference to `std::cin' main.cpp:(.text+0x34): undefined reference to `std::istream::get()' /tmp/cc4RcEeE.o: In function `__static_initialization_and_destruction_0(int, int)': main.cpp:(.text+0x64): undefined reference to `std::ios_base::Init::Init()' main.cpp:(.text+0x79): undefined reference to `std::ios_base::Init::~Init()' collect2: error: ld returned 1 exit status 返回一个CsvReader。我以为例外是因为您没有将定界符字符串设置为evn.readCsvFile(),而默认定界符是"|"