Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not support Array(Tuple(name String, previous_value String, new_value String, reason String)) type #456

Open
beijishiqidu opened this issue Dec 5, 2023 · 0 comments

Comments

@beijishiqidu
Copy link

Environment

  • OS version: suse 12.5
  • 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

com.github.housepower.exception.ClickHouseSQLException: Unknown data type: name
	at com.github.housepower.misc.ExceptionUtil.rethrowSQLException(ExceptionUtil.java:82)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.executeUpdate(ClickHouseStatement.java:78)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.executeQuery(ClickHouseStatement.java:109)
	at com.huawei.jdbc.NoEncryptJdbcClient.main(NoEncryptJdbcClient.java:23)
Caused by: java.sql.SQLException: Unknown data type: name
	at com.github.housepower.misc.Validate.isTrue(Validate.java:41)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:95)
	at com.github.housepower.data.type.complex.DataTypeTuple.lambda$static$0(DataTypeTuple.java:39)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:68)
	at com.github.housepower.data.type.complex.DataTypeArray.lambda$static$0(DataTypeArray.java:39)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:70)
	at com.github.housepower.data.DataTypeFactory.get(DataTypeFactory.java:55)
	at com.github.housepower.data.Block.readFrom(Block.java:43)
	at com.github.housepower.protocol.DataResponse.readFrom(DataResponse.java:32)
	at com.github.housepower.protocol.Response.readFrom(Response.java:33)
	at com.github.housepower.client.NativeClient.receiveResponse(NativeClient.java:207)
	at com.github.housepower.client.NativeClient.lambda$receiveQuery$0(NativeClient.java:164)
	at com.github.housepower.stream.ClickHouseQueryResult.consumeDataResponse(ClickHouseQueryResult.java:102)
	at com.github.housepower.stream.ClickHouseQueryResult.ensureHeaderConsumed(ClickHouseQueryResult.java:93)
	at com.github.housepower.stream.ClickHouseQueryResult.header(ClickHouseQueryResult.java:54)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.lambda$executeUpdate$0(ClickHouseStatement.java:102)
	at com.github.housepower.misc.ExceptionUtil.rethrowSQLException(ExceptionUtil.java:76)
	... 3 more

Steps to reproduce

java code:

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", "hNG?JW0hnMpX0qb@");
        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();
        }
    }

Other descriptions

execute sql script in the command line:

show create table settings_changes

┌─statement───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE system.settings_changes
(
    `version` String,
    `changes` Array(Tuple(name String, previous_value String, new_value String, reason String))
)
ENGINE = SystemSettingsChanges
COMMENT 'SYSTEM TABLE is built on the fly.' │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

I see that the latest clickhouse version adds a lot of table and field types. Example: system.settings_changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant