CreateTable Logical Operator¶
CreateTable
is a LogicalPlan.
Analysis Phase¶
CreateTable
can never be resolved and is replaced with (resolved to) a logical command at analysis phase in the following rules:
-
(for non-hive data source tables) DataSourceAnalysis posthoc logical resolution rule to a CreateDataSourceTableCommand or a CreateDataSourceTableAsSelectCommand logical command (based on the query defined or not, respectively)
-
(for hive tables) HiveAnalysis post-hoc logical resolution rule to a
CreateTableCommand
or a CreateHiveTableAsSelectCommand logical command (based on the query defined or not, respectively)
Creating Instance¶
CreateTable
takes the following to be created:
- CatalogTable
- SaveMode
- Optional Query (LogicalPlan)
While being created, CreateTable
asserts the following:
- The table to be created must have the provider
- With no query, the SaveMode must be either
ErrorIfExists
orIgnore
CreateTable
is created when:
- DataFrameWriter.saveAsTable operator is used (and creates a table)
- ResolveSessionCatalog logical resolution rule is executed (to constructV1TableCmd)
Never Resolved¶
resolved
is always false
.