Hive on Spark
| Also known as | Spark execution engine for Hive, hive.execution.engine=spark
|
|---|---|
| Field | SQL query execution |
| Introduced | Apache Hive 1.1.0 (2015) |
| Key parts | Hive compiler and metastore, Spark as the execution engine, the spark-client module
|
| Open source implementations | Apache Hive 1.1 to 3.1 |
| Related | Apache Hive, Hive Metastore, Apache Spark, Spark Thrift Server |
Hive on Spark was an execution engine option in Apache Hive that ran HiveQL queries as Apache Spark jobs instead of MapReduce or Apache Tez jobs; users turned it on with set hive.execution.engine=spark;.[2] It was a Hive project feature: Hive kept its own parser, optimizer and Hive Metastore, and used Spark only to run the work. It first shipped in Hive 1.1.0 and was removed in Hive 4.0, so it is unavailable in every maintained Hive release.[3][1]
Status
Hive on Spark was removed without a deprecation release in between.
- Removed from Hive's main branch in April 2022. HIVE-26134, "Remove Hive on Spark from the main branch", was resolved on 26 April 2022. Its description links a dev-list discussion and says there was no activity on keeping the feature up to date, and that removing it would help ongoing development and make testing cheaper.[1] In that thread, a reply from February 2022 says the last development was around October 2018 and calls the code dead weight.[4]
- First releases without it. The
spark-clientmodule and the Spark execution package (ql/.../exec/spark) are present at the Hive 4.0.0-alpha-1 tag, which was cut before the removal, and absent from 4.0.0-alpha-2 (released 16 November 2022) and 4.0.0 (released 29 March 2024).[5][6] In Hive 4.0.0,hive.execution.engineaccepts onlymrandtez; in Hive 3.1.3 it also acceptedspark.[7][8] - No maintained release has it. The Hive community declared the 2.x line end of life in May 2024 and the 3.x line end of life in October 2024, which leaves only the 4.x line, where the engine does not exist.[5]
An earlier ticket, HIVE-23885 "Remove Hive on Spark", was opened in July 2020 and closed as a duplicate.[9]
History
HIVE-7292, the umbrella ticket for Hive on Spark, was opened in June 2014. It gave three reasons: many Hive users already ran Spark and could drop MapReduce or Tez from their clusters; the option would bring Spark users to Hive; and queries with several reduce stages would run faster.[3] The feature shipped in Hive 1.1.0, released on 8 March 2015.[3][5]
Each Hive line was tested against one Spark version. The getting started page lists Spark 1.2.0 for Hive 1.1.x, Spark 2.0.0 for Hive 2.3.x and Spark 2.3.0 for Hive 3.0.x, and the Hive 3.1.3 build file still sets spark.version to 2.3.0.[2][10] No Hive release lists support for Spark 3 or later.
How it worked
Hive compiled a HiveQL query into a plan of map and reduce work, as it did for its other engines, and with the Spark engine submitted that plan to a Spark application through its spark-client module. The getting started page required a Spark build that does not include the Hive jars, and it recommends building Spark with the parquet-provided profile (and orc-provided for Spark 2.3.0 and later) to avoid dependency conflicts.[2]
-- Hive 3.1.x and earlier only; Hive 4 rejects this value
set hive.execution.engine=spark;
SELECT country, count(*) FROM page_views GROUP BY country;
What Hive on Spark is not
Several Spark and Hive combinations have similar names. Only the first row below is Hive on Spark.
| Name | Which project runs the SQL | Status |
|---|---|---|
Hive on Spark (hive.execution.engine=spark)
|
Hive parses and plans; Spark executes | Removed in Hive 4.0[1] |
| Shark | A Spark-based project that replaced Hive's execution engine with Spark | Development ended in July 2014 in favor of Spark SQL[11] |
Spark SQL with Hive support (enableHiveSupport())
|
Spark parses, plans and executes; Hive supplies the metastore and SerDes | Active in Spark 4.3.0[12] |
| Spark Thrift Server | Spark SQL, behind a JDBC/ODBC server that corresponds to HiveServer2 | Active in Spark 4.3.0[13] |
The 2014 post that ended Shark described Hive on Spark as a separate Hive community effort, aimed at organizations with existing Hive investments that wanted to run them on Spark, while Spark SQL became the main path for SQL on Spark.[11] In Spark 4.3.0, Hive support means reading and writing Hive tables through a Hive metastore; Spark 4.3.0 bundles a Hive 2.3.10 client and can connect to metastores from 2.0.0 to 4.1.0.[12]
Replacements
A Hive deployment that used the Spark engine has two paths. It can stay on Hive and move to Hive 4 with Tez, the engine that Hive 4.1 and later use by default (see Apache Hive). Or it can move the SQL to Spark itself: Spark SQL reads the same tables through the Hive Metastore, and the Spark Thrift Server gives JDBC and ODBC clients a HiveServer2-compatible endpoint.[12][13] Queries need checking on either path, because HiveQL behavior and Spark SQL behavior differ.
See also
References
- ↑ 1.0 1.1 1.2 1.3 HIVE-26134: Remove Hive on Spark from the main branch. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ 2.0 2.1 2.2 Hive on Spark: Getting Started. Apache Hive wiki.Retrieved 2026-11-22.
- ↑ 3.0 3.1 3.2 HIVE-7292: Hive on Spark. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ Time to Remove Hive-on-Spark. [email protected], 2022-02-10.Retrieved 2026-11-22.
- ↑ 5.0 5.1 5.2 Downloads. Apache Hive.Retrieved 2026-11-22.
- ↑ ql/src/java/org/apache/hadoop/hive/ql/exec at rel/release-4.0.0. GitHub.Retrieved 2026-11-22.
- ↑ HiveConf.java at rel/release-4.0.0. GitHub.Retrieved 2026-11-22.
- ↑ HiveConf.java at rel/release-3.1.3. GitHub.Retrieved 2026-11-22.
- ↑ HIVE-23885: Remove Hive on Spark. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ pom.xml at rel/release-3.1.3. GitHub.Retrieved 2026-11-22.
- ↑ 11.0 11.1 Shark, Spark SQL, Hive on Spark, and the future of SQL on Apache Spark. Databricks, 2014-07-01.Retrieved 2026-11-22.
- ↑ 12.0 12.1 12.2 Hive Tables (docs/sql-data-sources-hive-tables.md at v4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 13.0 13.1 Distributed SQL Engine (docs/sql-distributed-sql-engine.md at v4.3.0). Apache Software Foundation.Retrieved 2026-11-22.