Skip to content

How to read FixedString back into java #1544

Open
@tpoll

Description

@tpoll

My application has some CH columns I store as FixedString(16) values. When I'm writing them into ClickHouse via JDBC, I pass in a byte array of length 16, and see that my values are properly persisted. However, when I attempt to read the values back out, it seems that the ClickHouseResultSet automatically puts the column into a ClickhouseStringValue. It's then pretty tricky to retrieve this the underlying bytes of the string are the 32 byte representation of the 16 character fixed string.

Is it possible to add some logic in to the client to map FixedString types back out as a byte array? Does anyone have guidance on the best java type to map Fixed string values into and out of with JDBC?

I'm on client version 0.5.0
java version 21.0.1
and CH server version 23.9.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdata-typedata type processing issuesjdbc-v2jdbc-v2 issuesusabilitywhat affects usability of the client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions