-
Notifications
You must be signed in to change notification settings - Fork 130
feat: teach merge to optionally error on duplicates #4971
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
Error on duplicates is better for new users who accidentally collide names. Signed-off-by: Daniel King <dan@spiraldb.com>
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| #[default] | ||
| RightMost, | ||
| /// If two structs share a field name, error. | ||
| Error, |
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.
default please.
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.
Done.
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
robert3005
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.
left one small comment
vortex-expr/src/exprs/merge.rs
Outdated
| if !dtype.is_struct() { | ||
| for expr in expr.values.iter() { | ||
| let dtype = expr.return_dtype(scope)?; | ||
| let Some(fields) = dtype.as_struct_fields_opt().cloned() else { |
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 likely don't need the clone 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.
Good eye. Done.
Error on duplicates is better for new users who accidentally collide names.