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

Unknown compression magic code: 105 #457

Open beijishiqidu opened 11 months ago

beijishiqidu commented 11 months ago

Environment

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 commented 11 months ago

@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.

demetribu commented 11 months ago

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.