-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(substrait): disallow union with a single input #13023
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
vbarua
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.
This matches what the Substrait spec requires. One thing we should mentioned is that this is technically a breaking change, as UNION or UNION ALL plans with only a single-input will stop working.
| "PrimaryAll Minus relation requires at least two inputs" | ||
| ) | ||
| Ok(set_op) => { | ||
| if set.inputs.len() >= 2 { |
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.
minor: Would it be cleaner to pull this out to the top like
if set.inputs.len() <= 1 {
substrait_err!("Set operation requires at least two inputs")
}so it's clearer what the invariant is (by having the check right next to the error) and avoid indenting the match block?
(I'm not sure if this is idiomatic Rust)
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.
Can't really judge if it's idiomatic or not with my whole 2 weeks of rust experience 😆 but makes sense. I'll flip it.
Marked it as API change |
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.
Which issue does this PR close?
Closes #12862
Are there any user-facing changes?
union with a single input no longer works (technically a breaking change)