-
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
At least one SQL statement is required for execution #1828
Comments
@chernser Can you help me? |
Hi @xlvchao! |
@chernser Yes, i use jdbc driver directly in a springboot program! |
@xlvchao is it possible that batch can be empty? |
@zhicwu Bro, do you have any ideas? |
Hi @xlvchao ! |
@chernser When i reduced the batch size from 8000 to 1000 and then the problem disappeared! This is very strange! Could it be that this problem is related to the length of SQL? When the batch size is 8000, the SQL size exceeds 30 MB! |
@xlvchao, |
Found similar problem #1259 (comment) - for some reason invalid statement caused empty statement. The problem is in client Line 170 in b704b95
|
I've investigated the code and found that it may happen in very few conditions if internal statement is SQL based (data is send via series of insert statements) and statement has no parameters. I think there is some invalid parsing of initial query. Would you please give a very close to original example of this statement and how do you send data? Thanks! |
Here is the table script:
Here is the insert template:
Here is how JDBC is used:
Here is one of the data in a certain batch write:
|
@xlvchao thank you so much for the information! |
Good day, @xlvchao ! I've been looking into it yesterday.
I will continue next week since Monday. |
Good day, @chernser! There is a key point I forgot to mention! When this error occurs(At least one SQL statement...), after retrying several times with the same batch data, it succeeded! |
Thank you for the additional information! That looks strange that it requires several retries. Because it is client error. I will look into it. |
@chernser Hi, is everything ok? Have you found the root cause? |
Good day, @xlvchao ! |
JDBC vsersion:0.4.6
Clickhouse version:21.8.10.19
When I do batch insert, sometimes I get this error:
java.sql.BatchUpdateException: At least one SQL statement is required for execution, server ClickHouseNode [uri=http://10.109.152.2:8123/default, options={jdbcCompliant=false,collect_timeout=3600,max_execution_time=3600,socket_timeout=4800000,max_queued_buffers=0}]@-232571340
at com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:107)
at com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeAny(SqlBasedPreparedStatement.java:194)
at com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeLargeBatch(AbstractPreparedStatement.java:85)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.executeBatch(ClickHouseStatementImpl.java:754)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at com.hihonor.aiops.clickhouse.component.SinkWriter.writeToClickhouse(SinkWriter.java:80)
at com.hihonor.aiops.databus.task.ClickHouseTask.doWriteToCk(ClickHouseTask.java:190)
at com.hihonor.aiops.databus.task.ClickHouseTask.writeToCk(ClickHouseTask.java:122)
at com.hihonor.aiops.databus.task.ClickHouseTask.tryWriteToCk(ClickHouseTask.java:105)
at com.hihonor.aiops.databus.task.ClickHouseTask.run(ClickHouseTask.java:96)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
No problem with the data, so what is the reason for this error?
The text was updated successfully, but these errors were encountered: