Apache Impala
At a glance
- Problem solved: interactive SQL, with low latency and high concurrency, directly on Hadoop data, where Hive goes through batch jobs.
- Era: beta in October 2012, GA in May 2013 (Cloudera). Apache Incubator in December 2015, top-level project in November 2017.
- Category: MPP SQL query engine.
Historical context
In 2012, querying Hadoop in SQL means Hive, which translates queries into batch jobs: fine for large processing, too slow for BI and interactive exploration. Cloudera starts Impala in 2011 to bring the experience of a parallel (MPP) analytical database to data already stored in HDFS and HBase. The ASF states that Impala was inspired by Google F1, which also separates query processing from storage.
Key idea
Bypass MapReduce: long-running daemons, installed on every data node, execute the queries themselves, like a commercial parallel DBMS. Impala reuses the Hive Metastore, the Hive SQL syntax and the ODBC driver: Hive tables can be queried with no migration or ETL.
How it works
- impalad: one daemon per DataNode, to read blocks locally. All daemons are symmetric: each can coordinate a query or execute fragments of it.
- statestored: publish-subscribe service that disseminates metadata and cluster membership (single instance).
- catalogd: gateway to the catalog (Hive Metastore), broadcasts changes through the statestore.
- Execution: engine written from scratch in C++ and Java, Volcano model with Exchange operators, batch-at-a-time processing, runtime code generation with LLVM (gains of 5x or more according to the paper).
- Formats: text, SequenceFile, RCFile, Avro, and above all Parquet, the recommended one.
- Resources: built-in admission control, and integration with YARN through Llama (Low-Latency Application MAster).
By the numbers
| Figure | Context | Source |
|---|---|---|
| 3 to 4x | Gain over Hive on I/O-bound queries (2012) | Cloudera blog 2012 |
| 7 to 45x | Gain over Hive on queries with at least one join (2012) | Cloudera blog 2012 |
| 20 to 90x | Gain over Hive when data is cached in memory, even on simple aggregations (2012) | Cloudera blog 2012 |
| 5x or more | Typical gain from LLVM code generation (2015) | CIDR 2015 paper |
| 13x and 27.4x | Claimed lead in single-user and multi-user runs over SparkSQL, Presto and Hive 0.13, Cloudera benchmark (2015) | CIDR 2015 paper |
| 2 years | Length of the Apache incubation, from December 2015 to November 2017 | ASF Incubator |
Milestones
- 2011: Cloudera starts developing Impala, according to Marcel Kornacker.
- 24 October 2012: announcement and public beta, code open under the Apache license from day one.
- May 2013: general availability.
- 1 December 2015: enters the Apache Incubator.
- 5 October 2016: first Apache (incubating) release, 2.7.0.
- 15 November 2017: graduates from the incubator, announced on 28 November.
- Impala 4.3 then 4.4:
DELETE, thenUPDATEon Iceberg V2 tables.
Did you know?
- A Google F1 alumnus. Impala's architect, Marcel Kornacker, was the lead developer of the F1 query engine at Google before joining Cloudera. Wired's 2012 headline: "Man Busts Out of Google, Rebuilds Top-Secret Query Machine".
- Dremel, but better at joins. Cloudera pointed out that Dremel, as described in its 2010 paper, only handled single-table queries, whereas Impala supported all joins from its beta.
- No cache of its own. Impala does not manage its own cache: it relies on the operating system's buffer cache to keep hot data in memory (Marcel Kornacker, 2012).
- A very constrained beta. In 2012, every join had to fit in the memory of the smallest node in the cluster, and only text files and SequenceFiles could be read.
Strengths and limitations
| Strengths | Limitations |
|---|---|
| Interactive latency, holds up well with many users | No UPDATE or DELETE on HDFS (2015), bulk inserts only |
| Reuses Hive metastore, SQL and tooling | Single statestore instance |
| Local data reads, no ETL | Paper benchmarks published by Cloudera itself |
What came next
- Trino follows the same idea of an MPP SQL engine separated from storage, plugged into many sources.
- Spark SQL is one of the competitors compared in the paper.
- TODO: document Iceberg and Kudu support in recent versions.
Sources
raw-data/apache/impala/impala.md- https://impala.apache.org/overview.html
- https://news.apache.org/foundation/entry/the-apache-software-foundation-announces24
- Kornacker et al., "Impala: A Modern, Open-Source SQL Engine for Hadoop", CIDR 2015, https://www.cidrdb.org/cidr2015/Papers/CIDR15_Paper28.pdf
- Marcel Kornacker and Justin Erickson, "Cloudera Impala: Real-Time Queries in Apache Hadoop, For Real", 24 October 2012 (archived copy): https://web.archive.org/web/2013/http://blog.cloudera.com/blog/2012/10/cloudera-impala-real-time-queries-in-apache-hadoop-for-real/
- https://incubator.apache.org/projects/impala.html
- https://impala.apache.org/docs/build/html/topics/impala_iceberg.html
To do
- Release dates of Impala 4.3 and 4.4.
- Behavior when a node fails during a query.
- Kudu support for UPDATE and DELETE.