Xuanwo opened a new pull request, #24799:
URL: https://github.com/apache/datafusion/pull/24799
## Which issue does this PR close?
- Part of #318.
- Umbrella PR: #23738.
- Depends on #23829.
## Rationale for this change
An ASOF join emits exactly one output row for every left row. Unlike a
general
left join, it cannot duplicate left rows, so functional dependencies from the
left input keep their original dependency mode. Dependencies from the right
input are not preserved because one right row may match multiple left rows.
Keeping this metadata lets downstream optimizer rules continue to use
left-side
uniqueness after an ASOF join.
## What changes are included in this PR?
- Preserve the left input's functional dependencies when building the ASOF
output schema.
- Document the one-output-row-per-left-row assumption at the ownership
boundary.
- Add a focused test that preserves a left `Single` dependency and rejects
propagation of the corresponding right dependency.
## Are these changes tested?
- `cargo fmt --all`
- `cargo clippy --all-targets --all-features -- -D warnings`
- `cargo test -p datafusion-expr
asof_join_schema_preserves_only_left_dependencies --all-features`
- The extended workspace test command from the contributor guide
## Are there any user-facing changes?
No result semantics or public APIs change. This only improves optimizer
metadata
for logical ASOF joins.
--
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]