SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Cloudera Impala:
    A Modern SQL Engine for Apache Hadoop
    Ricky Saltzer
    Tools Developer / Impala Contributor




                                           ricky@cloudera.com
                                                 @monstrado

1
Impala Overview: Goals
•   General-purpose SQL query engine:
     •   should work both for analytical and transactional workloads
     •   will support queries that take from milliseconds to hours
•   Runs directly within Hadoop:
     •   reads widely used Hadoop file formats
     •   talks to widely used Hadoop storage managers
     •   runs on same nodes that run Hadoop processes
•   High performance:
     •   C++ instead of Java
     •   runtime code generation
     •   completely new execution engine that doesn't build on MapReduce
User View of Impala: Overview
•   Runs as a distributed service in cluster: one Impala daemon on each
    node with data
•   User submits query via ODBC/Beeswax Thrift API to any of the
    daemons
•   Query is distributed to all nodes with relevant data
•   If any node fails, the query fails
•   Impala uses Hive's metadata interface, connects to Hive's metastore
•   Supported file formats:
      •   text files (GA: with compression, including lzo)
      •   sequence files with snappy/gzip compression
      •   GA: Avro data files
      •   GA: Trevni (columnar format; more on that later)
User View of Impala: SQL
•   SQL support:
      •   patterned after Hive's version of SQL
      •   limited to Select, Project, Join, Union, Subqueries, Aggregation and
          Insert
      •   only equi-joins; no non-equi joins, no cross products
      •   Order By only with Limit
      •   GA: DDL support (CREATE, ALTER)
•   Functional limitations:
      •   no custom UDFs, file formats, SerDes
      •   no beyond SQL (buckets, samples, transforms, arrays, structs, maps,
          xpath, json)
      •   only hash joins; joined table has to fit in memory:
            • beta: of single node
            • GA: aggregate memory of all (executing) nodes
User View of Impala: Apache HBase
•   HBase functionality:
     •   uses Hive's mapping of HBase table into metastore table
     •   predicates on rowkey columns are mapped into start/stop
         row
     •   predicates on other columns are mapped into
         SingleColumnValueFilters
•   HBase functional limitations:
     •   no nested-loop joins
     •   all data stored as text
Impala Architecture
• Two binaries: impalad and statestored
• Impala daemon (impalad)
     •   handles client requests and all internal requests related to
         query execution
     •   exports Thrift services for these two roles
•   State store daemon (statestored)
     •   provides name service and metadata distribution
     •   also exports a Thrift service
Impala Architecture
•   Query execution phases
     •   request arrives via odbc/beeswax Thrift API
     •   planner turns request into collections of plan fragments
     •   coordinator initiates execution on remote impalad's
     •   during execution
           • intermediate results are streamed between executors
           • query results are streamed back to client
           • subject to limitations imposed to blocking operators
             (top-n, aggregation)
Impala Architecture: Planner
• join order = FROM clause order GA target: rudimentary cost-
  based optimizer
• 2-phase planning process:
     •   single-node plan: left-deep tree of plan operators
     •   plan partitioning: partition single-node plan to maximize scan locality,
         minimize data movement
•   plan operators: Scan, HashJoin, HashAggregation, Union, TopN,
    Exchange
•   distributed aggregation: pre-aggregation in all nodes, merge
    aggregation in single node. GA: hash-partitioned aggregation:
    re-partition aggregation input on grouping columns in order to
    reduce per-node memory requirement
Impala Architecture: Planner
•   Example: query with join and aggregation
    SELECT state, SUM(revenue)
    FROM HdfsTbl h JOIN HbaseTbl b ON (...)
    GROUP BY 1 ORDER BY 2 desc LIMIT 10

       TopN
                                                  Agg
                          TopN
       Agg                                       Hash
       Hash                Agg                   Join
       Join                                HDFS                   HBase
                           Exch                         Exch
                                           Scan                    Scan
    HDFS      HBase     at coordinator   at DataNodes          at region servers
    Scan       Scan
Impala Architecture: Query Execution
Request arrives via odbc/beeswax Thrift API


     SQL App                               Hive
                                                     HDFS NN   Statestore
      ODBC                             Metastore
                         SQL
                       request

     Query Planner                Query Planner           Query Planner
   Query Coordinator             Query Coordinator      Query Coordinator
    Query Executor               Query Executor          Query Executor
   HDFS DN     HBase             HDFS DN     HBase      HDFS DN    HBase
