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

Insert batch - JSON error

Open subkanthi opened this issue 3 years ago • 2 comments

java.sql.BatchUpdateException: Code: 48. DB::Exception: Method getDefault() is not implemented for data type Object('json'). (NOT_IMPLEMENTED) (version 22.7.1.2484 (official build))
sink              | , server ClickHouseNode [uri=http://clickhouse:8123/test, options={client_name=Agent_1}]@-1529990687
sink              | 	at com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:109)
sink              | 	at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.executeAny(InputBasedPreparedStatement.java:142)
sink              | 	at com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeLargeBatch(AbstractPreparedStatement.java:85)
sink              | 	at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.executeBatch(ClickHouseStatementImpl.java:568)

Looks like a server error, will close it after investigation.

subkanthi avatar Aug 02 '22 14:08 subkanthi

Hi @subkanthi, what's the query for reproducing the issue? There's workaround(just treat JSON as String) for client-side serialization issue mentioned in #1023.

zhicwu avatar Aug 03 '22 07:08 zhicwu

I was able to reproduce the issue and I believe it's more of a server side issue - ClickHouse/ClickHouse#39866

zhicwu avatar Aug 03 '22 14:08 zhicwu