-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[branch-51] bugfix: select_columns should validate column names #18624
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
[branch-51] bugfix: select_columns should validate column names #18624
Conversation
|
@dqkqd would you mind reviewing? (Same as the other PR but targeting our release branch) |
… which would error on duplicates
| if fields.is_empty() { | ||
| Err(unqualified_field_not_found(name, self.plan.schema())) | ||
| } else { | ||
| Ok(fields) |
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.
do we also have to check that we found all the fields?
Like what if some fields are found and some are not 🤔
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 do think this check will ensure we have all the fields. In fact, the unit test I added has 1 field that does exist and 2 that do not.
The if a single one of the requested columns returns no fields, then the entire operation should fail. Is there a different case you're thinking of?
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.
Nope -- this looks good to me
alamb
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 is a duplicate of #18623 but targeting branch51
See that PR for details.