Skip to content

ResolveSessionCatalog Logical Resolution Rule

ResolveSessionCatalog is a logical resolution rule (Rule[LogicalPlan]).

Creating Instance

ResolveSessionCatalog takes the following to be created:

  • CatalogManager
  • SQLConf
  • isTempView Function (Seq[String] => Boolean)
  • isTempFunction Function (String => Boolean)

ResolveSessionCatalog is created as an extended resolution rule when HiveSessionStateBuilder and BaseSessionStateBuilder are requested for the analyzer.

Executing Rule

Rule
apply(
  plan: LogicalPlan): LogicalPlan

apply is part of the Rule abstraction.

apply resolves the following logical operators:

constructV1TableCmd

constructV1TableCmd(
  query: Option[LogicalPlan],
  tableSpec: TableSpecBase,
  ident: TableIdentifier,
  tableSchema: StructType,
  partitioning: Seq[Transform],
  ignoreIfExists: Boolean,
  storageFormat: CatalogStorageFormat,
  provider: String): CreateTable

constructV1TableCmd buildCatalogTable and creates a new CreateTable logical operator.

isV2Provider

isV2Provider(
  provider: String): Boolean

isV2Provider looks up the DataSourceV2 implementation (the TableProvider) for the given provider.

provider

The provider name can be an alias (a short name) or a fully-qualified class name.

isV2Provider is true for all the connectors but FileDataSourceV2. Otherwise, isV2Provider is false.