SlideShare a Scribd company logo
Impala internals
By David Gruzman
BigDataCraft.com
Cloudera Impala Internals
Impala
by David Gruzman
►Impala is
– Relational Query Engine
– Open source
– Massive parallel processing
Why do we care, about internals?
► SQL is declarative, no need for internals...
► In the same time, even small problems in
engine operation require good understanding of
its work principles to fix...
► It is hardly possible to optimize without
understanding algorithms under the hood.
► It is hard to make decisions about engine
suitability to future needs without knowing
technical limitations.
Engine parts
How to understand engine?
What it is doing?
Main principle of operation
Main building block
Operation sequence
Operation environment
Efficiency
Design decisions
Materials
Main problems and fixes
What it is doing
Impala is Relation engine. It executes SQL
queries.
Data is append-able only. There is no “Update” or
“Delete” statements.
Principle of operation
Main differentiators are:
Distribution of Query among nodes (MPP)
LLVM and Code generation. Impala is compiler.
Relay on HDFS
Use external metadata – hive metastore.
Parallel query capability (per node, per cluster).
Sequence of operation
Query parsing – translate SQL to AST(Abstract
syntax tree)
Match objects to metadata
Query planning – create physical execution plan.
In case of MPP – divide plan into plan fragments
for nodes.
Distribute plan fragments to nodes
Execute plan fragments.
Main building blocks
Front End. This is Java code which implements a
lot of logic with non-critical performance
- database objects
fe/src/main/java/com/cloudera/impala/analysis/
- execution plan parts :
fe/src/main/java/com/cloudera/impala/planner/
BackEnd (Be)
Backend is written on C++, and used mostly for
performance critical parts. Specifically:
- Execution of the plan fragments on nodes
- Services implementation
ImpalaD service
StateStore
Catalog Service
Services - ImpalaD
This is “main” service of impala which runs on
each node. It logically consists of the following
sub-services of our interest.
ImpalaService – service, used to execute query.
Console, JDBC/ODBC connects here.
ImpalaInternalService – service is used to
coordinate work within the impala cluster.
Example of usage – to coordinate the job of
running query fragments on planned impala
nodes.
What is interesting for us? Each node can serve
Dual role of ImpalaD service
Query coordinator
Fragment executor
Services view
Front End
Impala
Service
Impala Internal
Service
ImpalaService – main methods
inherited from beeswax :
ExecuteAndWait
Fetch
Explain
Impala specific :
ResetCatalog
GetRuntimeProfile
ImpalaInternalService – main
methods
ExecPlanFragment
ReportExecStatus
CancelPlanFragment
TransmitData
Services - StateStore
In many clusters we have to solve “cluster
synchronization” problem on some or other way.
In impala it is solved by StateStore –
published/subscriber service, similar to
Zookeeper. Why Zookeeper is not used?
It speaks with its clients in terms of topics. Clients
can subscribe to different topics. So to find
“endpoints” - look in the sources for the usage of
“StatestoreSubscriber”
StateStore – main topics
IMPALA_MEMBERSHIP_TOPIC – updates about
attached and detached nodes.
IMPALA_CATALOG_TOPIC – updates about
metadata changes.
IMPALA_REQUEST_QUEUE_TOPIC – updates
in the queue of waiting queries.
Admission control
There is module called AdmissionController.
Via topic impala-request-queue it is know about
queries currently running and their basic
statistics like memory and CPU consumption.
Based on this info it can decide to:
-run query
-queue query
-reject query
Catalog Service
It caches in Java code metadata from hive
metastore:
/fe/src/main/java/com/cloudera/impala/catalog/
It is important since Hive's native partition pruning
is slow especially with large number of
partitions.
It use C++ code be/src/catalog/
To relay changes (delta's) to other nodes via
StateStore.
Differance with hive
Catalog Service store in memory and operate on
metadata, leaving MetaStore for persistance
only.
Technically it mean that disconnection from
MetaStore is not that complicated.
ImpalaInternalService - details
This is place where the real heavy lifting takes
place.
Before diving in, what we want to understand
here:
Threading model
File System interface
Predicate pushdown
Resource management
Threading model
DiskIoMgr schedules access of all readers to all
disks. It should include predicates.
It can give optimal concurrency. Sounds coherent
to the Intel TBB / Java Executor service
approach: give me small tasks and I will
schedule them.
The rest of operations – like Joins, Group By looks
like single threaded in current version.
IMHO – sort joins and group by are better for
concurrency.
File System interface
Impala is working via LibHDFS – so HDFS (not
DFS) is hard coded.
Impala required and checked that short circuit is
enabled.
During planning phase names of the block files to
be scanned are determined.
Main “database” algorithm
It is interesting to see, how main operations are
implemented, what options do we have:
Group By,
Order By (Sort),
Join
Join
Join is probably most powerful and performance
critical part of any analytical RDBMS.
Impala implements BroadCastJoin and
GraceHashJoin.(be/src/exec/partitioned-hash-join-
node.h). Both are kinds of Hash Join.
Basic idea of GraceHashJoin is to partition data,
and load in memory corresponding partitions of
the tables for the join.
DiskMemory
Part 2 Part 3 Part 4Part 1 Part 5
Part 2 Part 3 Part 4Part 1 Part 5
Part 2 Part 3 Part 4Part 1 Part 5Part 3 Part 4 Part 5
In-memory hash join
DiskMemory
Part 3 Part 4
Part 3 Part 4 Part 5
Part 5
BroadCast join
Just send small table to all nodes and join with big
one.
It is very similar to Map Side join in Hive.
Selection of join algorithm can be hinted.
Group by
There are two main approaches – using dictionary
or sorting.
Aggregation can be subject to memory problems
with too many groups.
Impala is using Partitioned Hash join which can
spill to disk using BufferedBlockManager.
It is somewhat analogous to join implementation.
User defined functions
Impala supports two kinds of UDF / UDAF
- Native, written in C/C++
- Hive's UDF written in java.
Caching
Impala does not cache data by itself.
It delegates it to the new HDFS caching capability.
In a nutshell – HDFS is capable to keep given
directory in memory.
Zero copy access via MMAP is implemented.
Why it is better then buffer cache?
Less task switching
No CRC Check
Spill to Disk
In order to be reliable, especially in face of Data
Skews, some sort of spilling data to disk is
needed.
Impala approach this problem with introduction of
BufferedBlockMgr
It implements mechanism somewhat similar to
virtual memory – pin, unpin blocks, persist them.
It can use many disks to distribute load.
It is used in all places where memory can be not
sufficient
Why not Virtual Memory?
Some databases offload all buffer management to
the OS Virtual Memory. Most popular example:
MongoDB.
Impala create BufferedBlockManager per
PlanFragment.
It gives control how much memory consumed by
single query on given node.
We can summarize answer as : better resource
management.
BufferedBlockMgr usage
Partitioned join
Sorting
Buffered Tuple Stream
Partitioned aggregation
Memory Management
Impala BE has its own MemPool class for memory
allocation.
It is used across the board by runtime primitives
and plan nodes.
Why own Runtime?
Impala has implemented own runtime – memory
management, virtual memory?
IMHO Existing runtime (both Posix, and C++
runtime) are not multi-tenant. It is hard to track
and limit resource usage by different requests in
the same process.
To solve this problem Impala has its own runtime
with tracking and limiting capabilities.
YARN integration
When Impala run as part of the Hadoop stack
resource sharing is important question...
Two main options are
- Just divide resources between Impala and Yarn
using cgroups.
- Use YARN for the resource management.
Yarn Impala Impedance
YARN is built to schedule batch processing.
Impala is aimed to sub-second queries.
Running application master per query does not
sounds “low latency”.
Requesting resources “as execution go” does not
suit pipeline execution of query fragments.
L..LAMA ?
LLAMA
Low Latency Application Master
Or
Long Living Application Master
It enable low latency requests by living longer –
for a whole application lifetime.
How LLAMA works
1. There is single LLAMA daemon to broker
resources between Impala and YARN
2. Impala ask for all resources at once - “gang
scheduling”
3. LLAMA cache resources before return them to
YARN.
Important point
Impala is capable of:
- Run real time queries In YARN environment
- Ask for more resources (especially memory)
when needed.
Main drawbacks:
Impala implements own resource management among concurrent
queries, thus partially duplicating YARN functionality.
Possible deadlocks between two YARN applications.
Find 10 similarities
What is source of similarity
With all the difference, they solve similar problem:
How to survive in Africa...
O, sorry,
How to run and coordinate number of tasks in the
cluster.
Hadoop parallels
QueryPlanner – Developer or Hive. Somebody
who create job.
Coordinator, ImpalaServer – Job Tracker
PlanFragment – Task. (map or reduce)
ImpalaInternalService – TaskTracker
RequestPoolService+Scheduler+AdmissionContr
oller = Hadoop job Scheduler.
StateStore – Zookeeper.
ImpalaToGo
While being a perfect product Impala is chained to
the hadoop stack
- HDFS
- Management
Why it is a the problem?
HDFS is perfect to store vast amounts of data.
HDFS is built from large inexpensive SATA drives.
For the interactive analytics we want fast storage.
We can not afford FLASH drives for whole big
data.
What is solution
We can create another hadoop cluster on flash
storage.
Minus – another namenode to manage, replication
will waste space.
If replication factor is one – any problems should
be manually repaired.
Cache Layer in place of DFS
HDFS/Hadoop cluster
ImpalaToGo cluster
Data caching (LRU)
Auto load
Elasticity
Having cache layer in place of distributed file
system it is much easier to resize cluster.
ImpalaToGo is used consistent hashing for its data
placement – to minimize impact on resize.
Who we are?
Group of like minded developers, working on
making Impala even greater.
Thank you!!!
Please ask questions!

More Related Content

What's hot

How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...
DataWorks Summit/Hadoop Summit
 
Performance Optimizations in Apache Impala
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
Cloudera, Inc.
 
Enabling the Active Data Warehouse with Apache Kudu
Enabling the Active Data Warehouse with Apache KuduEnabling the Active Data Warehouse with Apache Kudu
Enabling the Active Data Warehouse with Apache Kudu
Grant Henke
 
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Spark Summit
 
Strata London 2019 Scaling Impala
Strata London 2019 Scaling ImpalaStrata London 2019 Scaling Impala
Strata London 2019 Scaling Impala
Manish Maheshwari
 
Introduction to Kafka
Introduction to KafkaIntroduction to Kafka
Introduction to Kafka
Akash Vacher
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Databricks
 
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Databricks
 
Introduction to Apache NiFi dws19 DWS - DC 2019
Introduction to Apache NiFi   dws19 DWS - DC 2019Introduction to Apache NiFi   dws19 DWS - DC 2019
Introduction to Apache NiFi dws19 DWS - DC 2019
Timothy Spann
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path Forward
Alluxio, Inc.
 
Apache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationApache Spark Core – Practical Optimization
Apache Spark Core – Practical Optimization
Databricks
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
Jun Rao
 
Optimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache SparkOptimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache Spark
Databricks
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
Jeff Holoman
 
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Databricks
 
Apache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data Processing
DataWorks Summit
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data Analytics
Alluxio, Inc.
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Databricks
 
Actionable Insights with AI - Snowflake for Data Science
Actionable Insights with AI - Snowflake for Data ScienceActionable Insights with AI - Snowflake for Data Science
Actionable Insights with AI - Snowflake for Data Science
Harald Erb
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
Databricks
 

What's hot (20)

How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...
 
Performance Optimizations in Apache Impala
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
 
Enabling the Active Data Warehouse with Apache Kudu
Enabling the Active Data Warehouse with Apache KuduEnabling the Active Data Warehouse with Apache Kudu
Enabling the Active Data Warehouse with Apache Kudu
 
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
 
Strata London 2019 Scaling Impala
Strata London 2019 Scaling ImpalaStrata London 2019 Scaling Impala
Strata London 2019 Scaling Impala
 
Introduction to Kafka
Introduction to KafkaIntroduction to Kafka
Introduction to Kafka
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
 
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
 
Introduction to Apache NiFi dws19 DWS - DC 2019
Introduction to Apache NiFi   dws19 DWS - DC 2019Introduction to Apache NiFi   dws19 DWS - DC 2019
Introduction to Apache NiFi dws19 DWS - DC 2019
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path Forward
 
Apache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationApache Spark Core – Practical Optimization
Apache Spark Core – Practical Optimization
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
 
Optimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache SparkOptimizing Delta/Parquet Data Lakes for Apache Spark
Optimizing Delta/Parquet Data Lakes for Apache Spark
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
 
Apache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data Processing
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data Analytics
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
 
Actionable Insights with AI - Snowflake for Data Science
Actionable Insights with AI - Snowflake for Data ScienceActionable Insights with AI - Snowflake for Data Science
Actionable Insights with AI - Snowflake for Data Science
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 

Viewers also liked

Cloudera Impala technical deep dive
Cloudera Impala technical deep diveCloudera Impala technical deep dive
Cloudera Impala technical deep dive
huguk
 
ImpalaToGo use case
ImpalaToGo use caseImpalaToGo use case
ImpalaToGo use case
David Groozman
 
Impala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for HadoopImpala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for Hadoop
Cloudera, Inc.
 
Impala Resource Management - OUTDATED
Impala Resource Management - OUTDATEDImpala Resource Management - OUTDATED
Impala Resource Management - OUTDATED
Matthew Jacobs
 
ImpalaToGo introduction
ImpalaToGo introductionImpalaToGo introduction
ImpalaToGo introduction
David Groozman
 
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
VMware Tanzu
 
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in HadoopKudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
jdcryans
 
Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4
Chris Nauroth
 
(Aaron myers) hdfs impala
(Aaron myers)   hdfs impala(Aaron myers)   hdfs impala
(Aaron myers) hdfs impala
NAVER D2
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using Impala
Jason Shih
 
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Cloudera, Inc.
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
Incredible Impala
Incredible Impala Incredible Impala
Incredible Impala
Gwen (Chen) Shapira
 
Hadoop & cloud storage object store integration in production (final)
Hadoop & cloud storage  object store integration in production (final)Hadoop & cloud storage  object store integration in production (final)
Hadoop & cloud storage object store integration in production (final)
Chris Nauroth
 
SecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security SystemsSecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security Systems
Yue Chen
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
Camuel Gilyadov
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
David Groozman
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Cloudera, Inc.
 
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
Cloudera, Inc.
 
Introduction to Apache Kudu
Introduction to Apache KuduIntroduction to Apache Kudu
Introduction to Apache Kudu
Jeff Holoman
 

Viewers also liked (20)

Cloudera Impala technical deep dive
Cloudera Impala technical deep diveCloudera Impala technical deep dive
Cloudera Impala technical deep dive
 
ImpalaToGo use case
ImpalaToGo use caseImpalaToGo use case
ImpalaToGo use case
 
Impala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for HadoopImpala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for Hadoop
 
Impala Resource Management - OUTDATED
Impala Resource Management - OUTDATEDImpala Resource Management - OUTDATED
Impala Resource Management - OUTDATED
 
ImpalaToGo introduction
ImpalaToGo introductionImpalaToGo introduction
ImpalaToGo introduction
 
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
 
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in HadoopKudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
 
Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4
 
(Aaron myers) hdfs impala
(Aaron myers)   hdfs impala(Aaron myers)   hdfs impala
(Aaron myers) hdfs impala
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using Impala
 
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
 
Incredible Impala
Incredible Impala Incredible Impala
Incredible Impala
 
Hadoop & cloud storage object store integration in production (final)
Hadoop & cloud storage  object store integration in production (final)Hadoop & cloud storage  object store integration in production (final)
Hadoop & cloud storage object store integration in production (final)
 
SecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security SystemsSecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security Systems
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
 
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
Hadoop Distributed File System (HDFS) Encryption with Cloudera Navigator Key ...
 
Introduction to Apache Kudu
Introduction to Apache KuduIntroduction to Apache Kudu
Introduction to Apache Kudu
 

Similar to Cloudera Impala Internals

Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
Jon Meredith
 
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Yahoo Developer Network
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
Navid Malek
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
webuploader
 
Impala presentation ahad rana
Impala presentation ahad ranaImpala presentation ahad rana
Impala presentation ahad rana
Data Con LA
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Baruch Sadogursky
 
HPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster TutorialHPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster Tutorial
Dirk Hähnel
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
Tim Ellison
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Dibyendu Bhattacharya
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
Bhupesh Bansal
 
data stage-material
data stage-materialdata stage-material
data stage-material
Rajesh Kv
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Cal Henderson
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
Hadoop User Group
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
IndicThreads
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scale
samthemonad
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
guest18a0f1
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
royans
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
mclee
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
Wipro
 

Similar to Cloudera Impala Internals (20)

Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
Impala presentation ahad rana
Impala presentation ahad ranaImpala presentation ahad rana
Impala presentation ahad rana
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
 
HPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster TutorialHPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster Tutorial
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
 
data stage-material
data stage-materialdata stage-material
data stage-material
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scale
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 

Recently uploaded

BitLocker Data Recovery | BLR Tools Data Recovery Solutions
BitLocker Data Recovery | BLR Tools Data Recovery SolutionsBitLocker Data Recovery | BLR Tools Data Recovery Solutions
BitLocker Data Recovery | BLR Tools Data Recovery Solutions
Alina Tait
 
09. Ruby Object Oriented Programming - Ruby Core Teaching
09. Ruby Object Oriented Programming - Ruby Core Teaching09. Ruby Object Oriented Programming - Ruby Core Teaching
09. Ruby Object Oriented Programming - Ruby Core Teaching
quanhoangd129
 
Unlocking the Future of Artificial Intelligence
Unlocking the Future of Artificial IntelligenceUnlocking the Future of Artificial Intelligence
Unlocking the Future of Artificial Intelligence
dorinIonescu
 
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing ToolsOld Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Benjamin Bischoff
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
John Gallagher
 
daily-improvements-with-sqdc-process.pdf
daily-improvements-with-sqdc-process.pdfdaily-improvements-with-sqdc-process.pdf
daily-improvements-with-sqdc-process.pdf
sayma33
 
BDRSuite - #1 Cost effective Data Backup and Recovery Solution
BDRSuite - #1 Cost effective Data Backup and Recovery SolutionBDRSuite - #1 Cost effective Data Backup and Recovery Solution
BDRSuite - #1 Cost effective Data Backup and Recovery Solution
praveene26
 
08. Ruby Enumerable - Ruby Core Teaching
08. Ruby Enumerable - Ruby Core Teaching08. Ruby Enumerable - Ruby Core Teaching
08. Ruby Enumerable - Ruby Core Teaching
quanhoangd129
 
03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching
quanhoangd129
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
6m9p7qnjj8
 
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
CS Kwak
 
Literals - A Machine Independent Feature
Literals - A Machine Independent FeatureLiterals - A Machine Independent Feature
Literals - A Machine Independent Feature
21h16charis
 
Applitools Autonomous 2.0 Sneak Peek.pdf
Applitools Autonomous 2.0 Sneak Peek.pdfApplitools Autonomous 2.0 Sneak Peek.pdf
Applitools Autonomous 2.0 Sneak Peek.pdf
Applitools
 
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
vijayatibirds
 
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
Andre Hora
 
Waze vs. Google Maps vs. Apple Maps, Who Else.pdf
Waze vs. Google Maps vs. Apple Maps, Who Else.pdfWaze vs. Google Maps vs. Apple Maps, Who Else.pdf
Waze vs. Google Maps vs. Apple Maps, Who Else.pdf
Ben Ramedani
 
Learning Rust with Advent of Code 2023 - Princeton
Learning Rust with Advent of Code 2023 - PrincetonLearning Rust with Advent of Code 2023 - Princeton
Learning Rust with Advent of Code 2023 - Princeton
Henry Schreiner
 
Top 10 ERP Companies in UAE Banibro IT Solutions.pdf
Top 10 ERP Companies in UAE Banibro IT Solutions.pdfTop 10 ERP Companies in UAE Banibro IT Solutions.pdf
Top 10 ERP Companies in UAE Banibro IT Solutions.pdf
Banibro IT Solutions
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
quanhoangd129
 
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
Alluxio, Inc.
 

Recently uploaded (20)

BitLocker Data Recovery | BLR Tools Data Recovery Solutions
BitLocker Data Recovery | BLR Tools Data Recovery SolutionsBitLocker Data Recovery | BLR Tools Data Recovery Solutions
BitLocker Data Recovery | BLR Tools Data Recovery Solutions
 
09. Ruby Object Oriented Programming - Ruby Core Teaching
09. Ruby Object Oriented Programming - Ruby Core Teaching09. Ruby Object Oriented Programming - Ruby Core Teaching
09. Ruby Object Oriented Programming - Ruby Core Teaching
 
Unlocking the Future of Artificial Intelligence
Unlocking the Future of Artificial IntelligenceUnlocking the Future of Artificial Intelligence
Unlocking the Future of Artificial Intelligence
 
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing ToolsOld Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
Old Tools, New Tricks: Unleashing the Power of Time-Tested Testing Tools
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
 
daily-improvements-with-sqdc-process.pdf
daily-improvements-with-sqdc-process.pdfdaily-improvements-with-sqdc-process.pdf
daily-improvements-with-sqdc-process.pdf
 
BDRSuite - #1 Cost effective Data Backup and Recovery Solution
BDRSuite - #1 Cost effective Data Backup and Recovery SolutionBDRSuite - #1 Cost effective Data Backup and Recovery Solution
BDRSuite - #1 Cost effective Data Backup and Recovery Solution
 
08. Ruby Enumerable - Ruby Core Teaching
08. Ruby Enumerable - Ruby Core Teaching08. Ruby Enumerable - Ruby Core Teaching
08. Ruby Enumerable - Ruby Core Teaching
 
03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
 
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
240717 ProPILE - Probing Privacy Leakage in Large Language Models.pdf
 
Literals - A Machine Independent Feature
Literals - A Machine Independent FeatureLiterals - A Machine Independent Feature
Literals - A Machine Independent Feature
 
Applitools Autonomous 2.0 Sneak Peek.pdf
Applitools Autonomous 2.0 Sneak Peek.pdfApplitools Autonomous 2.0 Sneak Peek.pdf
Applitools Autonomous 2.0 Sneak Peek.pdf
 
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
iBirds Services - Comprehensive Salesforce CRM and Software Development Solut...
 
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
Monitoring the Execution of 14K Tests: Methods Tend to Have One Path that Is ...
 
Waze vs. Google Maps vs. Apple Maps, Who Else.pdf
Waze vs. Google Maps vs. Apple Maps, Who Else.pdfWaze vs. Google Maps vs. Apple Maps, Who Else.pdf
Waze vs. Google Maps vs. Apple Maps, Who Else.pdf
 
Learning Rust with Advent of Code 2023 - Princeton
Learning Rust with Advent of Code 2023 - PrincetonLearning Rust with Advent of Code 2023 - Princeton
Learning Rust with Advent of Code 2023 - Princeton
 
Top 10 ERP Companies in UAE Banibro IT Solutions.pdf
Top 10 ERP Companies in UAE Banibro IT Solutions.pdfTop 10 ERP Companies in UAE Banibro IT Solutions.pdf
Top 10 ERP Companies in UAE Banibro IT Solutions.pdf
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
 
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
Alluxio Webinar | What’s new in Alluxio Enterprise AI 3.2: Leverage GPU Anywh...
 

Cloudera Impala Internals

  • 1. Impala internals By David Gruzman BigDataCraft.com
  • 3. Impala by David Gruzman ►Impala is – Relational Query Engine – Open source – Massive parallel processing
  • 4. Why do we care, about internals? ► SQL is declarative, no need for internals... ► In the same time, even small problems in engine operation require good understanding of its work principles to fix... ► It is hardly possible to optimize without understanding algorithms under the hood. ► It is hard to make decisions about engine suitability to future needs without knowing technical limitations.
  • 6. How to understand engine? What it is doing? Main principle of operation Main building block Operation sequence Operation environment Efficiency Design decisions Materials Main problems and fixes
  • 7. What it is doing Impala is Relation engine. It executes SQL queries. Data is append-able only. There is no “Update” or “Delete” statements.
  • 8. Principle of operation Main differentiators are: Distribution of Query among nodes (MPP) LLVM and Code generation. Impala is compiler. Relay on HDFS Use external metadata – hive metastore. Parallel query capability (per node, per cluster).
  • 9. Sequence of operation Query parsing – translate SQL to AST(Abstract syntax tree) Match objects to metadata Query planning – create physical execution plan. In case of MPP – divide plan into plan fragments for nodes. Distribute plan fragments to nodes Execute plan fragments.
  • 10. Main building blocks Front End. This is Java code which implements a lot of logic with non-critical performance - database objects fe/src/main/java/com/cloudera/impala/analysis/ - execution plan parts : fe/src/main/java/com/cloudera/impala/planner/
  • 11. BackEnd (Be) Backend is written on C++, and used mostly for performance critical parts. Specifically: - Execution of the plan fragments on nodes - Services implementation ImpalaD service StateStore Catalog Service
  • 12. Services - ImpalaD This is “main” service of impala which runs on each node. It logically consists of the following sub-services of our interest. ImpalaService – service, used to execute query. Console, JDBC/ODBC connects here. ImpalaInternalService – service is used to coordinate work within the impala cluster. Example of usage – to coordinate the job of running query fragments on planned impala nodes. What is interesting for us? Each node can serve
  • 13. Dual role of ImpalaD service Query coordinator Fragment executor
  • 15. ImpalaService – main methods inherited from beeswax : ExecuteAndWait Fetch Explain Impala specific : ResetCatalog GetRuntimeProfile
  • 17. Services - StateStore In many clusters we have to solve “cluster synchronization” problem on some or other way. In impala it is solved by StateStore – published/subscriber service, similar to Zookeeper. Why Zookeeper is not used? It speaks with its clients in terms of topics. Clients can subscribe to different topics. So to find “endpoints” - look in the sources for the usage of “StatestoreSubscriber”
  • 18. StateStore – main topics IMPALA_MEMBERSHIP_TOPIC – updates about attached and detached nodes. IMPALA_CATALOG_TOPIC – updates about metadata changes. IMPALA_REQUEST_QUEUE_TOPIC – updates in the queue of waiting queries.
  • 19. Admission control There is module called AdmissionController. Via topic impala-request-queue it is know about queries currently running and their basic statistics like memory and CPU consumption. Based on this info it can decide to: -run query -queue query -reject query
  • 20. Catalog Service It caches in Java code metadata from hive metastore: /fe/src/main/java/com/cloudera/impala/catalog/ It is important since Hive's native partition pruning is slow especially with large number of partitions. It use C++ code be/src/catalog/ To relay changes (delta's) to other nodes via StateStore.
  • 21. Differance with hive Catalog Service store in memory and operate on metadata, leaving MetaStore for persistance only. Technically it mean that disconnection from MetaStore is not that complicated.
  • 22. ImpalaInternalService - details This is place where the real heavy lifting takes place. Before diving in, what we want to understand here: Threading model File System interface Predicate pushdown Resource management
  • 23. Threading model DiskIoMgr schedules access of all readers to all disks. It should include predicates. It can give optimal concurrency. Sounds coherent to the Intel TBB / Java Executor service approach: give me small tasks and I will schedule them. The rest of operations – like Joins, Group By looks like single threaded in current version. IMHO – sort joins and group by are better for concurrency.
  • 24. File System interface Impala is working via LibHDFS – so HDFS (not DFS) is hard coded. Impala required and checked that short circuit is enabled. During planning phase names of the block files to be scanned are determined.
  • 25. Main “database” algorithm It is interesting to see, how main operations are implemented, what options do we have: Group By, Order By (Sort), Join
  • 26. Join Join is probably most powerful and performance critical part of any analytical RDBMS. Impala implements BroadCastJoin and GraceHashJoin.(be/src/exec/partitioned-hash-join- node.h). Both are kinds of Hash Join. Basic idea of GraceHashJoin is to partition data, and load in memory corresponding partitions of the tables for the join.
  • 27. DiskMemory Part 2 Part 3 Part 4Part 1 Part 5 Part 2 Part 3 Part 4Part 1 Part 5 Part 2 Part 3 Part 4Part 1 Part 5Part 3 Part 4 Part 5 In-memory hash join DiskMemory Part 3 Part 4 Part 3 Part 4 Part 5 Part 5
  • 28. BroadCast join Just send small table to all nodes and join with big one. It is very similar to Map Side join in Hive. Selection of join algorithm can be hinted.
  • 29. Group by There are two main approaches – using dictionary or sorting. Aggregation can be subject to memory problems with too many groups. Impala is using Partitioned Hash join which can spill to disk using BufferedBlockManager. It is somewhat analogous to join implementation.
  • 30. User defined functions Impala supports two kinds of UDF / UDAF - Native, written in C/C++ - Hive's UDF written in java.
  • 31. Caching Impala does not cache data by itself. It delegates it to the new HDFS caching capability. In a nutshell – HDFS is capable to keep given directory in memory. Zero copy access via MMAP is implemented. Why it is better then buffer cache? Less task switching No CRC Check
  • 32. Spill to Disk In order to be reliable, especially in face of Data Skews, some sort of spilling data to disk is needed. Impala approach this problem with introduction of BufferedBlockMgr It implements mechanism somewhat similar to virtual memory – pin, unpin blocks, persist them. It can use many disks to distribute load. It is used in all places where memory can be not sufficient
  • 33. Why not Virtual Memory? Some databases offload all buffer management to the OS Virtual Memory. Most popular example: MongoDB. Impala create BufferedBlockManager per PlanFragment. It gives control how much memory consumed by single query on given node. We can summarize answer as : better resource management.
  • 34. BufferedBlockMgr usage Partitioned join Sorting Buffered Tuple Stream Partitioned aggregation
  • 35. Memory Management Impala BE has its own MemPool class for memory allocation. It is used across the board by runtime primitives and plan nodes.
  • 36. Why own Runtime? Impala has implemented own runtime – memory management, virtual memory? IMHO Existing runtime (both Posix, and C++ runtime) are not multi-tenant. It is hard to track and limit resource usage by different requests in the same process. To solve this problem Impala has its own runtime with tracking and limiting capabilities.
  • 37. YARN integration When Impala run as part of the Hadoop stack resource sharing is important question... Two main options are - Just divide resources between Impala and Yarn using cgroups. - Use YARN for the resource management.
  • 38. Yarn Impala Impedance YARN is built to schedule batch processing. Impala is aimed to sub-second queries. Running application master per query does not sounds “low latency”. Requesting resources “as execution go” does not suit pipeline execution of query fragments.
  • 40. LLAMA Low Latency Application Master Or Long Living Application Master It enable low latency requests by living longer – for a whole application lifetime.
  • 41. How LLAMA works 1. There is single LLAMA daemon to broker resources between Impala and YARN 2. Impala ask for all resources at once - “gang scheduling” 3. LLAMA cache resources before return them to YARN.
  • 42. Important point Impala is capable of: - Run real time queries In YARN environment - Ask for more resources (especially memory) when needed. Main drawbacks: Impala implements own resource management among concurrent queries, thus partially duplicating YARN functionality. Possible deadlocks between two YARN applications.
  • 44. What is source of similarity With all the difference, they solve similar problem: How to survive in Africa... O, sorry, How to run and coordinate number of tasks in the cluster.
  • 45. Hadoop parallels QueryPlanner – Developer or Hive. Somebody who create job. Coordinator, ImpalaServer – Job Tracker PlanFragment – Task. (map or reduce) ImpalaInternalService – TaskTracker RequestPoolService+Scheduler+AdmissionContr oller = Hadoop job Scheduler. StateStore – Zookeeper.
  • 46. ImpalaToGo While being a perfect product Impala is chained to the hadoop stack - HDFS - Management
  • 47. Why it is a the problem? HDFS is perfect to store vast amounts of data. HDFS is built from large inexpensive SATA drives. For the interactive analytics we want fast storage. We can not afford FLASH drives for whole big data.
  • 48. What is solution We can create another hadoop cluster on flash storage. Minus – another namenode to manage, replication will waste space. If replication factor is one – any problems should be manually repaired.
  • 49. Cache Layer in place of DFS HDFS/Hadoop cluster ImpalaToGo cluster Data caching (LRU) Auto load
  • 50. Elasticity Having cache layer in place of distributed file system it is much easier to resize cluster. ImpalaToGo is used consistent hashing for its data placement – to minimize impact on resize.
  • 51. Who we are? Group of like minded developers, working on making Impala even greater.