Skip to content
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

Optimizer schema change assert error has incorrect error #9010

Closed
curtisleefulton opened this issue Jan 26, 2024 · 0 comments · Fixed by #9012
Closed

Optimizer schema change assert error has incorrect error #9010

curtisleefulton opened this issue Jan 26, 2024 · 0 comments · Fixed by #9012
Labels
bug Something isn't working

Comments

@curtisleefulton
Copy link
Contributor

curtisleefulton commented Jan 26, 2024

Describe the bug

In datafusion/optimizer/src/optimizer.rs:271 when calling assert_schema_is_the_same prev_plan / new_plan are backwards. This causes an incorrect / confusing assert error, indicating the optimized plan is actually the original plan.

To Reproduce

Any optimization error that produces a schema change will reproduce this bug.

In this particular case, the root cause of the schema change dropping timezone metadata for timestamps somewhere in the Optimizer rule simplify_expressions. Fixing this bug will help find the root cause.

Expected behavior

The assert_schema_is_the_same error should report prev_plan / new_plan in the correct order.

Additional context

No response

@curtisleefulton curtisleefulton added the bug Something isn't working label Jan 26, 2024
curtisleefulton added a commit to influxdata/arrow-datafusion-curtisleefulton that referenced this issue Jan 26, 2024
curtisleefulton added a commit to influxdata/arrow-datafusion-curtisleefulton that referenced this issue Jan 26, 2024
alamb pushed a commit that referenced this issue Jan 26, 2024
…#9012)

* fix: #9010 - Optimizer schema change assert error has incorrect error

* test: #9010 flip expected order of schema change errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant