Skip to content

ShowCreateTable Logical Command

ShowCreateTable is a UnaryCommand that represents SHOW CREATE TABLE SQL statement in a logical query plan.

ShowCreateTable is planned as ShowCreateTableExec physical command at execution.

Creating Instance

ShowCreateTable takes the following to be created:

ShowCreateTable is created when:

Logical Analysis

The child (that is initially a UnresolvedTableOrView) of ShowCreateTable is resolved using ResolveSessionCatalog logical analysis rule.

Child ShowCreateTableCommandBase Note
ResolvedV1TableOrViewIdentifier ShowCreateTableAsSerdeCommand Only when asSerde is used (true)
ResolvedViewIdentifier ShowCreateTableCommand
ResolvedV1TableIdentifier ShowCreateTableCommand Only with spark.sql.legacy.useV1Command enabled
ResolvedTable ShowCreateTableCommand Only for spark_catalog session catalog and hive tables

Execution Planning

ShowCreateTable (over a ResolvedTable) is planned as ShowCreateTableExec physical command using DataSourceV2Strategy execution planning strategy.