Skip to content

CreateDataSourceTableCommand Logical Command

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

CreateDataSourceTableCommand is created when DataSourceAnalysis posthoc logical resolution rule resolves a[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[access SessionState] that in turn is used to[access the current SessionCatalog].

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


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