Impala Architecture: Query Execution
Planner turns request into collections of plan fragments
Coordinator initiates execution on remote impalad's

      SQL App                     Hive
                                            HDFS NN   Statestore
       ODBC                   Metastore




     Query Planner       Query Planner           Query Planner
    Query Coordinator   Query Coordinator      Query Coordinator
     Query Executor      Query Executor         Query Executor
    HDFS DN     HBase   HDFS DN     HBase      HDFS DN    HBase
Impala Architecture: Query Execution
Intermediate results are streamed between impalad's Query
results are streamed back to client

     SQL App                          Hive
                                                HDFS NN   Statestore
      ODBC                        Metastore

                   query
                  results

    Query Planner            Query Planner           Query Planner
   Query Coordinator        Query Coordinator      Query Coordinator
    Query Executor           Query Executor         Query Executor
   HDFS DN     HBase        HDFS DN     HBase      HDFS DN    HBase
Impala Architecture
•   Metadata handling:
     • utilizes Hive's metastore
     • caches metadata: no synchronous metastore API calls
       during query execution
     • beta: impalad's read metadata from metastore at startup
     • GA: metadata distribution through statestore
     • post-GA: HCatalog
Impala Architecture
•   Execution engine
     •   written in C++
     •   runtime code generation for "big loops"
          •   example: insert batch of rows into hash table
          •   code generation with llvm
          •   inlines all expressions; no function calls inside loop
     •   all data is copied into canonical in-memory tuple format; all
         fixed-width data is located at fixed offsets
     •   uses intrinsics/special cpu instructions for text parsing,
         crc32 computation, etc.
Impala's Statestore
•   Central system state repository
      •   name service (membership)
      •   GA: metadata
      •   GA: other scheduling-relevant or diagnostic state
•   Soft-state
      •   all impalad's register at startup
      •   impalad's re-register after losing connection
      •   Impala service continues to function in absence of statestored (but:
          with increasingly stale state)
      •   State pushed to impalad's periodically
      •   Repeated failed heartbeat means impalad evicted from cluster view
•   Thrift API for service / subscription registration
Statestore: Why not ZooKeeper?
•   ZK is not a good pub-sub system
     •   Watch API is awkward and requires a lot of client logic
     •   multiple round-trips required to get data for changes to
         node's children
     •   push model is more natural for our use case
•   Don't need all the guarantees ZK provides:
     • serializability
     • persistence
     • prefer to avoid complexity where possible

•   ZK is bad at the things we care about and good at the
    things we don't
Comparing Impala to Google Dremel
•   What is Dremel?
     •   columnar storage for data with nested structures
     •   distributed scalable aggregation on top of that
•   Columnar storage in Hadoop: joint project between Cloudera
    and Twitter
     •   new columnar format, derived from Doug Cutting's Trevni
     •   stores data in appropriate native/binary types
     •   can also store nested structures similar to Dremel's ColumnIO
