housepower / ClickHouse-Native-JDBC

ClickHouse Native Protocol JDBC implementation
https://housepower.github.io/ClickHouse-Native-JDBC/
Apache License 2.0
527 stars 145 forks source link

Cannot return the affected rows count after updating #374

Closed MephistoLynn closed 3 years ago

MephistoLynn commented 3 years ago

Environment

My Environment : DBMS: ClickHouse (ver. 20.10.54441) Case sensitivity: plain=exact, delimited=exact Driver: com.github.housepower.clickhouse.native.jdbc (ver. 54380, JDBC1.1) Effective version: ClickHouse (ver. 20.10.7.4)

Using this Driver ,in any updating operation ,I cannot see the message of affected rows count.

Is that the Driver's Setting or the function which not yet implemented ?

sundy-li commented 3 years ago

Is https://github.com/housepower/ClickHouse-Native-JDBC/blob/21cbb5ebab0a5cab54174e049c268ab8bc6da032/clickhouse-native-jdbc/src/main/java/com/github/housepower/jdbc/statement/ClickHouseStatement.java#L105 you want?

MephistoLynn commented 3 years ago

I think this is the reason of the problem

image2

sundy-li commented 3 years ago

So Your SQL is not kind of insert SQL?

What's your update SQL?

MephistoLynn commented 3 years ago

That is my SQL for updata ALTER TABLE data_page_product_info UPDATE product_id=200 WHERE data_page_id=999;

sundy-li commented 3 years ago

That is my SQL for updata ALTER TABLE data_page_product_info UPDATE product_id=200 WHERE data_page_id=999;

You should know that clickhouse's alter update is async update, you never know when it is finished.

See: https://clickhouse.com/docs/en/sql-reference/statements/alter/update/