Skip to content

CreateTable Logical Operator

CreateTable is a logical operator that represents (is <> for) the following:

CreateTable requires that the table provider of the CatalogTable is defined or throws an AssertionError:

assertion failed: The table to be created must have a provider.

The optional <> is defined when used for the following:

[[resolved]] CreateTable can never be resolved and is replaced (resolved) with a logical command at analysis phase in the following rules:

  • (for non-hive data source tables) DataSourceAnalysis posthoc logical resolution rule to a <> or a <> logical command (when the <> was defined or not, respectively)

  • (for hive tables) hive/[HiveAnalysis] post-hoc logical resolution rule to a CreateTableCommand or a CreateHiveTableAsSelectCommand logical command (when <> was defined or not, respectively)

=== [[creating-instance]] Creating CreateTable Instance

CreateTable takes the following to be created:

When created, CreateTable makes sure that the optional <> is undefined only when the <> is ErrorIfExists or Ignore. CreateTable throws an AssertionError otherwise:

assertion failed: create table without data insertion can only use ErrorIfExists or Ignore as SaveMode.