Skip to content

feat: add ASOF joins to DataFrame API - #23831

Open
Xuanwo wants to merge 7 commits into
apache:mainfrom
Xuanwo:xuanwo/asof-dataframe
Open

feat: add ASOF joins to DataFrame API#23831
Xuanwo wants to merge 7 commits into
apache:mainfrom
Xuanwo:xuanwo/asof-dataframe

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jul 23, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Rationale for this change

This is the DataFrame API layer of the ASOF JOIN stack. It exposes the logical contract already available on main through the fluent API without coupling DataFrame callers to SQL.

What changes are included in this PR?

  • Add DataFrame::join_asof with an optional equality expression and one ordered match expression.
  • Add DataFrame::join_asof_using for same-named equality keys.
  • Cover both entry points with a DataFrame execution test.

Are these changes tested?

Yes:

  • cargo fmt --all
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test -p datafusion --test core_integration dataframe::join_asof --all-features
  • The extended workspace test command from the contributor guide

Are there any user-facing changes?

Users can build ASOF joins through DataFrame::join_asof and DataFrame::join_asof_using. Both methods use the same expression validation and left-preserving semantics as the logical builder and SQL API.

@github-actions github-actions Bot added sql SQL Planner logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate proto Related to proto crate physical-plan Changes to the physical-plan crate auto detected api change Auto detected API change labels Jul 23, 2026
@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.80%. Comparing base (4048898) to head (4fe1746).

Files with missing lines Patch % Lines
datafusion/core/src/dataframe/mod.rs 86.66% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23831      +/-   ##
==========================================
- Coverage   81.80%   81.80%   -0.01%     
==========================================
  Files        1130     1130              
  Lines      417754   417784      +30     
  Branches   417754   417784      +30     
==========================================
+ Hits       341754   341778      +24     
  Misses      55875    55875              
- Partials    20125    20131       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Aug 14, 2026
@Xuanwo
Xuanwo force-pushed the xuanwo/asof-dataframe branch from 90448bd to 7713821 Compare August 20, 2026 17:56
@Xuanwo
Xuanwo force-pushed the xuanwo/asof-dataframe branch from 7713821 to 7ef360b Compare August 28, 2026 05:40
@github-actions github-actions Bot removed physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate labels Aug 28, 2026
@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Aug 30, 2026
# Conflicts:
#	datafusion/expr/src/logical_plan/builder.rs
#	datafusion/expr/src/logical_plan/plan.rs
#	datafusion/substrait/tests/cases/serialize.rs
@Xuanwo
Xuanwo marked this pull request as ready for review September 9, 2026 12:18
@Xuanwo

Xuanwo commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@2010YOUY01 & @jayzhan211, this PR is ready, let's go!

@github-actions github-actions Bot removed the auto detected api change Auto detected API change label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-plan Changes to the physical-plan crate proto Related to proto crate sql SQL Planner substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants