mkleen opened a new pull request, #23605:
URL: https://github.com/apache/datafusion/pull/23605
## Which issue does this PR close?
Relates to #23461 but resolves it only for cross-joins. The same problem
exisists for Hash/NL joins. There will be follow-ups.
## Rationale for this change
When a `cross-join` swaps it's sides, the metadata is rebuilded with based
on the inverted inputs. This can cause a change of metadata when the metadata
has conflicting values e.g.:
```rust
// left: 1000 rows, schema metadata {"key": "left"}
// right: 2 rows, schema metadata {"key": "right"}
ctx.sql("select * from left cross join right").await?.collect().await?;
// -> Internal error: ... 'join_selection' failed. Schema mismatch.
// Metadata should be {"key" : "right" } but changed to {"key" : "left" }
```
The cross-join should preserve it's original metdata when it's swapped.
## What changes are included in this PR?
- This pr avoids recalculating the metadata based on the swapped inputs and
uses the original metadata instead
- Test
## Are these changes tested?
Yes
## Are there any user-facing changes?
No
--
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]