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

[clickhouse-jdbc] describe SELECT queries to retrieve metadata #1700

Conversation

sylph-eu
Copy link
Contributor

@sylph-eu sylph-eu commented Jun 20, 2024

Summary

This is an attempt to reanimate #1434 to enable getMetadata() method to return metadata for a prepared SELECT query that hasn't yet been executed. Also see #1430 .

This functionality is needed (among other use-cases) to support query passthrough for clickhouse-connector inside Trino.

Implementation

DESCRIBE (<select>) is used to retrieve metadata about SELECT query that hasn't yet been executed.

Contrary to #1434 the method requires the query to be "recognized" and be SELECT, thus removing the ambiguity of supporting different query types. Otherwise it wraps the query inside DESCRIBE () clause to build respective metadata object.

Additional unit tests were added to address remarks to the original PR.

Checklist

Delete items not relevant to your PR:

  • [X ] Unit and integration tests covering the common scenarios were added
  • [X ] A human-readable description of the changes was provided to include in CHANGELOG

cc: @zhicwu , @ebyhr

@mshustov mshustov requested a review from chernser June 20, 2024 15:23
@chernser chernser merged commit abe31c6 into ClickHouse:main Jun 25, 2024
8 of 9 checks passed
@chernser
Copy link
Contributor

@sylph-eu Thank you for the contribution!

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

Successfully merging this pull request may close these issues.

2 participants