CatalogHelper¶
CatalogHelper is a Scala implicit class that adds extensions methods to CatalogPlugin.
Tip
Learn more on implicit classes in the official documentation of Scala 2.
Creating Instance¶
CatalogHelper takes the following to be created:
asNamespaceCatalog¶
asNamespaceCatalog: SupportsNamespaces
asNamespaceCatalog returns the CatalogPlugin if it is a SupportsNamespaces or throws an AnalysisException otherwise:
Cannot use catalog [name]: does not support namespaces
asNamespaceCatalog is used when:
- ResolveCatalogs logical resolution rule is executed
- DataSourceV2Strategy execution planning strategy is executed
- DropNamespaceExec physical command is executed
asTableCatalog¶
asTableCatalog: TableCatalog
asTableCatalog returns the CatalogPlugin if it is a TableCatalog or throws an AnalysisException otherwise:
Cannot use catalog [name]: not a TableCatalog
asTableCatalog is used when:
ResolveTables, ResolveRelations, ResolveCatalogs and ResolveSessionCatalog logical resolution rules are executedCatalogV2Utilutility is used to load a table, createAlterTable and getTableProviderCatalogDataFrameWriteris requested to insertInto and saveAsTableDataFrameWriterV2is created- DataSourceV2Strategy execution planning strategy is executed
- DropNamespaceExec physical command is executed