ClickHouse-Native-JDBC
ClickHouse-Native-JDBC copied to clipboard
how to ignore some error rows when batch insert
Environment
- OS version: mac lastest
- JDK version: jdk 8
- ClickHouse Server version: lastest
- ClickHouse Native JDBC version: lastest
when i insert batch rows, it will just throw exception if there is error type rows.
example: a data comlumn type is FixedString(3), but one row's column size over 3 and the others is ok. native jdbc will just thorw exception.
there is some solution to ignore the error row in native jdbc? or it needs myself to catch exception and record index, then skip the error rows manually?
I'm afraid not, you must handle the size check before you call execute
I'm afraid not, you must handle the size check before you call execute
Of course i can check every column, but is it the meaningful to add api like statement.addBatchIgnoreRows(). Just let native-jdbc skip error row, since the memroy have every column type
But statement.addBatchIgnoreRows()
is not standard JDBC way, because statement is an interface.
https://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html