clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Insert in RowBinaryWithDefaults format doesn't work when async_insert and wait_for_async_insert are enabled

Open ne1r0n opened this issue 10 months ago • 7 comments

Describe the bug

Steps to reproduce

  1. The easiest way to reproduce is to add
.set("async_insert", "1")
.set("wait_for_async_insert", "1")

to https://github.com/ClickHouse/clickhouse-java/blob/9e1772edf3a05fbb8e80659ee8664c68ed42e978/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java#L2523

Expected behaviour

Tested only for http protocol, so if clickhouse returns status_code == 200 then INSERT is successful or failed if not.

Error log

Caused by: com.clickhouse.client.ClickHouseException: Code: 399. DB::Exception: Format RowBinaryWithDefaults is not suitable for output. (FORMAT_IS_NOT_SUITABLE_FOR_OUTPUT) (version 24.2.2.71 (official build))
, server ClickHouseNode [uri=https://*******/****, options={sslmode=STRICT}]@879600952
	at com.clickhouse.client.ClickHouseException.of(ClickHouseException.java:168)
	at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:275)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 3 more
Caused by: java.io.IOException: Code: 399. DB::Exception: Format RowBinaryWithDefaults is not suitable for output. (FORMAT_IS_NOT_SUITABLE_FOR_OUTPUT) (version 24.2.2.71 (official build))
	at com.clickhouse.client.http.ApacheHttpConnectionImpl.checkResponse(ApacheHttpConnectionImpl.java:209)
	at com.clickhouse.client.http.ApacheHttpConnectionImpl.post(ApacheHttpConnectionImpl.java:243)
	at com.clickhouse.client.http.ClickHouseHttpClient.send(ClickHouseHttpClient.java:118)
	at com.clickhouse.client.AbstractClient.sendAsync(AbstractClient.java:161)
	at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:273)
	... 4 more

ne1r0n avatar Mar 28 '24 14:03 ne1r0n

Hi @ne1r0n Looking into it

mzitnik avatar Apr 04 '24 13:04 mzitnik

Are you testing against cloud or local version

mzitnik avatar Apr 04 '24 13:04 mzitnik

@mzitnik thank you, just wanted to add that initially I met this issue using https://github.com/ClickHouse/clickhouse-kafka-connect, @Paultagoras FYI.

Tested on local clickhouse version 24.2.2.71 and 24.3.1.2672

ne1r0n avatar Apr 04 '24 13:04 ne1r0n

Thanks for letting us know!

Paultagoras avatar Apr 05 '24 07:04 Paultagoras

Ok, we have found the problem in ClickHouse https://github.com/ClickHouse/ClickHouse/issues/62644

mzitnik avatar Apr 15 '24 16:04 mzitnik

Any updates on this issue? In our application, the client (v0.6.5) has the same 399 error but the insert seems to succeed anyways.

davimi avatar Sep 19 '24 10:09 davimi

Good day, @davimi! There is a CH issue https://github.com/ClickHouse/ClickHouse/issues/62644

chernser avatar Sep 19 '24 17:09 chernser