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

Batch insert failed

Open ducklikeeat opened this issue 7 months ago • 2 comments

Company or project name

No response

Question

Why does the SQL in my XML file execute normally when inserted individually, but an error occurs when executed in batches, and the error code is -2, and I can't tell where the problem lies?

ducklikeeat avatar May 16 '25 08:05 ducklikeeat

INSERT INTO mq_log.t_supply_available_hotel ( supplier_id, sp_hotel_id, check_in, check_out, search_date, create_time ) values ( #{item.supplierId}, #{item.spHotelId}, #{item.checkIn,jdbcType=DATE}, #{item.checkOut,jdbcType=DATE}, #{item.searchDate,jdbcType=DATE}, #{item.createTime,jdbcType=TIMESTAMP} ) this is my xml

ducklikeeat avatar May 16 '25 08:05 ducklikeeat

Good day, @ducklikeeat! What version of the JDBC do you use? what library version do you use? what framework do you use? would you please share a sample code to understand how XML gets into a statement?

I think this is because we do not support constructions like #{item.checkIn,jdbcType=DATE} in the V2 JDBC because they are not defined in the spec.

Thanks!

chernser avatar May 16 '25 16:05 chernser