ATTACH with a non-existent DEFAULT_SCHEMA succeeds, then every scan fails with a misleading __internal_delta_ccv2_commit_staged internal error

Aperta
#111 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, sql
Ambito
databases

Direzione di ricerca

Inizia eseguendo la riproduzione SQL con ogni valore di DEFAULT_SCHEMA, quindi esamina gli entry point UCTableEntry::GetScanFunction e TableInformation::InternalAttach indicati nello stack trace. Traccia il modo in cui uno schema mancante raggiunge il delta scan path e fai in modo che il fallimento identifichi il DEFAULT_SCHEMA non valido invece di segnalare un errore interno fuorviante; verifica che i casi con schema esistente continuino a restituire le righe previste.

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

Descrizione

Summary

ATTACH ... (TYPE unity_catalog, DEFAULT_SCHEMA '<typo>') reports success even when the named schema does not exist in the catalog. Catalog metadata then works perfectly - schemas and tables are listed correctly - but the first query that actually reads data fails with:

INTERNAL Error: Parent catalog does not have a __internal_delta_ccv2_commit_staged function

The stack trace runs through the delta extension and names a catalog-commit (ccv2) function, so it reads as a protocol or version mismatch between delta and unity_catalog. It is neither: the only mistake is a typo in DEFAULT_SCHEMA, and nothing in the message, the trace, or the ATTACH result points there.

Environment

DuckDB v1.5.5, linux_amd64
unity_catalog fd85147 (stock, from extensions.duckdb.org)
delta 45c4087 (stock)
httpfs 827222f (stock)
Server Unity Catalog OSS v0.6.0

Reproduced independently on two unrelated Unity Catalog OSS v0.6.0 deployments, with the same DuckDB and extension versions on both.

Reproduction

LOAD httpfs; LOAD delta; LOAD unity_catalog;

CREATE OR REPLACE SECRET s (
    TYPE unity_catalog, TOKEN 'not-used',
    ENDPOINT 'http://localhost:8080', AWS_REGION 'us-east-1'
);

-- Succeeds. No warning, no error.
ATTACH 'unity' AS u (TYPE unity_catalog, SECRET s, DEFAULT_SCHEMA 'does_not_exist');

-- Catalog metadata is fully correct:
SELECT count(*) FROM duckdb_schemas() WHERE database_name = 'u';   -- 7
SELECT count(*) FROM duckdb_tables()  WHERE database_name = 'u';   -- 12

-- First actual read:
SELECT count(*) FROM u.dbt_dev.mart_daily_revenue;
INTERNAL Error: Parent catalog does not have a __internal_delta_ccv2_commit_staged function

Stack Trace:
delta.duckdb_extension(+0xdb370b)
delta.duckdb_extension(+0xdb37c4)
delta.duckdb_extension(+0xdb59e1)
delta.duckdb_extension(+0x29e9d7)
unity_catalog.duckdb_extension(+0x7ac22e)
unity_catalog.duckdb_extension(+0x7c811d)
unity_catalog.duckdb_extension(duckdb::TableInformation::InternalAttach(duckdb::ClientContext&))
unity_catalog.duckdb_extension(duckdb::UCTableEntry::GetScanFunction(...))

The determining factor

Same query (u.dbt_dev.mart_daily_revenue), only DEFAULT_SCHEMA changes:

DEFAULT_SCHEMA exists in catalog result
'default' yes ✅ 8
'dbt_dev' yes ✅ 8
'commerce' yes ✅ 8
'does_not_exist' no ❌ INTERNAL Error above

Note that the schema named in DEFAULT_SCHEMA does not have to be the schema of the table being queried - any existing schema works. It only has to resolve.

Best.

Lingua principale
Python
Stelle
111
Fork
50
Merge medio
1g 8h
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 duckdb/unity_catalog

Tutte le issue di duckdb/unity_catalog

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.