Skip to content

Exception when deserializing Array(FixedString(2)) from RowBinary output #1235

@fantnk

Description

@fantnk

Hi,

I'm trying to migrate to new http library from jdbc 0.3.1-parch. I've found that using Array(FixedString) column type with RowBinaryWithNamesAndTypes output format produces java.lang.ArrayStoreException: [B.

Code for reproduction:

void query() {
    ClickHouseNode endpoint = ClickHouseNode.of(URL);
    try (ClickHouseClient client = ClickHouseClient.builder()
            .config(new ClickHouseConfig(Map.of(),
                    ClickHouseCredentials.fromUserAndPassword(USER, PASSWORD),
                    ClickHouseNodeSelector.of(ClickHouseProtocol.HTTP),
                    null))
            .build();
         ClickHouseResponse response = client.connect(endpoint)
                 .query("select ['A1']::Array(FixedString(2)) as a")
                 .format(ClickHouseFormat.RowBinaryWithNamesAndTypes)
                 .executeAndWait()) {
        response.firstRecord();
    } catch (ClickHouseException e) {
        throw Exceptions.propagate(e);
    }
}

Client version: com.clickhouse:clickhouse-http-client:0.4.0
Server version: 21.11.3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions