Hive Metastore
| Also known as | HMS, Hive metastore service |
|---|---|
| Field | Data management, table catalogs |
| Key parts | Thrift API service, relational database for metadata, warehouse directory, optional Iceberg REST catalog endpoint |
| Open source implementations | Apache Hive (standalone metastore); clients in Apache Spark, Trino and Apache Iceberg |
| Related | Data catalog, Iceberg REST catalog, Apache Polaris, Unity Catalog |
The Hive Metastore (HMS) is the metadata service of Apache Hive: it stores the names, schemas, partitions and storage locations of tables in a relational database and serves them to engines through a Thrift API.[2] Engines other than Hive, such as Apache Spark, Impala and Trino, use the same service, which made it the shared table catalog of the Hadoop-era data lake. In an open lakehouse the Hive Metastore is one of several data catalog options, next to catalogs that implement the Iceberg REST catalog API.
What the Hive Metastore stores
The Hive Metastore keeps metadata, not data. For each table it records the database (namespace), columns and types, partition values, the storage location of each partition and the file format and SerDe used to read it. The Hive project describes it as the central store of metadata for tables and partitions, reached through the metastore service API by clients that include Hive, Impala and Spark.[2]
The metadata lives in a relational database accessed through JDO. In Hive 4.2.1 the default connection URL is an embedded Apache Derby database (jdbc:derby:;databaseName=metastore_db;create=true), which suits tests; production deployments point it at a server database. The default warehouse directory for managed tables is /user/hive/warehouse, and the Thrift service listens on port 9083 by default.[3]
How engines use it
Each engine connects to the Hive Metastore with its own client and its own idea of what a table is.
- Apache Spark uses the Hive Metastore as its persistent catalog when Hive support is enabled. Spark 4.3.0 bundles a Hive 2.3.10 client and can talk to metastores of versions 2.0.0 to 2.3.10, 3.0.0 to 3.1.3 and 4.0.0 to 4.1.0, set with
spark.sql.hive.metastore.versionandspark.sql.hive.metastore.jars.[4][5] - Trino uses a Thrift metastore (
hive.metastore=thrift, the default) for its Hive, Delta Lake and Hudi connectors, configured withhive.metastore.uri, and offershive_metastoreas one Iceberg catalog type.[6] - Apache Iceberg ships a
HiveCatalog(catalog typehive). It stores a pointer to the table's current metadata file in the metastore and uses the metastore to make commits atomic.[7]
Hive Metastore and the Iceberg REST catalog
The Hive Metastore and REST catalogs are often presented as old and new, but since Hive 4.1.0 the metastore can be both. HIVE-28059 added an Iceberg REST catalog to the metastore in 4.1.0, and HIVE-28658 added a REST catalog client in 4.2.0.[8][9] In Hive 4.2.1 the endpoint is a servlet that is off by default (metastore.catalog.servlet.port is -1), serves the path iceberg, and uses JWT authentication unless metastore.catalog.servlet.auth selects none, simple or OAuth 2.[3]
| Hive Metastore (Thrift API) | Iceberg REST catalog | |
|---|---|---|
| Protocol | Thrift RPC, port 9083 by default[3] | HTTP and JSON, defined by an OpenAPI specification[10] |
| Table formats | Hive tables in any supported file format; Iceberg tables through a metadata pointer | Iceberg tables and views |
| Commit model | Coordinated by each client; Iceberg's HiveCatalog, for example, takes a metastore lock around each commit[11]
|
The client sends updates with requirements; the server checks the requirements and applies the commit, or rejects it with a conflict[10] |
| Client coupling | Clients must match a supported metastore version (for example Spark's version list)[4] | Any client that speaks the REST specification |
| Example implementations | Hive standalone metastore | Apache Polaris, Unity Catalog, Project Nessie, the Hive Metastore REST endpoint[8] |
Standalone metastore
The metastore code was moved into its own standalone-metastore module during Hive 3.0 work, so that it can run without the rest of Hive.[12] At the rel/release-4.2.1 tag that module contains separate client, common, server, tools and REST catalog submodules.[13] Hive 4.1.0 was the first release to provide the metastore as a standalone component in binary and Docker image form (HIVE-29062).[1][14]
Status
The Hive Metastore is not deprecated in any Hive release, and Hive 4.2.1, released on 24 August 2026, fixed security issues in it.[1] What has ended is support for old release lines: the Hive community declared the 1.x line end of life in April 2024, the 2.x line in May 2024 and the 3.x line in October 2024.[1]
This matters for Spark users. The Hive client bundled with Spark 4.3.0 is version 2.3.10, from a line that is end of life; a Spark application that connects to a Hive 4 metastore must load matching client jars through spark.sql.hive.metastore.jars.[4]
Limitations
- Hive-shaped model. The metastore models tables as directories of files with partitions. Table formats such as Iceberg keep their real metadata in their own files and use the metastore only for a pointer.[7]
- Version coupling. Thrift clients must be compatible with the server version, which is why Spark lists the metastore versions it supports.[4]
- Governance. The metastore records metadata; authorization is left to other projects. The Hive project names Apache Ranger for authorization and Apache Atlas for lineage.[2]
See also
- Apache Hive
- Hive on Spark
- Data catalog
- Iceberg REST catalog
- Apache Polaris
- Unity Catalog
- Project Nessie
References
- ↑ 1.0 1.1 1.2 1.3 Downloads (Apache Hive news and releases). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 2.0 2.1 2.2 Apache Hive. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 3.0 3.1 3.2 MetastoreConf.java (rel/release-4.2.1). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 4.0 4.1 4.2 4.3 Hive Tables (docs/sql-data-sources-hive-tables.md at v4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ HiveUtils.scala (v4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Metastores (Trino 484). Trino Software Foundation.Retrieved 2026-11-22.
- ↑ 7.0 7.1 CatalogUtil.java (apache-iceberg-1.12.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 8.0 8.1 HIVE-28059: Iceberg REST Catalog. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ HIVE-28658: Iceberg REST Catalog client. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ 10.0 10.1 Iceberg REST Catalog API (rest-catalog-open-api.yaml at apache-iceberg-1.12.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ HiveTableOperations.java (apache-iceberg-1.12.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ HIVE-17733: Move RawStore to standalone metastore. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ standalone-metastore at rel/release-4.2.1. GitHub.Retrieved 2026-11-22.
- ↑ HIVE-29062: Add standalone module for packaging the Metastore. Apache Software Foundation JIRA.Retrieved 2026-11-22.