Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(query): support ASOF JOIN USING#19862

Merged
KKould merged 1 commit into
databendlabs:mainfrom
KKould:feat/asof-join-using
May 19, 2026
Merged

feat(query): support ASOF JOIN USING#19862
KKould merged 1 commit into
databendlabs:mainfrom
KKould:feat/asof-join-using

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented May 14, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Support ASOF JOIN ... USING (...) in the query binder
  • Treat the final USING column as the ASOF range key and preceding columns as equality keys
  • Keep duplicate USING columns hidden from unqualified wildcard output, including right ASOF joins

Related to #15423

Changes

This enables SQL like:

SELECT *
FROM trades t
ASOF JOIN prices p
USING (symbol, wh);

The binder rewrites the final USING column into the default ASOF range predicate (left >= right) while preserving the existing USING equality behavior for earlier keys.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Pair with the reviewer to explain why

Commands run:

cargo fmt --check
git diff --check
cargo test -p databend-common-sql --lib bind_asof_join
target/debug/databend-sqllogictests --run 'tests/sqllogictests/suites/duckdb/join/asof/test_asof_join_eq_hash_fast_path.test'

Type of change

  • New feature (non-breaking change which adds functionality)

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label May 14, 2026
@KKould KKould self-assigned this May 14, 2026
@KKould KKould requested a review from sundy-li May 14, 2026 10:59
@KKould
Copy link
Copy Markdown
Member Author

KKould commented May 14, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@KKould KKould added this pull request to the merge queue May 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 16, 2026
@KKould KKould added this pull request to the merge queue May 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 18, 2026
@KKould KKould force-pushed the feat/asof-join-using branch from 059c4ff to 80cdd45 Compare May 19, 2026 04:44
@KKould KKould added this pull request to the merge queue May 19, 2026
Merged via the queue into databendlabs:main with commit 5b6bed2 May 19, 2026
173 of 180 checks passed
@KKould KKould deleted the feat/asof-join-using branch May 19, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants