Overaggressive pruning of nested fields(?) breaks some valid queries unless parquet pushdown is disabled

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

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

@ianthetechie がすでに取り組んでいます。

2026年11月9日 から。

  • #27259 @ianthetechie による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, sql
領域
backend, databases

調査の方向性

Start with the parquet reproducer in the issue and compare behavior with both pushdown settings enabled and disabled; the regression is reported between DataFusion 53.1.0 and 54.0.0. Trace nested field pruning and predicate pushdown to find why names.common is unavailable while evaluating the filter, then add a regression test for the original query. The issue links open pull request #27259, so check its status and discussion before taking this on.

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

説明

bug
Describe the bug

Valid queries against a parquet table with certain structural characteristics now fail with an execution error: Field common not found in struct.

As noted in the issue title, my guess is that this is due to overaggressive pruning of nested fields during pushdown, but that needs some further verification.

I have worked up a minimal reproducer (below) which you can replicate with the datafusion-cli.

To Reproduce
-- Set up: an external parquet table with a few rows.
-- Apologies for the somewhat oblique construction, but certain DataFusion versions
-- rejected a simpler version with map(['en'], [english]).
COPY (
    SELECT named_struct(
        'primary', local_name,
        'common', map([language], [english])
    ) AS names
    FROM (VALUES ('Local', 'en', 'English'), (NULL, 'en', 'Fallback'), ('', 'en', ''))
        AS input(local_name, language, english)
) TO '/tmp/datafusion-reproducer.parquet' STORED AS PARQUET;

CREATE EXTERNAL TABLE nested_names
STORED AS PARQUET
LOCATION '/tmp/datafusion-reproducer.parquet';

-- These are defaults for a while AFAIK but including for reproducibility.
SET datafusion.execution.parquet.pushdown_filters = true;
SET datafusion.optimizer.enable_leaf_expression_pushdown = true;

-- Expected:
-- +-----------------------------+
-- | nested_names.names[primary] |
-- +-----------------------------+
-- | Local                       |
-- | NULL                        |
-- +-----------------------------+
--
-- Actual:
-- Parquet error: External: External error: Error evaluating filter predicate
-- caused by
-- Execution error: Field common not found in struct
SELECT names.primary
FROM nested_names
WHERE coalesce(names.primary, names.common['en']) <> '';

SET datafusion.execution.parquet.pushdown_filters = false;
SET datafusion.optimizer.enable_leaf_expression_pushdown = false;

-- With BOTH of these settings disabled, it succeeds and returns Local and NULL.
-- It still fails if either one is true.
SELECT names.primary
FROM nested_names
WHERE coalesce(names.primary, names.common['en']) <> '';

-- Hacky SQL workaround: succeeds even with pushdown enabled.
SET datafusion.execution.parquet.pushdown_filters = true;
SET datafusion.optimizer.enable_leaf_expression_pushdown = true;

SELECT names.primary
FROM nested_names
WHERE coalesce(names.primary, map_extract(names.common, 'en')[1]) <> '';
Expected behavior

The original query should succeed as written with syntax like names.common['en'], without needing to disable predicate pushdown or SQL-level hacks.

Additional context

I haven't had a chance to do a full git bisect, but installing a few releases, I've narrowed it quite a bit. Release-wise, the bug first appeared in 54.0.0; 53.1.0 was fine, and it is still broken on main at the time of this writing.

Willingness to contribute

I would like to contribute a fix for this bug, but request guidance from the DataFusion community

主要言語
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 を短くまとめたダイジェスト。