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

Unable to select postgres/cockroachDB UUID as ClickHouse UUID #158

Open
sashayakovtseva opened this issue Oct 4, 2022 · 2 comments
Open

Comments

@sashayakovtseva
Copy link

sashayakovtseva commented Oct 4, 2022

I am trying try connect cockroachDB to ClickHouse via PostgreSQL jdbc driver.
Cockroach claims to be PostgreSQL compatible, and indeed in go application we work with it using pgx driver. That means, PostgreSQL jdbc driver must work as well (see their docs).

However, it is impossible to query cockroach UUID as ClickHouse UUID type while it is possible to query cockroach UUID as ClickHouse String type (which is not something we want to do).

At first I thought this may be cockroach-specific issue and incompatibility, but the same error is reproducible with PostgreSQL.

The error itself:

Received exception from server (version 22.9.2): Code: 33. DB::Exception: Received from localhost:9000. DB::Exception: Cannot read all data. Bytes read: 5. Bytes expected: 16.: (in file/uri http://clickhouse-jdbc-bridge:9019/?version=1&connection_string=jdbc%3Apostgresql%3A%2F%2Fcockroach%3A26257%2Fdefaultdb&max_block_size=65505): (at row 3) : While executing BinaryRowInputFormat: While executing JDBC. (CANNOT_READ_ALL_DATA) (query: SELECT * from test.cockroach_test_uuid_to_uuid)

Steps to reproduce are described in this repo.
I've also tried custom mapping on jdbc side, but got same error. Steps to reproduce are here.

@zhicwu
Copy link
Contributor

zhicwu commented Oct 5, 2022

Hi @sashayakovtseva, thanks for reporting the issue and providing the repo for reproducing the issue. Have you tried workaround like converting string to uuid in ClickHouse?

@sashayakovtseva
Copy link
Author

I have not. My use-case includes JOIN leverage (yes, unfortunately we need joins). So idea was to join by uuid as both clickhouse and cockroach source have columns of that type. As I understand correctly, I would have to call toUUID every time I need to perform that join and this may lead to poor performance. Am I wrong?

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

2 participants