Skip to content

HiveSessionCatalog -- Hive-Specific Catalog of Relational Entities

:hive-version: 2.3.6 :hadoop-version: 2.10.0 :url-hive-javadoc:{hive-version}/api :url-hadoop-javadoc:{hadoop-version}/api

HiveSessionCatalog is a session-scoped catalog of relational entities that is used when SparkSession was created with ../[Hive support enabled].

.HiveSessionCatalog and HiveSessionStateBuilder image::../images/spark-sql-HiveSessionCatalog.png[align="center"]

HiveSessionCatalog is available as ../[catalog] property of SessionState when SparkSession was created with ../[Hive support enabled] (that in the end sets ../[spark.sql.catalogImplementation] internal configuration property to hive).

[source, scala]

import org.apache.spark.sql.internal.StaticSQLConf val catalogType = spark.conf.get(StaticSQLConf.CATALOG_IMPLEMENTATION.key) scala> println(catalogType) hive

// You could also use the property key by name scala> spark.conf.get("spark.sql.catalogImplementation") res1: String = hive

// Since Hive is enabled HiveSessionCatalog is the implementation scala> spark.sessionState.catalog res2: org.apache.spark.sql.catalyst.catalog.SessionCatalog = org.apache.spark.sql.hive.HiveSessionCatalog@1ae3d0a8

HiveSessionCatalog is <> exclusively when HiveSessionStateBuilder is requested for the[SessionCatalog].

HiveSessionCatalog uses the legacy <> (which is another session-scoped catalog of relational entities) exclusively to allow RelationConversions logical evaluation rule to <> when[executed].

=== [[creating-instance]] Creating HiveSessionCatalog Instance

HiveSessionCatalog takes the following to be created:

=== [[lookupFunction0]] lookupFunction0 Internal Method

[source, scala]

lookupFunction0( name: FunctionIdentifier, children: Seq[Expression]): Expression


NOTE: lookupFunction0 is used when...FIXME

Last update: 2020-09-07