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

Fix issue with querying Iceberg using a structural type predicate #8822

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

alexjo2144
Copy link
Member

Filter out Map, Array, and Row type domains from the IcebergTableHandle's unenforced constraint.

The change to strictly convert expressions to the Iceberg syntax in #8746 caused queries with predicates on structural types to fail.

@@ -985,6 +986,7 @@ public void rollback()
TupleDomain<IcebergColumnHandle> newUnenforcedConstraint = constraint.getSummary()
Copy link
Member

Choose a reason for hiding this comment

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

this causes the "remaining" filter to exclude the structural predicates, so the engine thinks that it was subsumed by the connector, and will remove from the filter node. so I think this will produce wrong results.

we should add a test which applies a conjunction of complex and primitive typed filters, where the former is more selective than the latter. (e.g. id and struct_t, but two rows with different struct_t share the same id)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. You're right, that test case exposed a problem. Instead I split out a separate remainingConstrant from unenforcedConstraint which has all non-partition domains.

@alexjo2144 alexjo2144 force-pushed the iceberg/complex-predicates branch from 2f506ae to 9e905fb Compare August 23, 2021 16:13
@alexjo2144 alexjo2144 requested a review from phd3 August 23, 2021 19:03
Copy link
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

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

Thanks @alexjo2144. This looks good to me. Could you squash the commits?

@findepi this doesn't fully address #8822 (comment), if you feel strongly about it, we can make that change here.

Filter out Map, Array, and Row type domains from the IcebergTableHandle's
unenforced constraint.
@alexjo2144 alexjo2144 force-pushed the iceberg/complex-predicates branch from 9e905fb to c106bc7 Compare August 30, 2021 15:23
@findepi
Copy link
Member

findepi commented Aug 30, 2021

@findepi this doesn't fully address #8822 (comment), if you feel strongly about it, we can make that change here.

i do not. @phd3 thanks for asking.

@alexjo2144
Copy link
Member Author

Squashed. Thanks for the reviews

@phd3
Copy link
Member

phd3 commented Aug 31, 2021

Encountered #9051. Seems unrelated.

@phd3 phd3 merged commit 6f1297f into trinodb:master Aug 31, 2021
@phd3
Copy link
Member

phd3 commented Aug 31, 2021

thanks @alexjo2144 ! Merged #8822 into master.

@phd3 phd3 added this to the 362 milestone Aug 31, 2021
@phd3 phd3 mentioned this pull request Sep 13, 2021
13 tasks
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.

3 participants