array_concat of a 2D and a 1D list returns `[NULL]` or `NULL` for an all-NULL row depending on the other rows in the batch

Offen
#27,223 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@raghavyadav01 arbeitet bereits daran.

Seit 11.11.2026.

  • #27338 von @raghavyadav01 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust, sql
Bereich
backend, databases

Rechercherichtung

Start by reproducing the batch-size-dependent result with the SQL queries in the issue, then inspect the array_concat implementation and array_concat.slt around line 388. Check how the all-NULL row is handled when combined with a non-NULL row versus evaluated alone. Done means that row returns NULL consistently, with the regression covered by the SQL logic test.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

For a row where both arguments are NULL, array_concat(<2D list>, <1D list>) returns [NULL] when the batch also has a non-NULL row, and NULL when that row is evaluated on its own. The same row should give the same result regardless of batch contents. array_concat of two 1D lists returns NULL in both cases.

To Reproduce
CREATE TABLE t AS VALUES
  (make_array(1, 2), make_array(make_array(30, 40))),
  (CAST(NULL AS INT[]), CAST(NULL AS INT[][]));

SELECT array_concat(column2, column1) FROM t;
-- [[30, 40], [1, 2]]
-- [NULL]

SELECT array_concat(column2, column1) FROM t WHERE column1 IS NULL;
-- NULL

SELECT array_concat(column1, column1) FROM t;
-- [1, 2, 1, 2]
-- NULL

On main (5191bcc46). It also shows up in array_concat.slt:388 when the suite runs at batch size 1–3 (found while sweeping batch sizes for #26700).

Expected behavior

The all-NULL row returns NULL in both queries, like the 1D case.

Vorherrschende Sprache
Rust
Sterne
9.6k
Forks
2.6k
Ø Merge
3 T. 4 Std.
Gemergte PRs (30 T.)
345

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/datafusion

Alle Issues in apache/datafusion

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.