Skip to content

ShowCreateTableExec Physical Command

ShowCreateTableExec is a V2CommandExec physical command that represents ShowCreateTable logical operator at execution.

ShowCreateTableExec is a LeafExecNode.

Creating Instance

ShowCreateTableExec takes the following to be created:

ShowCreateTableExec is created when:

Executing Command

Signature
run(): Seq[InternalRow]

run is part of the V2CommandExec abstraction.


run showCreateTable.

showCreateTable

showCreateTable(
  table: Table,
  builder: StringBuilder): Unit

showCreateTable adds the following (to the given StringBuilder):

CREATE TABLE [tableName]

showCreateTable then does the following:

showTableDataColumns

showTableDataColumns(
  table: Table,
  builder: StringBuilder): Unit

showTableDataColumns requests the given Table for the columns that are converted to DDL format.

showTablePartitioning

showTablePartitioning(
  table: Table,
  builder: StringBuilder): Unit
Noop for a non-partitioned table

showTablePartitioning does nothing (noop) when the given table has no partitioning.

For a BucketTransform (among partitioning transforms), showTablePartitioning creates a BucketSpec to add the following (to the given StringBuilder):

CLUSTERED BY [bucketColumnNames]
SORTED BY [sortColumnNames]
INTO [numBuckets] BUCKETS
One BucketTransform Supported

In case there are more BucketTransforms, the last wins.

For all other Transforms, showTablePartitioning requests them to describe and adds the following (to the given StringBuilder):

PARTITIONED BY [transforms]