[
https://issues.apache.org/jira/browse/IGNITE-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17305382#comment-17305382
]
Sergey Dorozhkin commented on IGNITE-14325:
-------------------------------------------
[~agoncharuk] Hi!
I think to start a work on this ticket, but I a little confused with acceptable
input formats.
Converting string to required datatype currently doing by H2. For example,
DateTimeUtils.parseDateValue is used for converting to date.
H2 don't pass acceptable formats to Exception and I didn't find how I can get
this fromats from H2. I found it only in comments in h2.
I think, store acceptable formats for different datatypes in our side not a
good idea, because format in H2 side can be changed.
For example, in H2 which used by Ignite acceptable format is 'year-month-day',
but currently h2 additional support 'yyyyMMdd'.
Do you have any thoughts?
Maybe we can make a link to the H2 documentation?
> SQL COPY command: when conversion fails, the error does not contain
> information about line number and the failed value
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: IGNITE-14325
> URL: https://issues.apache.org/jira/browse/IGNITE-14325
> Project: Ignite
> Issue Type: Improvement
> Affects Versions: 2.10
> Reporter: Alexey Goncharuk
> Priority: Major
>
> I was trying to import data from a CSV file to Ignite cache through sqlline.
> When a file contains a value that cannot be converted to the schema format,
> the error message printed by the client is absolutely useless:
> {code}
> Error: Server error: class
> org.apache.ignite.internal.processors.query.IgniteSQLException: Value
> conversion failed [column=PICKUP_DATETIME, from=java.lang.String,
> to=java.sql.Timestamp] (state=50000,code=1)
> java.sql.SQLException: Server error: class
> org.apache.ignite.internal.processors.query.IgniteSQLException: Value
> conversion failed [column=PICKUP_DATETIME, from=java.lang.String,
> to=java.sql.Timestamp]
> 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)
> {code}
> The server log does not contain any helpful information as well.
> When input validation failed, we need to output the following context
> information:
> * Line number of the source file that triggered the error
> * A few values preceding the wrong column
> * The exact value that failed parse/conversion error
> * For complex types (such as date/timestamp), the acceptable input formats
--
This message was sent by Atlassian Jira
(v8.3.4#803005)