Skip to content

fix(datafusion): resolve temporary objects first in SHOW CREATE TABLE - #1126

Merged
JingsongLi merged 1 commit into
apache:mainfrom
plusplusjiajia:fix/show-create-temp-objects
Oct 15, 2026
Merged

JingsongLi merged 1 commit into
apache:mainfrom
plusplusjiajia:fix/show-create-temp-objects

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Purpose

A temporary table or view shadows a catalog table in queries, but SHOW CREATE TABLE in SQLContext still returned the shadowed Paimon table's DDL:

CREATE TEMPORARY VIEW paimon.db.t AS SELECT 1 AS id;
SELECT * FROM paimon.db.t;          -- reads the temporary view
SHOW CREATE TABLE paimon.db.t;      -- returned the Paimon table's DDL

Temporary objects without a catalog table were described by DataFusion through information_schema.views, which loads every table in the catalog, so an unrelated table that fails to load broke the statement.

Flink's SHOW CREATE TABLE likewise resolves temporary tables before permanent ones.

Brief change log

  • Look up the temporary object first, with names normalized as in queries, and return its definition directly (NULL when it has none).
  • Paimon tables without a temporary object keep the generated DDL.
  • information_schema keeps resolving to DataFusion's metadata tables, as in queries.

Tests

  • A temporary view or table shadowing a Paimon table returns its own definition or NULL.
  • Temporary object names resolve like queries: unquoted names are normalized, quoted names are kept.
  • A temporary object is described without loading an unrelated broken table.
  • A temporary view named under information_schema does not change what SHOW CREATE TABLE describes.

A temporary table or view shadows a catalog table in queries, but SHOW
CREATE TABLE still returned the shadowed Paimon table's DDL. Temporary
objects were also described through information_schema.views, which
loads every table in the catalog, so an unrelated failing table broke
the statement.

Look up the temporary object first, with names normalized as in
queries, and return its definition directly (NULL when it has none).
information_schema keeps resolving to DataFusion's metadata tables.
@plusplusjiajia
plusplusjiajia force-pushed the fix/show-create-temp-objects branch from 0202e56 to 8983b96 Compare October 14, 2026 04:19
@plusplusjiajia
plusplusjiajia marked this pull request as ready for review October 14, 2026 06:13
@JingsongLi
JingsongLi merged commit 75dc722 into apache:main Oct 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants