package org.apache.spark.sql.hive.client
trait HiveClient {
// only required methods that have no implementation
// FIXME List of the methods
def alterPartitions(
db: String,
table: String,
newParts: Seq[CatalogTablePartition]): Unit
def getTableOption(dbName: String, tableName: String): Option[CatalogTable]
def getPartitions(
catalogTable: CatalogTable,
partialSpec: Option[TablePartitionSpec] = None): Seq[CatalogTablePartition]
def getPartitionsByFilter(
catalogTable: CatalogTable,
predicates: Seq[Expression]): Seq[CatalogTablePartition]
def getPartitionOption(
table: CatalogTable,
spec: TablePartitionSpec): Option[CatalogTablePartition]
def renamePartitions(
db: String,
table: String,
specs: Seq[TablePartitionSpec],
newSpecs: Seq[TablePartitionSpec]): Unit
}
HiveClient — Contract for Retrieving Metadata from Hive Metastore
HiveClient
is the contract for…FIXME
Note
|
HiveClientImpl is the only available HiveClient in Spark SQL.
|
HiveClient
offers safe variants of many methods that do not report exceptions when a relational entity is not found in a Hive metastore, e.g. getTableOption for getTable.
Method | Description |
---|---|
|
|
|
Returns the CatalogTablePartition of a table Used exclusively when |
|
|
|
|
|
Retrieves a table metadata from a Hive metastore Used when |
|
|
|
Retrieving Table Metadata From Hive Metastore — getTable
Method
getTable(
dbName: String,
tableName: String): CatalogTable
getTable
retrieves the table metadata from a Hive metastore if available or throws a NoSuchTableException
.
Note
|
|