Skip to content

Conversation

@timsaucer
Copy link
Member

This is a duplicate of #18623 but targeting branch51

See that PR for details.

@github-actions github-actions bot added the core Core DataFusion crate label Nov 11, 2025
@timsaucer
Copy link
Member Author

@dqkqd would you mind reviewing? (Same as the other PR but targeting our release branch)

@timsaucer timsaucer marked this pull request as draft November 11, 2025 14:13
@timsaucer timsaucer marked this pull request as ready for review November 11, 2025 15:29
@timsaucer timsaucer changed the title bugfix: select_columns and drop_columns should validate column names - branch51 bugfix: select_columns should validate column names - branch51 Nov 11, 2025
@timsaucer timsaucer changed the title bugfix: select_columns should validate column names - branch51 [branch-51] bugfix: select_columns should validate column names Nov 11, 2025
if fields.is_empty() {
Err(unqualified_field_not_found(name, self.plan.schema()))
} else {
Ok(fields)
Copy link
Contributor

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 🤔

Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @timsaucer

I also verified this PR contains the same code as

@alamb alamb merged commit 187c6b2 into apache:branch-51 Nov 12, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants