Skip to content

V2SessionCatalog

V2SessionCatalog is the default session catalog of CatalogManager.

V2SessionCatalog is a TableCatalog and a SupportsNamespaces.

Creating Instance

V2SessionCatalog takes the following to be created:

V2SessionCatalog is created when BaseSessionStateBuilder is requested for one.

Default Namespace

defaultNamespace: Array[String]

The default namespace of V2SessionCatalog is default.

defaultNamespace is part of the CatalogPlugin abstraction.

Name

Signature
name: String

name is part of the CatalogPlugin abstraction.

The name of V2SessionCatalog is spark_catalog.

Loading Table

Signature
loadTable(
  ident: Identifier): Table

loadTable is part of the TableCatalog abstraction.

loadTable creates a V1Table for a table metadata (from the SessionCatalog).

Loading Function

Signature
loadFunction(
  ident: Identifier): UnboundFunction

loadFunction is part of the FunctionCatalog abstraction.

loadFunction...FIXME

Creating Table

Signature
createTable(
  ident: Identifier,
  columns: Array[Column],
  partitions: Array[Transform],
  properties: Map[String, String]): Table
createTable(
  ident: Identifier,
  schema: StructType,
  partitions: Array[Transform],
  properties: util.Map[String, String]): Table // (1)!
  1. Deprecated

createTable is part of the FunctionCatalog abstraction.

createTable creates a CatalogTable and requests the SessionCatalog to createTable (with ignoreIfExists flag disabled so when the table already exists a TableAlreadyExistsException is reported).

In the end, createTable loads the table.