apache / gluten
git clone https://github.com/apache/gluten.git
v1.7.0 · 1mo ago
🔥 on GitHub Trending today
Gluten is a middle layer responsible for offloading JVM-based SQL engines' execution to native engines.
+0
stars, 24h · #597
—
stars, 7 days
+11
stars, 30 days · #9,991
1.6k
★ total
665
forks · 1.1k open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageScala
LicenseApache-2.0
Created2021-12-06 (4y ago)
Last pushtoday
Watchers37
OwnerOrganization
Seen on GitHub Trending
- 2026-10-20 — #17 daily in scala
- 2026-10-20 — #8 monthly in scala · +11 ★
GitHub topics
Links
- GitHub: github.com/apache/gluten
- Homepage: https://gluten.apache.org/
- Releases · Issues · Hacker News mentions
README excerpt
**A Middle Layer for Offloading JVM-Based SQL Execution to Native Engines** ## 1. Introduction ### Background Apache Spark is a mature and stable project that has been under continuous development for many years. It is one of the most widely used frameworks for scaling out the processing of petabyte-scale datasets. Over time, the Spark community has had to address significant performance challenges, which required a variety of optimizations. A major milestone came with Spark 2.0, where Whole-Stage Code Generation replaced the Volcano Model, delivering up to a 2× speedup. Since then, most subsequent improvements have focused on the query plan level, while the performance of individual operators has almost stopped improving. In recent years, several native SQL engines have been developed, such as ClickHouse and Velox. With features like native execution, columnar data formats, and vectorized data processing, these engines can outperform Spark’s JVM-based SQL engine. However, they currently don't directly support Spark SQL execution. ### Design Overview “Gluten” is Latin for "glue". The main goal of the Gluten project is to glue native engines to Spark SQL. Thus, we can benefit from the high performance of native engines and the high scalability enabled by the Spark ecosystem. The basic design principle is to reuse Spark’s control flow, while offloading compute-intensive data processing to the native side. More specifically: * Transform Spark’s physical plan into a Substrait plan, then transform it into the native engine's plan. * Offload performance-critical data processing to native engine. * Define clear JNI interfaces for native SQL engines. * Allow easy switching between available native backends. * Reuse Spark’s distributed control flow. * Manage data sharing between JVM and native. * Provide extensibility to support more native engines. ### Target Users Gluten's target users include anyone who wants to fundamentally accelerate Spark SQL. As a plugin to Spark, Gluten requires no changes to the DataFrame API or SQL queries; users only need to configure it correctly. ## 2. Architecture The overview chart is shown below. Substrait provides a well-defined, cross-language specification for data compute operations. Spark’s physical plan is transformed into a Substrait plan, which is then passed to the native side through a JNI call. On the native side, a chain of native operators is constructed and offloaded to the native engine. Gluten returns the results as a ColumnarBatch, and Spark’s Columnar API (introduced in Spark 3.0) is used during execution. Gluten adopts the Apache Arrow data format as its underlying representation. Currently, Gluten supports only the ClickHouse and Velox backends. Velox is a C++ database acceleration library that provides reusable, extensible, and high-performance data processing components. In addition, Gluten is designed to be extensible, allowing support for additional backends in the future. Gluten's key components: