apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.33k stars 1.2k forks source link

Produce informative error on physical schema mismatch #13434

Closed findepi closed 5 days ago

findepi commented 1 week ago

Which issue does this PR close?

For https://github.com/apache/datafusion/issues/12733

Rationale for this change

Better error message to help downstream projects and make it easier to provide reproducers

Example error message

Datafusion error: Internal error: Physical input schema should be the same as the one converted from logical input schema. Differences:
    - field nullability at index 3 [return_rank]: (physical) false vs (logical) true
    - field nullability at index 4 [currency_rank]: (physical) false vs (logical) true.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

What changes are included in this PR?

Enhanced error message when physical schema and schema-from-logical (aka logical schema) do not match as expected

Are these changes tested?

No

Are there any user-facing changes?

Yes

alamb commented 5 days ago

🥇