Skip to content

feat(datafusion): support SHOW CREATE TABLE for external engines - #1131

Merged
JingsongLi merged 1 commit into
apache:mainfrom
plusplusjiajia:feat/engine-show-create-table
Oct 16, 2026
Merged

JingsongLi merged 1 commit into
apache:mainfrom
plusplusjiajia:feat/engine-show-create-table

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Purpose

Support SHOW CREATE TABLE on external data tables served by a registered table engine:

SHOW CREATE TABLE lake.db.events;

The definition comes from the engine's provider (TableProvider::get_table_definition) and is returned unchanged in the existing four columns.

Brief change log

  • SQLContext classifies the target with load_table. Paimon tables keep the generated DDL; external tables are resolved through the catalog provider, which applies the existing session option and query-auth checks.
  • Only the target table is resolved; the catalog is not enumerated through information_schema.views.
  • An unregistered engine, a missing table and engine errors are reported. A provider without a definition, or with a blank one, is reported as unsupported instead of returning Paimon DDL or an empty result.
  • Update the DataFusion README.

Tests

  • External tables return the engine DDL unchanged, including quoted table names and tables in other databases.
  • Missing engine, missing or blank definition, missing table and engine errors are reported.
  • A failing unrelated table does not affect the target table.
  • Session scan options and query-auth are checked before the engine is called.
  • A temporary object shadowing an external table is described without calling the engine; Paimon tables keep their DDL.

Return the definition reported by the engine provider for external data
tables, resolved through the catalog provider so session checks and
engine errors apply. Paimon tables keep the generated DDL.
@plusplusjiajia
plusplusjiajia force-pushed the feat/engine-show-create-table branch from 58773ac to 8f43fce Compare October 15, 2026 09:11
@plusplusjiajia
plusplusjiajia marked this pull request as ready for review October 15, 2026 09:22
@JingsongLi
JingsongLi merged commit c3c3423 into apache:main Oct 16, 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