[Paper Review] Approximate Distributed Joins in Apache Spark
This paper proposes ApproxJoin, a novel approximate distributed join operator for Apache Spark that combines Bloom filter sketching and stratified sampling to reduce data shuffling and communication costs while preserving statistical accuracy of join results. By filtering non-joinable tuples early and applying bias-corrected stratified sampling during the join, ApproxJoin achieves 6–9× speedup and 5–82× reduction in shuffled data compared to standard Spark joins, with tight error bounds and no need for prior input knowledge.
The join operation is a fundamental building block of parallel data processing. Unfortunately, it is very resource-intensive to compute an equi-join across massive datasets. The approximate computing paradigm allows users to trade accuracy and latency for expensive data processing operations. The equi-join operator is thus a natural candidate for optimization using approximation techniques. Although sampling-based approaches are widely used for approximation, sampling over joins is a compelling but challenging task regarding the output quality. Naive approaches, which perform joins over dataset samples, would not preserve statistical properties of the join output. To realize this potential, we interweave Bloom filter sketching and stratified sampling with the join computation in a new operator, ApproxJoin, that preserves the statistical properties of the join output. ApproxJoin leverages a Bloom filter to avoid shuffling non-joinable data items around the network and then applies stratified sampling to obtain a representative sample of the join output. Our analysis shows that ApproxJoin scales well and significantly reduces data movement, without sacrificing tight error bounds on the accuracy of the final results. We implemented ApproxJoin in Apache Spark and evaluated ApproxJoin using microbenchmarks and real-world case studies. The evaluation shows that ApproxJoin achieves a speedup of 6-9x over unmodified Spark-based joins with the same sampling rate. Furthermore, the speedup is accompanied by a significant reduction in the shuffled data volume, which is 5-82x less than unmodified Spark-based joins.
Motivation & Objective
- To address the high communication and computational cost of equi-joins on massive datasets in distributed systems like Apache Spark.
- To enable accurate, low-latency approximate query processing for ad-hoc analytical workloads over data lakes without requiring precomputed statistics or indexes.
- To overcome the bias and inaccuracy inherent in naive sampling of join inputs by preserving statistical properties of the actual join output.
- To design a system that dynamically adjusts sampling rates based on estimated join cardinality, meeting user-defined latency and accuracy constraints.
- To eliminate the need for prior knowledge such as primary keys, histograms, or cached samples, enabling use on arbitrary, unindexed data.
Proposed method
- Employing Bloom filters to filter out non-joinable tuples before shuffling, significantly reducing data movement across the network.
- Using Bloom filters to estimate the cardinality of the join result, which guides dynamic sampling rate selection to meet user-specified accuracy and latency requirements.
- Applying stratified sampling during the join operation on the remaining, potentially joinable tuples to generate a representative sample of the full join output.
- Correcting for potential sampling bias using the Horvitz-Thompson estimator and leveraging the Central Limit Theorem to ensure statistical reliability of the approximation.
- Integrating the ApproxJoin operator into Apache Spark as a drop-in replacement for standard joins, supporting both two-way and multi-way joins.
- Designing the system to be precondition-free, avoiding reliance on primary keys, foreign keys, or precomputed statistics about the input data.
Experimental results
Research questions
- RQ1Can we reduce communication overhead in distributed equi-joins without sacrificing accuracy in the approximate result?
- RQ2How can we ensure that sampling during the join operation preserves the statistical properties of the full join output, avoiding bias from naive input sampling?
- RQ3Can we dynamically adjust the sampling rate during the join based on runtime estimates to meet user-defined accuracy and latency constraints?
- RQ4Is it possible to achieve high performance and low data shuffling in approximate joins without requiring precomputed statistics, histograms, or indexing?
- RQ5How does the combination of Bloom filtering and stratified sampling compare to existing approximate join techniques in terms of speedup and data movement reduction?
Key findings
- ApproxJoin achieves a 6–9× speedup over standard Spark-based equi-joins when using the same sampling rate, significantly reducing query response time.
- The system reduces the volume of shuffled data by 5–82× compared to unmodified Spark joins, demonstrating substantial communication cost savings.
- Without any sampling, ApproxJoin still achieves a 2–10× speedup over standard Spark, indicating performance gains from Bloom filter-based filtering alone.
- The approximation maintains tight error bounds due to bias correction via the Horvitz-Thompson estimator, ensuring reliable statistical confidence intervals.
- The approach is effective for both two-way and multi-way joins and works without requiring primary key-foreign key relationships or precomputed statistics.
- Evaluation on microbenchmarks, TPC-H queries, and real-world workloads confirms the method’s robustness and scalability across diverse analytical workloads.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.