SetCatalogAndNamespaceExec Physical Command¶
SetCatalogAndNamespaceExec
is a physical command that represents SetCatalogAndNamespace logical command at execution time.
val ns = "my_space"
sql(s"CREATE NAMESPACE IF NOT EXISTS $ns")
sql(s"USE NAMESPACE $ns")
sql("SHOW CURRENT NAMESPACE").show(truncate = false)
// +-------------+---------+
// |catalog |namespace|
// +-------------+---------+
// |spark_catalog|my_space |
// +-------------+---------+
Creating Instance¶
SetCatalogAndNamespaceExec
takes the following to be created:
- CatalogManager
- Optional Catalog Name
- Optional Namespace
SetCatalogAndNamespaceExec
is created when DataSourceV2Strategy execution planning strategy is executed (and plans a SetCatalogAndNamespace logical command).