-
Notifications
You must be signed in to change notification settings - Fork 3k
API: Make the PartitionSpec less lazy #6220
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
API: Make the PartitionSpec less lazy #6220
Conversation
326b6c0 to
c8b16a8
Compare
| Transform<?, T> transform, String partitionName, BoundPredicate<?> pred) { | ||
| if (pred.term() instanceof BoundTransform | ||
| && transform.equals(((BoundTransform<?, ?>) pred.term()).transform())) { | ||
| && transform |
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.
I had to change this to make testProjectionNames pass. In the case of hour transform, we'll be comparing transforms which is an instance of Timestamps with Hours. The toString() both produce hour.
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.
We should be able to roll this back once we deprecate the old apply method in favor of the bind approach. Then we don't need to keep two classes around for those.
881315d to
6381d9d
Compare
6381d9d to
69b5a59
Compare
…rd-compatibility-of-partition-spec-transform
| Pair<Transform<?, ?>, Integer> sourceAndTransform = | ||
| Pair.of(sortField.transform(), sortField.sourceId()); | ||
| Pair<String, Integer> sourceAndTransform = | ||
| Pair.of(sortField.transform().dedupName(), sortField.sourceId()); |
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.
I think this needs to be toString rather than dedupName. The dedupName method should not really be public and shouldn't be used for cases like this. We want the actual transform here.
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.
Got it, I've updated the PR! 👍🏻
180c142 to
f567fa0
Compare
|
Thanks, @Fokko! Good find. |

Debugging some regression that we have at Trino, this PR seems to fix a part of it.
It looks like we've deprecated this a bit too fast. Instead, when we read the PartitionSpec from the manifest, we should bind them to maintain compatibility with 1.0.0.