ClickHouse-Native-JDBC icon indicating copy to clipboard operation
ClickHouse-Native-JDBC copied to clipboard

Unknown compression magic code: 105

Open beijishiqidu opened this issue 2 years ago • 2 comments

Environment

  • OS version:
  • JDK version: 1.8
  • ClickHouse Server version: 23.8.2.7
  • ClickHouse Native JDBC version: 2.7.1
  • (Optional) Spark version: N/A
  • (Optional) Other components' version: N/A

Error logs

isClosed: false
Exception in thread "main" java.lang.UnsupportedOperationException: Unknown compression magic code: 105
	at com.github.housepower.buffer.CompressedBuffedReader.readCompressedData(CompressedBuffedReader.java:101)
	at com.github.housepower.buffer.CompressedBuffedReader.readBinary(CompressedBuffedReader.java:45)
	at com.github.housepower.serde.BinaryDeserializer.readVarInt(BinaryDeserializer.java:47)
	at com.github.housepower.protocol.Response.readFrom(Response.java:29)
	at com.github.housepower.client.NativeClient.receiveResponse(NativeClient.java:207)
	at com.github.housepower.client.NativeClient.ping(NativeClient.java:113)
	at com.github.housepower.jdbc.ClickHouseConnection.isValid(ClickHouseConnection.java:213)
	at com.huawei.jdbc.NoEncryptJdbcClient.main(NoEncryptJdbcClient.java:30)

Steps to reproduce

When an error is reported when I query the system.settings_changes table, the current connection becomes invalid. Or it can no longer proceed with other query requests.

because this issue: https://github.com/housepower/ClickHouse-Native-JDBC/issues/456

public static void main(String[] args) throws Exception {
        Class.forName("com.github.housepower.jdbc.ClickHouseDriver");
        Properties clickHouseProperties = new Properties();
        clickHouseProperties.put("user", "nethouse");
        clickHouseProperties.put("password", "xxxxxxx");
        Connection conn = DriverManager.getConnection("jdbc:clickhouse://10.185.206.152:9120/NETHOUSE",
            clickHouseProperties);
        try {
            ResultSet resultSet = conn.createStatement().executeQuery("select * from system.settings_changes");
        } catch (Throwable e) {
            // e.printStackTrace();
        }

        System.out.println("isClosed: " + conn.isClosed());
        System.out.println("isValid: " + conn.isValid(2));
        try {
            ResultSet resultSet = conn.createStatement().executeQuery("select * from system.clusters");
        } catch (SQLException e) {
            // e.printStackTrace();
        }
    }

Other descriptions

It's kind of like the https://github.com/housepower/ClickHouse-Native-JDBC/issues/432 issue

beijishiqidu avatar Dec 05 '23 12:12 beijishiqidu

@dmitrybugakov Hello, my friend, is this open source software unmaintained now? I found a lot of problems that didn't close and didn't adapt to the latest ClickHouse version.

beijishiqidu avatar Dec 07 '23 01:12 beijishiqidu

Hello @beijishiqidu

Unfortunately, I don't have time right now to actively maintain this project. Regarding your notice, it could be because we are testing against a "clickhouse-server:21.9" version.

dmitriibugakov avatar Dec 07 '23 16:12 dmitriibugakov