Skip to content

refactor: shrink SchemaError #16653

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

Merged
merged 1 commit into from
Jul 4, 2025

Conversation

crepererum
Copy link
Contributor

@crepererum crepererum commented Jul 2, 2025

Which issue does this PR close?

Rationale for this change

What changes are included in this PR?

Box a field.

Are these changes tested?

Unit test.

Are there any user-facing changes?

Breaking: SchemaError::AmbiguousReference::column is now boxed.

@github-actions github-actions bot added logical-expr Logical plan and expressions common Related to common crate labels Jul 2, 2025

#[test]
fn test_error_size() {
assert_eq!(size_of::<SchemaError>(), 40);
Copy link
Contributor

Choose a reason for hiding this comment

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

<3

@Dandandan
Copy link
Contributor

Dandandan commented Jul 2, 2025

So you pay for that on the "happy path" as well

Is this also something we could see in benchmarks?

@crepererum
Copy link
Contributor Author

So you pay for that on the "happy path" as well

Is this also something we could see in benchmarks?

Potentially, but I guess that DataFusionError would be the actual contributor. Fixing that would require a bit more work though, that's why I started with one of the sub-types first.

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @crepererum for taking care of that, I suspect it is motivated by clippy complains https://rust-lang.github.io/rust-clippy/v0.0.212/#large_enum_variant

@alamb alamb added the api change Changes the API exposed to users of the crate label Jul 3, 2025
@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

I think technically this is an API change so it would nice to leave a note in the upgrade guide. I'll make a PR

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

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 @crepererum

@crepererum
Copy link
Contributor Author

Thanks @crepererum for taking care of that, I suspect it is motivated by clippy complains rust-lang.github.io/rust-clippy/v0.0.212#large_enum_variant

yes, that was the hint that triggered that investigation

@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from 7937ecf to 32d47d5 Compare July 4, 2025 10:35
@crepererum
Copy link
Contributor Author

Rebased after #16672.

@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from 32d47d5 to be0fdad Compare July 4, 2025 11:08
One step towards apache#16652.

Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@crepererum crepererum force-pushed the crepererum/shrink-schema-error branch from be0fdad to ef32eba Compare July 4, 2025 11:35
@crepererum crepererum merged commit a715173 into apache:main Jul 4, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate common Related to common crate logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants