Skip to main content

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​

FigureContextSource
3 to 4xGain over Hive on I/O-bound queries (2012)Cloudera blog 2012
7 to 45xGain over Hive on queries with at least one join (2012)Cloudera blog 2012
20 to 90xGain over Hive when data is cached in memory, even on simple aggregations (2012)Cloudera blog 2012
5x or moreTypical gain from LLVM code generation (2015)CIDR 2015 paper
13x and 27.4xClaimed lead in single-user and multi-user runs over SparkSQL, Presto and Hive 0.13, Cloudera benchmark (2015)CIDR 2015 paper
2 yearsLength of the Apache incubation, from December 2015 to November 2017ASF 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, then UPDATE on 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​

StrengthsLimitations
Interactive latency, holds up well with many usersNo UPDATE or DELETE on HDFS (2015), bulk inserts only
Reuses Hive metastore, SQL and toolingSingle statestore instance
Local data reads, no ETLPaper 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​

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.