-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Improve explain by predictably ordering predicates #12332
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
Conversation
1f588e8 to
fcb5c96
Compare
42126ca to
b179925
Compare
presto-spi/pom.xml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jha-gunjan Hmm.... SPI cannot have a dependency on guava. I guess, that means that we can't use ImmutableMap in TuppleDomain. Let's find another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbasmanova @jha-gunjan Maria, Gunjan, this is already fixed in upstream -- https://github.com/prestosql/presto
🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make something similar to trinodb/trino#226 (or simply cherry pick that).
b179925 to
6666552
Compare
arhimondr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't just use the ImmutableSet and ImmutableMap from Guava? These classes preserve the order.
Additionally it would be nice to have a unit test.
presto-spi/src/main/java/com/facebook/presto/spi/predicate/TupleDomain.java
Show resolved
Hide resolved
012e7e2 to
0bd410b
Compare
Guava not imported in presto-spi. |
@jha-gunjan when you're cherry picking a commit, it would be nice to retain authorship information. |
Thanks - I prefer that too - however, due to diverging branches and potential conflicts/renames - I manually cherry-picked this time. Added authorship info manually. |
arhimondr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for doing this.
Few additional comments.
Also:
- Could you please recover the authorship? You can use
git commit --amend --author='Karol Sobczak <[email protected]>' - Could you please address (or at least reply) to this comments
If you decided to address these comments, feel free to address them in a separate commit with your own authorship.
presto-spi/src/main/java/com/facebook/presto/spi/predicate/EquatableValueSet.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/com/facebook/presto/spi/predicate/TupleDomain.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/com/facebook/presto/spi/predicate/TupleDomain.java
Outdated
Show resolved
Hide resolved
0bd410b to
c7e542a
Compare
Fixes prestodb#11444 Improve plan stability Uses Linked HashMap/HashSet to add ordering of keys.
c7e542a to
56c7ec0
Compare
Fixes #11444 . Cherry pick of TupleDomain.java from trinodb/trino#226
Query PlanPrinter uses TupleDomain, which was giving unpredictable
order of tuples due to the use of HashMap/HashSet.
Switched to LinkedHashMap/LinkedHashSet to get predictable ordering.