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

Decouple QueryData on the wire from decoding #23743

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Oct 10, 2024

Previously the same interface (QueryData) was both used to represent
data on the wire (QueryResults.data field) and access result rows
on the StatementClient via currentData(). This was wrong as the on the wire
representation for spooled protocol does not carry actual result rows
but merely represent the location of the data. This was confusing
as the QueryData getData implementation was throwing an exception
in that case. After this change, QueryData was split into two interfaces:
one representing data on the wire (QueryData) and the other one representing
actual result rows (QueryResultRows). There is now a single place responsible
for decoding QueryData representations to actual result rows.

Description

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Oct 10, 2024
@wendigo wendigo requested a review from losipiuk October 10, 2024 20:11
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Oct 10, 2024
@wendigo wendigo force-pushed the serafin/null-raw-query branch from 33163b2 to 89e0e04 Compare October 10, 2024 20:39
@wendigo wendigo marked this pull request as ready for review October 10, 2024 20:39
Copy link
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@wendigo wendigo force-pushed the serafin/null-raw-query branch from 89e0e04 to 5dc7670 Compare October 10, 2024 21:25
Previously the same interface (QueryData) was both used to represent
data on the wire (QueryResults.data field) and access result rows
on the StatementClient via currentData(). This was wrong as the on the wire
representation for spooled protocol does not carry actual result rows
but merely represent the location of the data. This was confusing
as the QueryData getData() implementation was throwing an exception
in that case. After this change, QueryData was split into two interfaces:
one representing data on the wire (QueryData) and the other one representing
actual result rows (ResultRows). There is now a single place responsible
for decoding QueryData representations to actual result rows (ResultRowsDecoder).
@wendigo wendigo force-pushed the serafin/null-raw-query branch from 5dc7670 to 4c57289 Compare October 11, 2024 04:05
@wendigo wendigo merged commit cb36fa3 into master Oct 11, 2024
104 checks passed
@wendigo wendigo deleted the serafin/null-raw-query branch October 11, 2024 06:16
@github-actions github-actions bot added this to the 462 milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

2 participants