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

Aperta
#26,917 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Atharva884 ci sta già lavorando.

Dal 1/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, sql
Ambito
databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
9.6k
Fork
2.6k
Merge medio
3g 4h
PR unite (30g)
345

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/datafusion

Tutte le issue di apache/datafusion

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.