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

feat: make optimization a repeated field #653

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proto/substrait/extensions/extensions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ message SimpleExtensionDeclaration {
message AdvancedExtension {
// An optimization is helpful information that don't influence semantics. May
// be ignored by a consumer.
google.protobuf.Any optimization = 1;
repeated google.protobuf.Any optimization = 1;
Copy link
Member Author

Choose a reason for hiding this comment

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

meta: I would have liked to pluralize this (i.e. optimizations) this, but that is a breaking change due to json encoding.


// An enhancement alter semantics. Cannot be ignored by a consumer.
google.protobuf.Any enhancement = 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

The discussion in #649 indicated that optimization should be made repeated, but called out that enhancement should not be repeated. Is there a specific reason why we wouldn't want that?

@westonpace @jacques-n

Copy link
Member

Choose a reason for hiding this comment

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

Yes. An enhancement feels more like an "is a" relationship and less like a "has a" relationship. In other words, an enhancement is likely to change the semantic intent of the relation in some way. Combining two enhancements is unlikely to be successful.

For example, let's assume that we had a hash join relation enhancement that applies a pre-filter (I know that such a property already exists but we'll assume it was forgotten). At the same time let's assume we have some strange enhancement that specifies which collation to use for the equality comparison. This enhancements would not be compatible (the pre-filter likely would perhaps not be expecting the collation to be used).

Copy link
Member

Choose a reason for hiding this comment

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

That being said, I don't think it was ruled out. Partly we just don't really have any idea what valid use cases for enhancement look like yet. Until someone is using it though it probably doesn't have to be decided one way or the other.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense to me. We can limit this to optimization for now.

Expand Down
Loading