Skip to content

Abstain from passing UUID predicates to Iceberg library#12911

Merged
findepi merged 1 commit intotrinodb:masterfrom
findepi:findepi/abstain-from-passing-uuid-predicates-to-iceberg-library-3debf8
Jun 21, 2022
Merged

Abstain from passing UUID predicates to Iceberg library#12911
findepi merged 1 commit intotrinodb:masterfrom
findepi:findepi/abstain-from-passing-uuid-predicates-to-iceberg-library-3debf8

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Jun 20, 2022

Trino and Iceberg seem to order UUID values differently.

This is a stop-gap solution that fixes #12834.
We can revisit this later as needed.

@findepi findepi requested review from alexjo2144, ebyhr and homar June 20, 2022 14:54
@cla-bot cla-bot bot added the cla-signed label Jun 20, 2022
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Jun 20, 2022

This may be Trino's side problem #12834 (comment) / #12912

Trino and Iceberg seem to order UUID values differently.
@findepi findepi force-pushed the findepi/abstain-from-passing-uuid-predicates-to-iceberg-library-3debf8 branch from 6df9503 to 1e730f8 Compare June 20, 2022 20:46
if (isMetadataColumnId(columnHandle.getId()) || isStructuralType(columnHandle.getType())) {
if (isMetadataColumnId(columnHandle.getId()) || isStructuralType(columnHandle.getType()) ||
// Iceberg orders UUID values differently than Trino (perhaps due to https://bugs.openjdk.org/browse/JDK-7025832), so allow only IS NULL / IS NOT NULL checks
(columnHandle.getType() == UUID && !(domain.isOnlyNull() || domain.getValues().isAll()))) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does an equality predicate work? Feels like asking for a range of UUIDs would be unusual but asking for rows matching a specific UUID would be common

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Equality is consistent between Trino and Java's UUID, but even for equality predicate the ordering matters when you match the searched-for value with file min/max information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gotcha, makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Incorrect results when reading Iceberg table with a filter on UUID

4 participants