Apache Calcite: A Foundational Framework for Optimized
ery Processing Over Heterogeneous Data Sources
Edmon Begoli
Oak Ridge National Laboratory
(ORNL)
Oak Ridge, Tennessee, USA
begolie@ornl.gov
Jesús Camacho-Rodríguez
Hortonworks Inc.
Santa Clara, California, USA
jcamacho@hortonworks.com
Julian Hyde
Hortonworks Inc.
Santa Clara, California, USA
jhyde@hortonworks.com
Michael J. Mior
David R. Cheriton School of
Computer Science
University of Waterloo
Waterloo, Ontario, Canada
mmior@uwaterloo.ca
Daniel Lemire
University of Quebec (TELUQ)
Montreal, Quebec, Canada
lemire@gmail.com
ABSTRACT
Apache Calcite is a foundational software framework that provides
query processing, optimization, and query language support to
many popular open-source data processing systems such as Apache
Hive, Apache Storm, Apache Flink, Druid, and MapD. The goal of
this paper is to formally introduce Calcite to the broader research
community, briey present its history, and describe its architecture,
features, functionality, and patterns for adoption. Calcite’s archi-
tecture consists of a modular and extensible query optimizer with
hundreds of built-in optimization rules, a query processor capable of
processing a variety of query languages, an adapter architecture de-
signed for extensibility, and support for heterogeneous data models
and stores (relational, semi-structured, streaming, and geospatial).
This exible, embeddable, and extensible architecture is what makes
Calcite an attractive choice for adoption in big-data frameworks. It
is an active project that continues to introduce support for the new
types of data sources, query languages, and approaches to query
processing and optimization.
CCS CONCEPTS
• Information systems → DBMS engine architectures;
KEYWORDS
Apache Calcite, Relational Semantics, Data Management, Query
Algebra, Modular Query Optimization, Storage Adapters
ACM Reference Format:
Edmon Begoli, Jesús Camacho-Rodríguez, Julian Hyde, Michael J. Mior,
and Daniel Lemire. 2018. Apache Calcite: A Foundational Framework for
Publication rights licensed to ACM. ACM acknowledges that this contribution was
authored or co-authored by an employee, contractor or aliate of the United States
government. As such, the Government retains a nonexclusive, royalty-free right to
publish or reproduce this article, or to allow others to do so, for Government purposes
only.
SIGMOD’18, June 10–15, 2018, Houston, TX, USA
©
2018 Copyright held by the owner/author(s). Publication rights licensed to the
Association for Computing Machinery.
ACM ISBN 978-1-4503-4703-7/18/06... $15.00
https://doi.org/10.1145/3183713.3190662
Optimized Query Processing Over Heterogeneous Data Sources. In SIG-
MOD’18: 2018 International Conference on Management of Data, June 10–
15, 2018, Houston, TX, USA. ACM, New York, NY, USA, 10 pages. https:
//doi.org/10.1145/3183713.3190662
1 INTRODUCTION
Following the seminal System R, conventional relational database
engines dominated the data processing landscape. Yet, as far back as
2005, Stonebraker and Çetintemel [
49
] predicted that we would see
the rise a collection of specialized engines such as column stores,
stream processing engines, text search engines, and so forth. They
argued that specialized engines can oer more cost-eective per-
formance and that they would bring the end of the “one size ts
all” paradigm. Their vision seems today more relevant than ever.
Indeed, many specialized open-source data systems have since be-
come popular such as Storm [
50
] and Flink [
16
] (stream processing),
Elasticsearch [
15
] (text search), Apache Spark [
47
], Druid [
14
], etc.
As organizations have invested in data processing systems tai-
lored towards their specic needs, two overarching problems have
arisen:
•
The developers of such specialized systems have encoun-
tered related problems, such as query optimization [
4
,
25
]
or the need to support query languages such as SQL and
related extensions (e.g., streaming queries [
26
]) as well as
language-integrated queries inspired by LINQ [
33
]. With-
out a unifying framework, having multiple engineers inde-
pendently develop similar optimization logic and language
support wastes engineering eort.
•
Programmers using these specialized systems often have to
integrate several of them together. An organization might
rely on Elasticsearch, Apache Spark, and Druid. We need
to build systems capable of supporting optimized queries
across heterogeneous data sources [55].
Apache Calcite was developed to solve these problems. It is
a complete query processing system that provides much of the
common functionality—query execution, optimization, and query
languages—required by any database management system, except
for data storage and management, which are left to specialized
Industry 1: Adaptive Query Processing
SIGMOD’18, June 10-15, 2018, Houston, TX, USA