Benchmarking Query Processing in Hive and Spark: A Framework forEfficiency-Complexity Trade-offs on Spatio-Temporal Big Data
This paper introduces a reproducible benchmarking framework and a novel Complexity Index to systematically evaluate and compare the efficiency–complexity trade-offs of Apache Hive and Spark on real-world spatio-temporal data, revealing that while Spark offers lower latency at higher resource costs, Hive is more frugal, with Partitioned Parquet emerging as the most balanced configuration for both engines.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Technical Summary: Benchmarking Query Processing in Hive and Spark
Problem Statement
While Apache Hive and Apache Spark are widely deployed SQL-on-Hadoop frameworks, their performance characteristics diverge significantly based on underlying data structures and optimization strategies. Existing benchmarking literature often suffers from three critical limitations: (1) they vary only a narrow set of configuration parameters; (2) they rely heavily on synthetic workloads rather than real-world data; and (3) they lack unified metrics to capture the trade-offs between execution efficiency, resource consumption, and schema complexity. Furthermore, the specific performance dynamics of these engines on large-scale, spatio-temporal datasets remain underexplored.
Methodology
The authors present a reproducible benchmarking framework designed to systematically evaluate Hive and Spark under controlled conditions.
- Dataset: The study utilizes the Global Database of Events, Language, and Tone (GDELT) Event Dataset, a real-world, high-volume spatio-temporal dataset containing over 3.7 million records. The data covers the period from December 1, 2025, to February 28, 2026.
- Experimental Design: Ten distinct table configurations were created by crossing three design dimensions:
- Storage Format: TextFile (row-oriented) vs. Parquet (columnar).
- Table Type: Internal vs. External.
- Optimization Strategies: Partitioning (on
DATEADDED), Bucketing (onActor1Codewith 128 buckets), or a hybrid of both.
- Execution Control: Experiments were conducted on a six-node Cloudera-managed Hadoop cluster. To ensure fairness and reproducibility, the study employed randomization of execution order, discarded warm-up runs, utilized off-peak scheduling, and performed multiple repetitions (three runs per configuration) to average out cluster noise. Variance checks confirmed that five repetitions were sufficient for stable averages.
- Workload: A complex analytical query was designed to simulate an event-intelligence use case involving actor aggregation, connotation classification (using the Goldstein Scale), and polarity ratio calculation. This query was executed identically in both HiveQL and SparkSQL.
- Metrics: Performance was assessed via a multi-metric approach including execution time, aggregated memory (MB-seconds), CPU usage (vCore-seconds), HDFS read volume, shuffle behavior, and task-level overheads (serialization, deserialization, garbage collection).
Key Contributions
- Reproducible Framework: A structured benchmarking protocol that systematically varies storage formats, table types, and schema-level optimizations to ensure fair cross-engine comparison.
- Multi-Metric Analysis: An evaluation extending beyond simple execution time to include resource footprints (memory/CPU), I/O behavior, and internal engine overheads.
- Complexity Index (Ci): The formulation of a composite metric that integrates runtime, resource usage, and schema design complexity. This index serves as an interpretive lens to quantify efficiency-complexity trade-offs, rather than acting as a universal physical metric.
- Empirical Insights: Detailed characterization of the architectural trade-offs between Hive's disk-oriented MapReduce paradigm and Spark's in-memory DAG execution.
Results
- Engine Performance: Spark consistently demonstrated lower query latency, particularly on optimized configurations, due to its in-memory execution and aggressive pipelining. However, this speed came at a substantially higher cost in memory and CPU consumption. Conversely, Hive exhibited slower runtimes but maintained a highly conservative resource profile.
- Configuration Impact:
- Parquet vs. TextFile: Parquet consistently reduced storage footprint and query latency through compression and predicate pushdown. TextFile layouts incurred higher I/O and parsing overheads.
- Partitioning: Partitioned Parquet emerged as the most balanced configuration across both engines, significantly reducing scan volumes and resource usage.
- Bucketing: The benefits of bucketing were highly sensitive to configuration. Poorly aligned bucketing (e.g., mismatched cardinality) led to small-file inefficiencies and increased metadata overhead, sometimes negating performance gains.
- Resource Trade-offs: On unoptimized, heavyweight tables, Hive surprisingly consumed more memory and CPU than Spark due to inefficient full-table scans and MapReduce overheads. However, on optimized, partitioned layouts, Hive became significantly more resource-frugal, while Spark's resource consumption remained high to maintain low latency.
- Complexity Index Utility: The Complexity Index effectively visualized these trade-offs. Spark configurations often pushed the index to maximum boundaries (high resource intensity for speed), whereas Hive configurations clustered near the center (resource frugality). The index highlighted that "faster" does not always mean "more efficient" when resource costs are factored in.
Significance and Claims
The paper claims that engine selection is strictly context-dependent rather than universally superior.
- Practical Guidance: The study provides concrete guidelines for system designers, suggesting that Spark is preferable for time-sensitive, iterative analytics, while Hive excels in scenarios prioritizing storage efficiency, resource economy, and schema governance.
- Sustainability Implications: The authors emphasize that configuration choices have direct environmental impacts. Optimized configurations (Partitioned Parquet) reduce redundant computation and I/O, thereby lowering energy expenditure and carbon emissions. Conversely, misconfigured layouts artificially inflate runtime and resource saturation.
- Methodological Advancement: By introducing the Complexity Index and a rigorous control protocol, the work establishes a baseline for reproducible benchmarking that moves beyond single-metric comparisons to a holistic view of efficiency-complexity trade-offs.
The authors conclude that there is no single "best" engine or schema; rather, optimal performance requires navigating a spectrum of trade-offs between speed, resource efficiency, and sustainability, guided by workload characteristics and configuration design.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.