•   Distributed aggregation: Impala
•   Impala plus columnar format: a superset of the published
    version of Dremel (which didn't support joins)
Comparing Impala to Hive
•   Hive: MapReduce as an execution engine
     •   High latency, low throughput queries
     •   Fault-tolerance model based on MapReduce's on-disk
         checkpointing; materializes all intermediate results
     •   Java runtime allows for easy late-binding of functionality:
         file formats and UDFs.
     •   Extensive layering imposes high runtime overhead
•   Impala:
     •   direct, process-to-process data exchange
     •   no fault tolerance
     •   an execution engine designed for low runtime overhead
Comparing Impala to Hive
•   Impala's performance advantage over Hive: no hard
    numbers, but
     •   Impala can get full disk throughput (~100MB/sec/disk);
         I/O-bound workloads often faster by 3-4x
     •   queries that require multiple map-reduce phases in Hive
         see a higher speedup
     •   queries that run against in-memory data see a higher
         speedup (observed up to 100x)
Impala Roadmap: GA – Q2 2013
•   New data formats:
     • lzo-compressed text
     • Avro
     • columnar

•   Better metadata handling:
     •   automatic metadata distribution through statestore
• Connectivity: jdbc
• Improved query execution: partitioned joins
• Further performance improvements
Impala Roadmap: GA – Q2 2013
•   Guidelines for production deployment:
     •   load balancing across impalad's
     •   resource isolation within MR cluster
•   Additional packages: RHEL 5.7, Ubuntu, Debian
Impala Roadmap: 2013
•   Improved HBase support:
     •   composite keys, Avro data in columns,
         index nested-loop joins,
         INSERT/UPDATE/DELETE
•   Additional SQL:
     • UDFs
     • SQL authorization and DDL
     • ORDER BY without LIMIT
     • window functions
     • support for structured data types
Impala Roadmap: 2013
•   Runtime optimizations:
     • straggler handling
     • join order optimization
     • improved cache management
     • data collocation for improved join performance

•   Resource management:
     • cluster-wide quotas
     • Teradata-style policies ("user x can never have more than 5
       concurrent queries running", etc.)
     • goal: run exploratory and production workloads in same
       cluster, against same data, w/o impacting production jobs
Questions
     •   My email:              Download Impala (beta)
          ricky@cloudera.com     cloudera.com/downloads

                                Learn more about Cloudera
                                 Enterprise RTQ, Powered
                                        by Impala
                                   cloudera.com/impala



     Thank you for attending!

24

More Related Content

PDF
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Databricks
 
PPTX
Hadoop Security Today & Tomorrow with Apache Knox
Vinay Shukla
 
PPTX
Apache hive introduction
Mahmood Reza Esmaili Zand
 
PDF
Diving into Delta Lake: Unpacking the Transaction Log
Databricks
 
PPTX
Backup and Disaster Recovery in Hadoop
larsgeorge
 
PDF
Introduction to Spark Internals
Pietro Michiardi
 
PPTX
Azure Data Factory Data Flow Performance Tuning 101
Mark Kromer
 
PDF
Hive tuning
Michael Zhang
 
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Databricks
 
Hadoop Security Today & Tomorrow with Apache Knox
Vinay Shukla
 
Apache hive introduction
Mahmood Reza Esmaili Zand
 
Diving into Delta Lake: Unpacking the Transaction Log
Databricks
 
Backup and Disaster Recovery in Hadoop
larsgeorge
 
Introduction to Spark Internals
Pietro Michiardi
 
Azure Data Factory Data Flow Performance Tuning 101
Mark Kromer
 
Hive tuning
Michael Zhang
 

What's hot (20)

PPTX
Inside MapR's M7
MapR Technologies
 
PDF
Sqoop
Prashant Gupta
 
PPTX
Apache Kudu: Technical Deep Dive


Cloudera, Inc.
 
PDF
Intro to HBase
alexbaranau
 
PPT
Hadoop Security Architecture
Owen O'Malley
 
PPTX
Hadoop Oozie
Madhur Nawandar
 
PDF
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
PDF
Monitoring Oracle Database Instances with Zabbix
Gerger
 
PDF
Spark SQL
Joud Khattab
 
PDF
Introduction to elasticsearch
pmanvi
 
PPTX
Hadoop Security Today and Tomorrow
DataWorks Summit
 
PDF
Hadoop YARN
Vigen Sahakyan
 
PPTX
Microsoft Azure Data Factory Hands-On Lab Overview Slides
Mark Kromer
 
PDF
Top 5 Mistakes When Writing Spark Applications
Spark Summit
 
PPTX
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Erik Krogen
 
PDF
Hadoop and Kerberos
Yuta Imai
 
PPTX
Session 14 - Hive
AnandMHadoop
 
PDF
Hadoop Architecture and HDFS
Edureka!
 
PDF
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
PDF
An overview of Neo4j Internals
Tobias Lindaaker
 
Inside MapR's M7
MapR Technologies
 
Apache Kudu: Technical Deep Dive


Cloudera, Inc.
 
Intro to HBase
alexbaranau
 
Hadoop Security Architecture
Owen O'Malley
 
Hadoop Oozie
Madhur Nawandar
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
Monitoring Oracle Database Instances with Zabbix
Gerger
 
Spark SQL
Joud Khattab
 
Introduction to elasticsearch
pmanvi
 
Hadoop Security Today and Tomorrow
DataWorks Summit
 
Hadoop YARN
Vigen Sahakyan
 
Microsoft Azure Data Factory Hands-On Lab Overview Slides
Mark Kromer
 
Top 5 Mistakes When Writing Spark Applications
Spark Summit
 
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Erik Krogen
 
Hadoop and Kerberos
Yuta Imai
 
Session 14 - Hive
AnandMHadoop
 
Hadoop Architecture and HDFS
Edureka!
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
An overview of Neo4j Internals
Tobias Lindaaker
 
Ad

Similar to Impala presentation (20)

PPTX
Cloudera Impala: A Modern SQL Engine for Hadoop
Cloudera, Inc.
 
PDF
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Modern Data Stack France
 
PDF
Jan 2013 HUG: Impala - Real-time Queries for Apache Hadoop
Yahoo Developer Network
 
PDF
An Introduction to Impala – Low Latency Queries for Apache Hadoop
Chicago Hadoop Users Group
 
PDF
Cloudera Impala presentation
markgrover
 
PDF
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
PDF
impalapresentation-130130105033-phpapp02 (1)_221220_235919.pdf
ssusere05ec21
 
PDF
Cloudera impala
Swiss Big Data User Group
 
PDF
Introduction to Impala
markgrover
 
PDF
Impala Architecture presentation
hadooparchbook
 
PPT
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
James Chen
 
PPTX
Impala for PhillyDB Meetup
Shravan (Sean) Pabba
 
PDF
SQL Engines for Hadoop - The case for Impala
markgrover
 
PDF
Cloudera Impala: A modern SQL Query Engine for Hadoop
Cloudera, Inc.
 
PPTX
Incredible Impala
Gwen (Chen) Shapira
 
PPTX
Strata + Hadoop World 2012: Data Science on Hadoop: How Cloudera Impala Unloc...
Cloudera, Inc.
 
PDF
Impala presentation ahad rana
Data Con LA
 
PPTX
BDM8 - Near-realtime Big Data Analytics using Impala
David Lauzon
 
PDF
Cloudera Impala - San Diego Big Data Meetup August 13th 2014
cdmaxime
 
PPTX
Technical Overview on Cloudera Impala
Praneeth Krishna
 
Cloudera Impala: A Modern SQL Engine for Hadoop
Cloudera, Inc.
 
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Modern Data Stack France
 
Jan 2013 HUG: Impala - Real-time Queries for Apache Hadoop
Yahoo Developer Network
 
An Introduction to Impala – Low Latency Queries for Apache Hadoop
Chicago Hadoop Users Group
 
Cloudera Impala presentation
markgrover
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
impalapresentation-130130105033-phpapp02 (1)_221220_235919.pdf
ssusere05ec21
 
Cloudera impala
Swiss Big Data User Group
 
Introduction to Impala
markgrover
 
Impala Architecture presentation
hadooparchbook
 
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
James Chen
 
Impala for PhillyDB Meetup
Shravan (Sean) Pabba
 
SQL Engines for Hadoop - The case for Impala
markgrover
 
Cloudera Impala: A modern SQL Query Engine for Hadoop
Cloudera, Inc.
 
Incredible Impala
Gwen (Chen) Shapira
 
Strata + Hadoop World 2012: Data Science on Hadoop: How Cloudera Impala Unloc...
Cloudera, Inc.
 
Impala presentation ahad rana
Data Con LA
 
BDM8 - Near-realtime Big Data Analytics using Impala
David Lauzon
 
Cloudera Impala - San Diego Big Data Meetup August 13th 2014
cdmaxime
 
Technical Overview on Cloudera Impala
Praneeth Krishna
 
Ad

More from trihug (11)

PDF
TriHUG October: Apache Ranger
trihug
 
PDF
TriHUG Feb: Hive on spark
trihug
 
PDF
TriHUG 3/14: HBase in Production
trihug
 
PDF
TriHUG 2/14: Apache Sentry
trihug
 
PDF
TriHUG talk on Spark and Shark
trihug
 
PDF
Practical pig
trihug
 
PPT
Financial services trihug
trihug
 
PPTX
TriHUG January 2012 Talk by Chris Shain
trihug
 
PPTX
TriHUG November HCatalog Talk by Alan Gates
trihug
 
PPTX
TriHUG November Pig Talk by Alan Gates
trihug
 
PPTX
MapR, Implications for Integration
trihug
 
TriHUG October: Apache Ranger
trihug
 
TriHUG Feb: Hive on spark
trihug
 
TriHUG 3/14: HBase in Production
trihug
 
TriHUG 2/14: Apache Sentry
trihug
 
TriHUG talk on Spark and Shark
trihug
 
Practical pig
trihug
 
Financial services trihug
trihug
 
TriHUG January 2012 Talk by Chris Shain
trihug
 
TriHUG November HCatalog Talk by Alan Gates
trihug
 
TriHUG November Pig Talk by Alan Gates
trihug
 
MapR, Implications for Integration
trihug
 

Recently uploaded (20)

PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
The Future of Artificial Intelligence (AI)
Mukul
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 

Impala presentation

  • 1. Cloudera Impala: A Modern SQL Engine for Apache Hadoop Ricky Saltzer Tools Developer / Impala Contributor [email protected] @monstrado 1
  • 2. Impala Overview: Goals • General-purpose SQL query engine: • should work both for analytical and transactional workloads • will support queries that take from milliseconds to hours • Runs directly within Hadoop: • reads widely used Hadoop file formats • talks to widely used Hadoop storage managers • runs on same nodes that run Hadoop processes • High performance: • C++ instead of Java • runtime code generation • completely new execution engine that doesn't build on MapReduce
  • 3. User View of Impala: Overview • Runs as a distributed service in cluster: one Impala daemon on each node with data • User submits query via ODBC/Beeswax Thrift API to any of the daemons • Query is distributed to all nodes with relevant data • If any node fails, the query fails • Impala uses Hive's metadata interface, connects to Hive's metastore • Supported file formats: • text files (GA: with compression, including lzo) • sequence files with snappy/gzip compression • GA: Avro data files • GA: Trevni (columnar format; more on that later)
  • 4. User View of Impala: SQL • SQL support: • patterned after Hive's version of SQL • limited to Select, Project, Join, Union, Subqueries, Aggregation and Insert • only equi-joins; no non-equi joins, no cross products • Order By only with Limit • GA: DDL support (CREATE, ALTER) • Functional limitations: • no custom UDFs, file formats, SerDes • no beyond SQL (buckets, samples, transforms, arrays, structs, maps, xpath, json) • only hash joins; joined table has to fit in memory: • beta: of single node • GA: aggregate memory of all (executing) nodes
  • 5. User View of Impala: Apache HBase • HBase functionality: • uses Hive's mapping of HBase table into metastore table • predicates on rowkey columns are mapped into start/stop row • predicates on other columns are mapped into SingleColumnValueFilters • HBase functional limitations: • no nested-loop joins • all data stored as text
  • 6. Impala Architecture • Two binaries: impalad and statestored • Impala daemon (impalad) • handles client requests and all internal requests related to query execution • exports Thrift services for these two roles • State store daemon (statestored) • provides name service and metadata distribution • also exports a Thrift service
  • 7. Impala Architecture • Query execution phases • request arrives via odbc/beeswax Thrift API • planner turns request into collections of plan fragments • coordinator initiates execution on remote impalad's • during execution • intermediate results are streamed between executors • query results are streamed back to client • subject to limitations imposed to blocking operators (top-n, aggregation)
  • 8. Impala Architecture: Planner • join order = FROM clause order GA target: rudimentary cost- based optimizer • 2-phase planning process: • single-node plan: left-deep tree of plan operators • plan partitioning: partition single-node plan to maximize scan locality, minimize data movement • plan operators: Scan, HashJoin, HashAggregation, Union, TopN, Exchange • distributed aggregation: pre-aggregation in all nodes, merge aggregation in single node. GA: hash-partitioned aggregation: re-partition aggregation input on grouping columns in order to reduce per-node memory requirement
  • 9. Impala Architecture: Planner • Example: query with join and aggregation SELECT state, SUM(revenue) FROM HdfsTbl h JOIN HbaseTbl b ON (...) GROUP BY 1 ORDER BY 2 desc LIMIT 10 TopN Agg TopN Agg Hash Hash Agg Join Join HDFS HBase Exch Exch Scan Scan HDFS HBase at coordinator at DataNodes at region servers Scan Scan
  • 10. Impala Architecture: Query Execution Request arrives via odbc/beeswax Thrift API SQL App Hive HDFS NN Statestore ODBC Metastore SQL request Query Planner Query Planner Query Planner Query Coordinator Query Coordinator Query Coordinator Query Executor Query Executor Query Executor HDFS DN HBase HDFS DN HBase HDFS DN HBase
  • 11. Impala Architecture: Query Execution Planner turns request into collections of plan fragments Coordinator initiates execution on remote impalad's SQL App Hive HDFS NN Statestore ODBC Metastore Query Planner Query Planner Query Planner Query Coordinator Query Coordinator Query Coordinator Query Executor Query Executor Query Executor HDFS DN HBase HDFS DN HBase HDFS DN HBase
  • 12. Impala Architecture: Query Execution Intermediate results are streamed between impalad's Query results are streamed back to client SQL App Hive HDFS NN Statestore ODBC Metastore query results Query Planner Query Planner Query Planner Query Coordinator Query Coordinator Query Coordinator Query Executor Query Executor Query Executor HDFS DN HBase HDFS DN HBase HDFS DN HBase
  • 13. Impala Architecture • Metadata handling: • utilizes Hive's metastore • caches metadata: no synchronous metastore API calls during query execution • beta: impalad's read metadata from metastore at startup • GA: metadata distribution through statestore • post-GA: HCatalog
  • 14. Impala Architecture • Execution engine • written in C++ • runtime code generation for "big loops" • example: insert batch of rows into hash table • code generation with llvm • inlines all expressions; no function calls inside loop • all data is copied into canonical in-memory tuple format; all fixed-width data is located at fixed offsets • uses intrinsics/special cpu instructions for text parsing, crc32 computation, etc.
  • 15. Impala's Statestore • Central system state repository • name service (membership) • GA: metadata • GA: other scheduling-relevant or diagnostic state • Soft-state • all impalad's register at startup • impalad's re-register after losing connection • Impala service continues to function in absence of statestored (but: with increasingly stale state) • State pushed to impalad's periodically • Repeated failed heartbeat means impalad evicted from cluster view • Thrift API for service / subscription registration
  • 16. Statestore: Why not ZooKeeper? • ZK is not a good pub-sub system • Watch API is awkward and requires a lot of client logic • multiple round-trips required to get data for changes to node's children • push model is more natural for our use case • Don't need all the guarantees ZK provides: • serializability • persistence • prefer to avoid complexity where possible • ZK is bad at the things we care about and good at the things we don't
  • 17. Comparing Impala to Google Dremel • What is Dremel? • columnar storage for data with nested structures • distributed scalable aggregation on top of that • Columnar storage in Hadoop: joint project between Cloudera and Twitter • new columnar format, derived from Doug Cutting's Trevni • stores data in appropriate native/binary types • can also store nested structures similar to Dremel's ColumnIO • Distributed aggregation: Impala • Impala plus columnar format: a superset of the published version of Dremel (which didn't support joins)
  • 18. Comparing Impala to Hive • Hive: MapReduce as an execution engine • High latency, low throughput queries • Fault-tolerance model based on MapReduce's on-disk checkpointing; materializes all intermediate results • Java runtime allows for easy late-binding of functionality: file formats and UDFs. • Extensive layering imposes high runtime overhead • Impala: • direct, process-to-process data exchange • no fault tolerance • an execution engine designed for low runtime overhead
  • 19. Comparing Impala to Hive • Impala's performance advantage over Hive: no hard numbers, but • Impala can get full disk throughput (~100MB/sec/disk); I/O-bound workloads often faster by 3-4x • queries that require multiple map-reduce phases in Hive see a higher speedup • queries that run against in-memory data see a higher speedup (observed up to 100x)
  • 20. Impala Roadmap: GA – Q2 2013 • New data formats: • lzo-compressed text • Avro • columnar • Better metadata handling: • automatic metadata distribution through statestore • Connectivity: jdbc • Improved query execution: partitioned joins • Further performance improvements
  • 21. Impala Roadmap: GA – Q2 2013 • Guidelines for production deployment: • load balancing across impalad's • resource isolation within MR cluster • Additional packages: RHEL 5.7, Ubuntu, Debian
  • 22. Impala Roadmap: 2013 • Improved HBase support: • composite keys, Avro data in columns, index nested-loop joins, INSERT/UPDATE/DELETE • Additional SQL: • UDFs • SQL authorization and DDL • ORDER BY without LIMIT • window functions • support for structured data types
  • 23. Impala Roadmap: 2013 • Runtime optimizations: • straggler handling • join order optimization • improved cache management • data collocation for improved join performance • Resource management: • cluster-wide quotas • Teradata-style policies ("user x can never have more than 5 concurrent queries running", etc.) • goal: run exploratory and production workloads in same cluster, against same data, w/o impacting production jobs
  • 24. Questions • My email: Download Impala (beta) [email protected] cloudera.com/downloads Learn more about Cloudera Enterprise RTQ, Powered by Impala cloudera.com/impala Thank you for attending! 24