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

Add back readUnsignedLeb128 in ClickHouseRowBinaryInputStream #710

Closed
vonnagy opened this issue Sep 1, 2021 · 6 comments · Fixed by #742
Closed

Add back readUnsignedLeb128 in ClickHouseRowBinaryInputStream #710

vonnagy opened this issue Sep 1, 2021 · 6 comments · Fixed by #742
Labels
Milestone

Comments

@vonnagy
Copy link

vonnagy commented Sep 1, 2021

When using the ClickHouseRowBinaryInputStream we used to be able to manually read string, arrays, etc by calling readUnsignedLeb128 to get the length and then iterating through the elements. It was removed with version 0.3.0 (commit# 074a030). See here for the change. Since the ClickHouseRowBinaryInputStream class interacts with the private instance of DataInputStream there is no current access to the information.

The following code could be added back.

public int readUnsignedLeb128() throws IOException {
    return Utils.readUnsignedLeb128(in);
}
@zhicwu zhicwu added the bug label Sep 2, 2021
@zhicwu zhicwu added this to the 0.3.2 Release milestone Sep 2, 2021
@zhicwu
Copy link
Contributor

zhicwu commented Sep 2, 2021

Thanks for pointing this out @vonnagy. I'll add it back in next release. However, please be aware that extended API including ClickHouseRowBinaryInputStream will be removed from clickhouse-jdbc starting from 0.4, as it will be replaced by clickhouse-client.

@lucky
Copy link

lucky commented Sep 2, 2021

However, please be aware that extended API including ClickHouseRowBinaryInputStream will be removed from clickhouse-jdbc starting from 0.4, as it will be replaced by clickhouse-client.

Will there be any library support for RowBinary(WithNamesAndTypes) anywhere?

@zhicwu
Copy link
Contributor

zhicwu commented Oct 5, 2021

Will there be any library support for RowBinary(WithNamesAndTypes) anywhere?

Yes. I'm going to create a PR tonight to upload new client, which is async by default and is built on top of gRPC and RowBinary format. With that, you can use com.clickhouse.client.data.BinaryStreamUtils to read/write most of data types(including Geo types) in RowBinary format. For nested data types like Array, Map, Nested, Tuple, and combined types(e.g. Array of Tuple in Nested column), you'll have to use methods in ClickHouseRowBinaryDataProcessor.

@zhicwu zhicwu added the module-jdbc JDBC driver label Oct 6, 2021
@zhicwu
Copy link
Contributor

zhicwu commented Oct 10, 2021

Merged into develop branch and will release in 0.3.2.

@zhicwu zhicwu closed this as completed Oct 10, 2021
@lucky
Copy link

lucky commented Oct 21, 2021

I'm going to create a PR tonight to upload new client

Did this ever happen? Is it a part of this repo?

@zhicwu
Copy link
Contributor

zhicwu commented Oct 21, 2021

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