Skip to content

CreateDataSourceTableCommand Logical Command

CreateDataSourceTableCommand is a RunnableCommand.md[logical command] that <> (in a SessionCatalog).

CreateDataSourceTableCommand is created when DataSourceAnalysis posthoc logical resolution rule resolves a CreateTable.md[CreateTable] logical operator for a non-Hive table provider with no query.

Creating Instance

CreateDataSourceTableCommand takes the following to be created:

  • [[table]] CatalogTable
  • [[ignoreIfExists]] ignoreIfExists Flag

=== [[run]] Executing Logical Command -- run Method

[source, scala]

run(sparkSession: SparkSession): Seq[Row]

NOTE: run is part of <> to execute (run) a logical command.

run requests a session-scoped SessionCatalog to create a table.

NOTE: run uses the input SparkSession to SparkSession.md#sessionState[access SessionState] that in turn is used to SessionState.md#catalog[access the current SessionCatalog].

Internally, run creates a BaseRelation to access the table's schema.

CAUTION: FIXME

NOTE: run accepts tables only (not views) with the provider defined.