VALUES list rejects mixing an extension-typed value with its bare storage type ("Inconsistent metadata across values list")

Offen
#26,917 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Atharva884 arbeitet bereits daran.

Seit 01.11.2026.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust, sql
Bereich
databases

Rechercherichtung

Start in LogicalPlanBuilder at the inconsistent-metadata check for VALUES, and read how the values list compares Arrow FieldMetadata; cast_extension_type_metadata.slt shows the test-only UUID type and reproduces the two-row case. Compare that path with how INSERT INTO plans VALUES against a target schema. Done means a decided unification rule is implemented and covered by a sqllogictest for the UUID example.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

A standalone VALUES list fails to plan when one row carries extension-type metadata and another row is the bare storage type, even though the storage types match:

Error during planning: Inconsistent metadata across values list at row 1 column 0. Was FieldMetadata { inner: {"ARROW:extension:name": "arrow.uuid"} } but found FieldMetadata { inner: {} }

The same values are accepted by INSERT INTO <uuid table> VALUES (...), which plans VALUES against the target schema.

Found while reviewing https://github.com/apache/datafusion/pull/21714. The check lives in LogicalPlanBuilder on main and reproduces there with the test-only UUID type planner in cast_extension_type_metadata.slt, so it predates that PR.

To Reproduce

On #21714 (or in cast_extension_type_metadata.slt on main):

VALUES (CAST(X'00010203040506070809000102030506' AS UUID)), (X'00010203040506070809000102030507');
-- Error during planning: Inconsistent metadata across values list at row 1 column 0 ...
Expected behavior

This is arguably a usability gap rather than a correctness bug: an explicit error is better than silently picking a type. But other systems unify these:

  • Postgres: VALUES ('...'::uuid), ('...') → column typed uuid.
  • DuckDB: same, column typed UUID.

Possible behavior: when the storage types match and the only difference is that some rows have no metadata, use the extension type (as a cast), instead of erroring.

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.