mkleen opened a new pull request, #23952:
URL: https://github.com/apache/datafusion/pull/23952

   ## Which issue does this PR close?
   
   - Closes https://github.com/apache/datafusion/issues/23461
   
   ## Rationale for this change
   
   Based on the discussion in https://github.com/apache/datafusion/issues/23461 
we decided to just improves the error message, so the user knows there is a 
metadata conflict in the schema. It also reverts 
https://github.com/apache/datafusion/pull/23605, so `CrossJoinExec` has it's 
original behaviour. This changes a metadata conflict from a user perspective 
from:
   
   ```sql
   select * from larger_table cross join smaller_table;
   
    DataFusion error: Internal error: PhysicalOptimizer rule 'join_selection' 
failed. Schema mismatch. Expected original schema: Field { "a": Int32 }, Field 
{ "b": Int32 }, got new schema: Field { "a": Int32 }, Field { "b": Int32 }
   ```
   
   to:
   
   ```sql
   select * from larger_table cross join smaller_table;
   
   DataFusion error: PhysicalOptimizer rule 'join_selection' failed. Schema 
mismatch caused by Internal error: Schema metadata mismatch: Expected original 
metadata: {"metadata_key": "right"}, got metadata: {"metadata_key": "left"}.
   ```
   
   
   ## What changes are included in this PR?
   
   - Improve error message for schema validation in physical_planner.rs
   - Data creation in test_context.rs
   - Reproduction in slt 
   - Revert behaviour of `CrossJoinExec` 
   
   ## Are these changes tested?
   
   Yes
   
   ## Are there any user-facing changes?
   
   Yes, error message improved when the metadata has a conflict. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to