将包含字符串和数字格式的 CSV 数据加载到 Ignite 失败

Loading CSV data containing string and numeric format to Ignite is failing

我正在评估 Ignite 并尝试将 CSV 数据加载到 Apache Ignite。我在 Ignite 中创建了一个 table:

jdbc:ignite:thin://127.0.0.1/> create table if not exists SAMPLE_DATA_PK(SID varchar(30),id_status varchar(50), active varchar, count_opening int,count_updated int,ID_caller varchar(50),opened_time varchar(50),created_at varchar(50),type_contact varchar, location varchar,support_incharge varchar,pk varchar(10) primary key);

我尝试使用以下命令将数据加载到此 table:

copy from '/home/kkn/data/sample_data_pk.csv' into SAMPLE_DATA_PK(SID,ID_status,active,count_opening,count_updated,ID_caller,opened_time,created_at,type_contact,location,support_incharge,pk) format csv;

但是数据加载失败并出现此错误:

Error: Server error: class org.apache.ignite.internal.processors.query.IgniteSQLException: Value conversion failed [column=COUNT_OPENING, from=java.lang.String, to=java.lang.Integer] (state=50000,code=1)
java.sql.SQLException: Server error: class org.apache.ignite.internal.processors.query.IgniteSQLException: Value conversion failed [column=COUNT_OPENING, from=java.lang.String, to=java.lang.Integer]
    at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:1009)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.sendFile(JdbcThinStatement.java:336)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:243)
    at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:560)
    at sqlline.Commands.executeSingleQuery(Commands.java:1054)
    at sqlline.Commands.execute(Commands.java:1003)
    at sqlline.Commands.sql(Commands.java:967)
    at sqlline.SqlLine.dispatch(SqlLine.java:734)
    at sqlline.SqlLine.begin(SqlLine.java:541)
    at sqlline.SqlLine.start(SqlLine.java:267)
    at sqlline.SqlLine.main(SqlLine.java:206)

下面是我尝试加载的示例数据: SID|ID_status|活动|count_opening|count_updated|ID_caller|opened_time|created_at|type_contact|位置|support_incharge|pk |---|--------|------|------------|------------| ----------|------------|------------|------------|---- ----|----------------|--| INC0000045|New|true|1000|0|Caller2403|29-02-2016 01:16|29-02-2016 01:23|Phone|Location143||1 INC0000045|已解决|true|0|3|Caller2403|29-02-2016 01:16|29-02-2016 01:23|Phone|Location143||2 INC0000045|Closed|false|0|1|Caller2403|29-02-2016 01:16|29-02-2016 01:23|Phone|Location143||3 INC0000047|活动|真|0|1|来电者2403|29-02-2016 04:40|29-02-2016 04:57|Phone|位置165||4 INC0000047|活动|真|0|2|来电者2403|29-02-2016 04:40|29-02-2016 04:57|Phone|位置165||5 INC0000047|活动|真|0|489|呼叫者2403|29-02-2016 04:40|29-02-2016 04:57|Phone|位置165||6 INC0000047|活动|真|0|5|来电者2403|29-02-2016 04:40|29-02-2016 04:57|Phone|位置165||7 INC0000047|AwaitingUserInfo|true|0|6|Caller2403|29-02-2016 04:40|29-02-2016 04:57|Phone|Location165||8 INC0000047|Closed|false|0|8|Caller2403|29-02-2016 04:40|29-02-2016 04:57|Phone|Location165||9 INC0000057|New|true|0|0|Caller4416|29-02-2016 06:10||Phone|Location204||10

需要帮助以了解如何找出问题所在并加以解决

您必须上传没有 header 行的 CSV。其中包含列名。尝试将字符串值“count_opening”转换为整数时抛出错误。