Null-aware hash join loses `NOT IN` semantics when converted to `SymmetricHashJoinExec`

オープン
#27,225 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #27226 @shehabgamin による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust
領域
databases

調査の方向性

Start by reading JoinSelection and SymmetricHashJoinExec in DataFusion’s Rust source, then trace the null_aware handling for HashJoinExec. Add or use a regression test that builds the null-aware LeftAnti join described in the issue and runs JoinSelection. Done means optimization keeps it as HashJoinExec; an open linked pull request already addresses this issue.

索引モデルが issue の本文から書いたものです。

説明

bug
Describe the bug

JoinSelection turns a HashJoinExec into a SymmetricHashJoinExec when both inputs are unbounded. It does this without checking null_aware. SymmetricHashJoinExec has no null-aware mode, so the flag is dropped and a NOT IN join becomes a plain anti join. A NULL in the subquery, or a NULL outer value, no longer gives SQL NOT IN semantics, so the query can return rows it should not.

To Reproduce

Build a null-aware LeftAnti HashJoinExec over two unbounded inputs and run JoinSelection on it. The result is a SymmetricHashJoinExec, and the null-aware behavior is gone.

let join = HashJoinExec::try_new(
    left, right, on, None, &JoinType::LeftAnti, None,
    PartitionMode::CollectLeft, NullEquality::NullEqualsNothing,
    true, // null_aware
)?;
let optimized = JoinSelection::new().optimize(Arc::new(join), &ConfigOptions::new())?;
// optimized is a SymmetricHashJoinExec
Expected behavior

A null-aware join stays a HashJoinExec, the only join that implements null-aware semantics for this case.

Additional context

No response

Willingness to contribute

I plan to contribute a fix for this bug independently

主要言語
Rust
スター
9.6k
フォーク
2.6k
平均マージ
3日 4時間
マージ済み PR(30日)
345

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion のほかの issue

apache/datafusion の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。