-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Flink sinking clickhouse .some error -- java.lang.IllegalArgumentException: Only singleton array is allowed, but we got: ["E5", "E6"] #896
Comments
when i use v0.3.2-patch7.A different set of errors resurfaced exg: Caused by: java.lang.RuntimeException: Writing records to JDBC failed. |
Hi @Aload, the issue happens when you're trying to update a non-array column using an array, for example: trying to update a Would you mind to share the table structure(especially the column you failed to update using array)? Also it would be very helpful if you can provide code snippet for reproducing the issue. Update: please refer to test case like this if you need to deal with array, or maybe this for complex data type(e.g. array of map etc.). |
|
When I coded in Scala, I couldn't achieve the desired effect Caused by: java.lang.RuntimeException: Writing records to JDBC failed. |
The exception is irrelevant to your initial question or array. It looks like you passed |
I run into the same error since version 0.3.2-patch6. Up to version 0.3.2-patch5 everything works fine. I poked around an bit and found out that the jdbc-driver has problems with empty strings. Before patch6 everything worked fine. This behavior still exists in patch9 |
|
Ok TKS .this error is okay.
发自我的iPhone
… 在 2022年4月15日,上午9:30,Zhichun Wu ***@***.***> 写道:
The exception is irrelevant to your initial question or array. It looks like you passed null to a non-nullable String column.
https://github.com/ClickHouse/clickhouse-jdbc/blob/058596195ce1dc24fed2cf20a669459c8eec43d0/clickhouse-client/src/main/java/com/clickhouse/client/data/BinaryStreamUtils.java#L1661
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
When I use v0.3.2 ,
val array = pst.getConnection
.createArrayOf(ClickHouseDataType.String.name(),
ClickHouseArrayValue.of(intoMsg.withArrayJsonNode.elements().asScala.toArray).asArray())
pst.setArray(20, array) //告警
pst.setInt(21, intoMsg.get("isInterpolate").asInt) //是否插补(0正常||1插补)
this update must size=0?
Caused by: java.lang.RuntimeException: Writing records to JDBC failed.
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.checkFlushException(JdbcBatchingOutputFormat.java:153)
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.flush(JdbcBatchingOutputFormat.java:179)
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.close(JdbcBatchingOutputFormat.java:229)
... 11 more
Caused by: java.lang.IllegalArgumentException: Only singleton array is allowed, but we got: ["E5", "E6"]
at com.clickhouse.client.ClickHouseValue.update(ClickHouseValue.java:1148)
at com.clickhouse.jdbc.ClickHouseConnection.createArrayOf(ClickHouseConnection.java:40)
at com.clickhouse.jdbc.ClickHouseConnection.createArrayOf(ClickHouseConnection.java:23)
at com.anso.process.function.JdbcCkStatementBuilder.accept(JdbcCkStatementBuilder.scala:55)
at com.anso.process.function.JdbcCkStatementBuilder.accept(JdbcCkStatementBuilder.scala:21)
at org.apache.flink.connector.jdbc.internal.executor.SimpleBatchStatementExecutor.executeBatch(SimpleBatchStatementExecutor.java:70)
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.attemptFlush(JdbcBatchingOutputFormat.java:213)
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.flush(JdbcBatchingOutputFormat.java:183)
at org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat.lambda$open$0(JdbcBatchingOutputFormat.java:127)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
The text was updated successfully, but these errors were encountered: