SlideShare a Scribd company logo
Apache Hive & Stinger
Petabyte-scale SQL in Hadoop

Gunther Hagleitner
(gunther@apache.org)

© Hortonworks Inc. 2013.
Batch AND Interactive SQL-IN-Hadoop
Stinger Initiative

A broad, community-based effort to
drive the next generation of HIVE

Stinger Project
(announced February 2013)
Hive 0.11, May 2013:
• Base Optimizations
• SQL Analytic Functions
• ORCFile, Modern File Format

Goals:

Speed
Improve Hive query performance by 100X to
allow for interactive query times (seconds)

Scale
The only SQL interface to Hadoop designed
for queries that scale from TB to PB

Hive 0.12, October 2013:
•
•
•
•

VARCHAR, DATE Types
ORCFile predicate pushdown
Advanced Optimizations
Performance Boosts via YARN

Coming Soon:

SQL
Support broadest range of SQL semantics for
analytic applications running against Hadoop

…all IN Hadoop
© Hortonworks Inc. 2013.

•
•
•
•
•

Hive on Apache Tez
Query Service
Buffer Cache
Cost Based Optimizer (Optiq)
Vectorized Processing
Hive 0.12
Hive 0.12
Release Theme

Speed, Scale and SQL

Specific Features

•
•
•
•
•
•
•

Included
Components

© Hortonworks Inc. 2013.

10x faster query launch when using large number
(500+) of partitions
ORC File predicate pushdown speeds queries
Evaluate LIMIT on the map side
Parallel ORDER BY
New query optimizer
Introduces VARCHAR and DATE data types
GROUP BY on structs or unions

Apache Hive 0.12
SQL: Enhancing SQL Semantics
Hive SQL Datatypes

Hive SQL Semantics

SQL Compliance

INT

SELECT, INSERT

TINYINT/SMALLINT/BIGINT

GROUP BY, ORDER BY, SORT BY

BOOLEAN

JOIN on explicit join key

FLOAT

Inner, outer, cross and semi joins

DOUBLE

Sub-queries in FROM clause

Hive 12 provides a wide
array of SQL data types
and semantics so your
existing tools integrate
more seamlessly with
Hadoop

STRING

ROLLUP and CUBE

TIMESTAMP

UNION

BINARY

Windowing Functions (OVER, RANK, etc)

DECIMAL

Custom Java UDFs

ARRAY, MAP, STRUCT, UNION

Standard Aggregation (SUM, AVG, etc.)

DATE

Advanced UDFs (ngram, Xpath, URL)

VARCHAR

Sub-queries in WHERE, HAVING

CHAR

Expanded JOIN Syntax
SQL Compliant Security (GRANT, etc.)
INSERT/UPDATE/DELETE (ACID)
© Hortonworks Inc. 2013.

Available
Hive 0.12

Roadmap
Insert, Update and Delete (ACID)

HIVE-5317

• Additional SQL statements:
•
•
•
•
•
•

INSERT INTO table SELECT …
INSERT INTO table VALUES …
UPDATE table SET … WHERE …
DELETE FROM table WHERE …
MERGE INTO table …
BEGIN/END TRANSACTION
© Hortonworks Inc. 2013.

Page 5
Insert, Update and Delete

© Hortonworks Inc. 2013.

Page 6
SQL Compliant security

HIVE-5317

• Hive user has access to HDFS files
• Manages fine grained access via standard:
– Users and roles

–Privileges (insert, select, update, delete, all)
–Objects (tables, views)

–Grant/Revoke/Show statements to administrate
• Special roles
• PUBLIC – all users belong to this role
• SUPERUSER – privilege to create/drop role, grant access, …

• Trusted UDFs
• Pluggable sources for user to role mapping.
• E.g.: HDFS groups
© Hortonworks Inc. 2013.

Page 7
Extended sub-query support
• Sub-queries in where/having clause
• (NOT) IN/EXISTS
• Transformation at a high level are:
• In/Exists => Left outer join
• Not In/Exists => Left outer join
+ null check
• Correlation converted to “group by”
in sub-query
• Will work only if query can be flattened
• No “brute force” of sub-query

© Hortonworks Inc. 2013.

HIVE-784

Example:
select o_orderpriority, count(*)
from orders o
where
o_orderdate >= ’2013-01-01’
and exists (
select *
from lineitem
where
l_orderkey = o.o_orderkey
and l_commitdate < l_receiptdate
)
group by o_orderpriority
order by o_orderpriority;
HIVE-784

Alternate join syntax
• Allows for ‘comma separated’
join syntax
• Easier to use
• Facilitates integration with tools
• Important aspect is correct push
down of predicates
• Cross product is very expensive
• Conditions need to be pushed as
close to the table source as possible

© Hortonworks Inc. 2013.

Example:
select o_orderpriority, count(*)
from orders, lineitem
where
o_orderdate >= ’2013-01-01’
and l_orderkey = o_orderkey
and l_commitdate < l_receiptdate
group by o_orderpriority
order by o_orderpriority;
YARN: Taking Hadoop Beyond Batch
Store ALL DATA in one place…
Interact with that data in MULTIPLE WAYS

with Predictable Performance and Quality of Service
Applications Run Natively IN Hadoop
BATCH
INTERACTIVE
(MapReduce)
(Tez)

ONLINE
(HBase)

STREAMING
(Storm, S4,…)

GRAPH
(Giraph)

IN-MEMORY
(Spark)

HPC MPI
(OpenMPI)

OTHER
(Search)
(Weave…)

YARN (Cluster Resource Management)
HDFS2 (Redundant, Reliable Storage)

© Hortonworks Inc. 2013.

Page 10
Apache Tez (“Speed”)
• Replaces MapReduce as primitive for Pig, Hive, Cascading etc.
– Smaller latency for interactive queries
– Higher throughput for batch queries
– 22 contributors: Hortonworks (13), Facebook, Twitter, Yahoo, Microsoft
Task with pluggable Input, Processor and Output

Input

Processor

Output

Task
Tez Task - <Input, Processor, Output>

YARN ApplicationMaster to run DAG of Tez Tasks
© Hortonworks Inc. 2013.
Tez: Building blocks for scalable data processing
Classical ‘Map’

HDFS
Input

Map
Processor

Classical ‘Reduce’

Sorted
Output

Shuffle
Input

Shuffle
Input

Reduce
Processor

Sorted
Output

Intermediate ‘Reduce’ for
Map-Reduce-Reduce
© Hortonworks Inc. 2013.

Reduce
Processor

HDFS
Output
HIVE-4660

Hive-on-MR vs. Hive-on-Tez
SELECT g1.x, g1.avg, g2.cnt
FROM (SELECT a.x, AVERAGE(a.y) AS avg FROM a GROUP BY a.x) g1
JOIN (SELECT b.x, COUNT(b.y) AS avg FROM b GROUP BY b.x) g2
ON (g1.x = g2.x)
ORDER BY avg;

Hive – MR
M

M

Hive – Tez
GROUP b BY b.x

M

M

GROUP a BY a.x
R

Tez avoids
unnecessary writes
to HDFS

GROUP BY x

M
M

R

M

M

M

R
R

HDFS

JOIN (a,b)

HDFS

M

GROUP BY a.x
JOIN (a,b)
R

M

R

R

ORDER BY
HDFS

M

ORDER BY
R

© Hortonworks Inc. 2013.

R

M
Tez Sessions
… because Map/Reduce query startup is expensive

• Tez Sessions
– Hot containers ready for immediate use
– Removes task and job launch overhead (~5s – 30s)

• Hive
– Session launch/shutdown in background (seamless, user not
aware)
– Submits query plan directly to Tez Session

Native Hadoop service, not ad-hoc
© Hortonworks Inc. 2013.
Tez Delivers Interactive Query - Out of the Box!
Feature
Tez Session
Tez Container PreLaunch

Description
Overcomes Map-Reduce job-launch latency by prelaunching Tez AppMaster

Latency

Overcomes Map-Reduce latency by pre-launching
hot containers ready to serve queries.

Latency

Finished maps and reduces pick up more work
Tez Container Re-Use rather than exiting. Reduces latency and eliminates
difficult split-size tuning. Out of box performance!
Runtime reRuntime query tuning by picking aggregation
configuration of DAG parallelism using online query statistics
Tez In-Memory Cache Hot data kept in RAM for fast access.

Complex DAGs
© Hortonworks Inc. 2013.

Benefit

Tez Broadcast Edge and Map-Reduce-Reduce
pattern improve query scale and throughput.

Latency

Throughput

Latency

Throughput
Page 15
ORC File Format

HIVE-3874

• Columnar format for complex data types
• Built into Hive from 0.11
• Support for Pig and MapReduce via HCatalog
• Two levels of compression
–Lightweight type-specific and generic

• Built in indexes
–Every 10,000 rows with position information
–Min, Max, Sum, Count of each column
–Supports seek to row number

© Hortonworks Inc. 2013.

Page 16
ORC File Format
• Hive 0.12
–Predicate Push Down
–Improved run length encoding
–Adaptive string dictionaries
–Padding stripes to HDFS block boundaries

• Trunk
–Stripe-based Input Splits
–Input Split elimination
–Vectorized Reader
–Customized Pig Load and Store functions

© Hortonworks Inc. 2013.

Page 17
Vectorized Query Execution

HIVE-4160

• Designed for Modern Processor Architectures
–Avoid branching in the inner loop.
–Make the most use of L1 and L2 cache.

• How It Works
–Process records in batches of 1,000 rows
–Generate code from templates to minimize branching.

• What It Gives
–30x improvement in rows processed per second.
–Initial prototype: 100M rows/sec on laptop

© Hortonworks Inc. 2013.

Page 18
HDFS Buffer Cache
• Use memory mapped buffers for zero copy
–Avoid overhead of going through DataNode
–Can mlock the block files into RAM

• ORC Reader enhanced for zero-copy reads
–New compression interfaces in Hadoop

• Vectorization specific reader
–Read 1000 rows at a time
–Read into Hive’s internal representation

© Hortonworks Inc. 2013.
Cost-based optimization (Optiq)

HIVE-5775

• Optiq: Open source, Apache licensed query execution framework in Java
– Used by Apache Drill, Apache Cascade, Lucene DB, …
– Based on Volcano paper
– 20 man years dev, more than 50 optimization rules

• Goals for hive
– Ease of Use – no manual tuning for queries, make choices automatically based on cost
– View Chaining/Ad hoc queries involving multiple views
– Help enable BI Tools front-ending Hive
– Emphasis on latency reduction

• Cost computation will be used for
 Join ordering
 Join algorithm selection
 Tez vertex boundary selection

© Hortonworks Inc. 2013.

Page 20
How Stinger Phase 3 Delivers Interactive Query

Feature

Description

Benefit

Tez Integration

Tez is significantly better engine than MapReduce

Latency

Vectorized Query

Take advantage of modern hardware by processing
thousand-row blocks rather than row-at-a-time.

Throughput

Query Planner

ORC File

Using extensive statistics now available in Metastore
to better plan and optimize query, including
predicate pushdown during compilation to eliminate
portions of input (beyond partition pruning)

Latency

Columnar, type aware format with indices

Latency

Cost Based Optimizer Join re-ordering and other optimizations based on
(Optiq)
column statistics including histograms etc. (future)

© Hortonworks Inc. 2013.

Latency

Page 21
SCALE: Interactive Query at Petabyte Scale
Sustained Query Times

Smaller Footprint

Apache Hive 0.12 provides
sustained acceptable query
times even at petabyte scale

Better encoding with ORC in
Apache Hive 0.12 reduces resource
requirements for your cluster

File Size Comparison Across Encoding Methods
Dataset: TPC-DS Scale 500 Dataset

585 GB
(Original Size)

505 GB

Impala

(14% Smaller)

221 GB
(62% Smaller)

Hive 12

131 GB
(78% Smaller)

Encoded with

Encoded with

Encoded with

Encoded with

Text

RCFile

Parquet

ORCFile

© Hortonworks Inc. 2013.

• Larger Block Sizes
• Columnar format
arranges columns
adjacent within the
file for compression
& fast access
Stinger Phase 3: Interactive Query In Hadoop
Query 27: Pricing Analytics using Star Schema Join
Query 82: Inventory Analytics Joining 2 Large Fact Tables
1400s

190x
Improvement

3200s

200x
Improvement

65s
39s
14.9s

7.2s
TPC-DS Query 27

Hive 10

Hive 0.11 (Phase 1)

TPC-DS Query 82

Trunk (Phase 3)

All Results at Scale Factor 200 (Approximately 200GB Data)
© Hortonworks Inc. 2013.

Page 23
Speed: Delivering Interactive Query
Query Time in Seconds

Query 52: Star Schema Join
Query 55: Star Schema Join

41.1s

39.8s

4.2s
TPC-DS Query 52
Hive 0.12

Trunk (Phase 3)
© Hortonworks Inc. 2013.

4.1s
TPC-DS Query 55

Test Cluster:
• 200 GB Data (ORCFile)
• 20 Nodes, 24GB RAM each, 6x disk each
Speed: Delivering Interactive Query
Query Time in Seconds

Query 28: Vectorization
Query 12: Complex join (M-R-R pattern)

31s
22s

9.8s
TPC-DS Query 28
Hive 0.12

Trunk (Phase 3)
© Hortonworks Inc. 2013.

6.7s
TPC-DS Query 12

Test Cluster:
• 200 GB Data (ORCFile)
• 20 Nodes, 24GB RAM each, 6x disk each
Next Steps
• Blog
http://hortonworks.com/blog/delivering-on-stinger-a-phase-3-progress-update/

• Stinger Initiative
http://hortonworks.com/labs/stinger/

• Stinger Beta: HDP-2.1 Beta, December, 2013

© Hortonworks Inc. 2013.
Thank You!
gunther@apache.org
gunther@apache.org
@yakrobat
@hortonworks

© Hortonworks Inc. 2013. Confidential and Proprietary.

More Related Content

PDF
NYC HUG - Application Architectures with Apache Hadoop
markgrover
 
PPTX
Hadoop configuration & performance tuning
Vitthal Gogate
 
PPTX
De-Bugging Hive with Hadoop-in-the-Cloud
DataWorks Summit
 
PDF
Applications on Hadoop
markgrover
 
PPTX
Architecting Applications with Hadoop
markgrover
 
PDF
Strata Stinger Talk October 2013
alanfgates
 
PDF
Best Practices for Virtualizing Apache Hadoop
Hortonworks
 
PDF
Hortonworks.Cluster Config Guide
Douglas Bernardini
 
NYC HUG - Application Architectures with Apache Hadoop
markgrover
 
Hadoop configuration & performance tuning
Vitthal Gogate
 
De-Bugging Hive with Hadoop-in-the-Cloud
DataWorks Summit
 
Applications on Hadoop
markgrover
 
Architecting Applications with Hadoop
markgrover
 
Strata Stinger Talk October 2013
alanfgates
 
Best Practices for Virtualizing Apache Hadoop
Hortonworks
 
Hortonworks.Cluster Config Guide
Douglas Bernardini
 

What's hot (20)

PDF
Bikas saha:the next generation of hadoop– hadoop 2 and yarn
hdhappy001
 
PDF
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
PPTX
Evolving HDFS to a Generalized Distributed Storage Subsystem
DataWorks Summit/Hadoop Summit
 
PDF
Intro to Hadoop Presentation at Carnegie Mellon - Silicon Valley
markgrover
 
PPTX
Hive analytic workloads hadoop summit san jose 2014
alanfgates
 
PPTX
The Impala Cookbook
Cloudera, Inc.
 
PDF
Introduction to the Hadoop Ecosystem (IT-Stammtisch Darmstadt Edition)
Uwe Printz
 
PPTX
Hadoop Backup and Disaster Recovery
Cloudera, Inc.
 
PDF
Non-Stop Hadoop for Hortonworks
Hortonworks
 
PDF
Hadoop 2 - Beyond MapReduce
Uwe Printz
 
PDF
SQL Engines for Hadoop - The case for Impala
markgrover
 
PPTX
Apache Tez: Accelerating Hadoop Query Processing
DataWorks Summit
 
PPTX
Intro to Apache Kudu (short) - Big Data Application Meetup
Mike Percy
 
PPTX
A brave new world in mutable big data relational storage (Strata NYC 2017)
Todd Lipcon
 
PDF
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q3
tcloudcomputing-tw
 
PDF
Scale 12 x Efficient Multi-tenant Hadoop 2 Workloads with Yarn
David Kaiser
 
PPTX
Data Pipelines in Hadoop - SAP Meetup in Tel Aviv
larsgeorge
 
PPTX
Evolving HDFS to a Generalized Storage Subsystem
DataWorks Summit/Hadoop Summit
 
PDF
Introduction to Impala
markgrover
 
PDF
Hadoop Operations - Best practices from the field
Uwe Printz
 
Bikas saha:the next generation of hadoop– hadoop 2 and yarn
hdhappy001
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
Evolving HDFS to a Generalized Distributed Storage Subsystem
DataWorks Summit/Hadoop Summit
 
Intro to Hadoop Presentation at Carnegie Mellon - Silicon Valley
markgrover
 
Hive analytic workloads hadoop summit san jose 2014
alanfgates
 
The Impala Cookbook
Cloudera, Inc.
 
Introduction to the Hadoop Ecosystem (IT-Stammtisch Darmstadt Edition)
Uwe Printz
 
Hadoop Backup and Disaster Recovery
Cloudera, Inc.
 
Non-Stop Hadoop for Hortonworks
Hortonworks
 
Hadoop 2 - Beyond MapReduce
Uwe Printz
 
SQL Engines for Hadoop - The case for Impala
markgrover
 
Apache Tez: Accelerating Hadoop Query Processing
DataWorks Summit
 
Intro to Apache Kudu (short) - Big Data Application Meetup
Mike Percy
 
A brave new world in mutable big data relational storage (Strata NYC 2017)
Todd Lipcon
 
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q3
tcloudcomputing-tw
 
Scale 12 x Efficient Multi-tenant Hadoop 2 Workloads with Yarn
David Kaiser
 
Data Pipelines in Hadoop - SAP Meetup in Tel Aviv
larsgeorge
 
Evolving HDFS to a Generalized Storage Subsystem
DataWorks Summit/Hadoop Summit
 
Introduction to Impala
markgrover
 
Hadoop Operations - Best practices from the field
Uwe Printz
 
Ad

Viewers also liked (8)

PDF
Hive on spark berlin buzzwords
Szehon Ho
 
PDF
TriHUG Feb: Hive on spark
trihug
 
PDF
Hive join optimizations
Szehon Ho
 
PPTX
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
alanfgates
 
PPTX
Hadoop, Hive, Spark and Object Stores
Steve Loughran
 
PDF
Gluent New World #02 - SQL-on-Hadoop : A bit of History, Current State-of-the...
Mark Rittman
 
PPTX
Empower Hive with Spark
DataWorks Summit
 
PPTX
Hive on spark is blazing fast or is it final
Hortonworks
 
Hive on spark berlin buzzwords
Szehon Ho
 
TriHUG Feb: Hive on spark
trihug
 
Hive join optimizations
Szehon Ho
 
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
alanfgates
 
Hadoop, Hive, Spark and Object Stores
Steve Loughran
 
Gluent New World #02 - SQL-on-Hadoop : A bit of History, Current State-of-the...
Mark Rittman
 
Empower Hive with Spark
DataWorks Summit
 
Hive on spark is blazing fast or is it final
Hortonworks
 
Ad

Similar to Gunther hagleitner:apache hive & stinger (20)

PPTX
La big datacamp2014_vikram_dixit
Data Con LA
 
PPTX
Hadoop Demystified + MapReduce (Java and C#), Pig, and Hive Demos
Lester Martin
 
PDF
Overview of stinger interactive query for hive
David Kaiser
 
PPTX
Stinger Initiative - Deep Dive
Hortonworks
 
PPTX
Hive for Analytic Workloads
DataWorks Summit
 
PDF
Sept 17 2013 - THUG - HBase a Technical Introduction
Adam Muise
 
PPTX
Storage and-compute-hdfs-map reduce
Chris Nauroth
 
PDF
Apache Tez : Accelerating Hadoop Query Processing
Teddy Choi
 
PPTX
Apache Tez - A unifying Framework for Hadoop Data Processing
DataWorks Summit
 
PPTX
Stinger hadoop summit june 2013
alanfgates
 
PPTX
An In-Depth Look at Putting the Sting in Hive
DataWorks Summit
 
PPTX
YARN Ready: Integrating to YARN with Tez
Hortonworks
 
PDF
A Reference Architecture for ETL 2.0
DataWorks Summit
 
PPTX
Hortonworks.bdb
Emil Andreas Siemes
 
PPTX
Big Data Day LA 2015 - What's new and next in Apache Tez by Bikas Saha of Hor...
Data Con LA
 
PDF
April 2013 HUG: The Stinger Initiative - Making Apache Hive 100 Times Faster
Yahoo Developer Network
 
PPTX
Cloudera Impala - Las Vegas Big Data Meetup Nov 5th 2014
cdmaxime
 
PDF
What's New in Apache Hive 3.0?
DataWorks Summit
 
PDF
What's New in Apache Hive 3.0 - Tokyo
DataWorks Summit
 
PPTX
Apache Tez -- A modern processing engine
bigdatagurus_meetup
 
La big datacamp2014_vikram_dixit
Data Con LA
 
Hadoop Demystified + MapReduce (Java and C#), Pig, and Hive Demos
Lester Martin
 
Overview of stinger interactive query for hive
David Kaiser
 
Stinger Initiative - Deep Dive
Hortonworks
 
Hive for Analytic Workloads
DataWorks Summit
 
Sept 17 2013 - THUG - HBase a Technical Introduction
Adam Muise
 
Storage and-compute-hdfs-map reduce
Chris Nauroth
 
Apache Tez : Accelerating Hadoop Query Processing
Teddy Choi
 
Apache Tez - A unifying Framework for Hadoop Data Processing
DataWorks Summit
 
Stinger hadoop summit june 2013
alanfgates
 
An In-Depth Look at Putting the Sting in Hive
DataWorks Summit
 
YARN Ready: Integrating to YARN with Tez
Hortonworks
 
A Reference Architecture for ETL 2.0
DataWorks Summit
 
Hortonworks.bdb
Emil Andreas Siemes
 
Big Data Day LA 2015 - What's new and next in Apache Tez by Bikas Saha of Hor...
Data Con LA
 
April 2013 HUG: The Stinger Initiative - Making Apache Hive 100 Times Faster
Yahoo Developer Network
 
Cloudera Impala - Las Vegas Big Data Meetup Nov 5th 2014
cdmaxime
 
What's New in Apache Hive 3.0?
DataWorks Summit
 
What's New in Apache Hive 3.0 - Tokyo
DataWorks Summit
 
Apache Tez -- A modern processing engine
bigdatagurus_meetup
 

More from hdhappy001 (20)

PDF
詹剑锋:Big databench—benchmarking big data systems
hdhappy001
 
PDF
翟艳堂:腾讯大规模Hadoop集群实践
hdhappy001
 
PDF
袁晓如:大数据时代可视化和可视分析的机遇与挑战
hdhappy001
 
PDF
俞晨杰:Linked in大数据应用和azkaban
hdhappy001
 
PDF
杨少华:阿里开放数据处理服务
hdhappy001
 
PDF
薛伟:腾讯广点通——大数据之上的实时精准推荐
hdhappy001
 
PDF
徐萌:中国移动大数据应用实践
hdhappy001
 
PDF
肖永红:科研数据应用和共享方面的实践
hdhappy001
 
PDF
肖康:Storm在实时网络攻击检测和分析的应用与改进
hdhappy001
 
PDF
夏俊鸾:Spark——基于内存的下一代大数据分析框架
hdhappy001
 
PDF
魏凯:大数据商业利用的政策管制问题
hdhappy001
 
PDF
王涛:基于Cloudera impala的非关系型数据库sql执行引擎
hdhappy001
 
PDF
王峰:阿里搜索实时流计算技术
hdhappy001
 
PDF
钱卫宁:在线社交媒体分析型查询基准评测初探
hdhappy001
 
PDF
穆黎森:Interactive batch query at scale
hdhappy001
 
PDF
罗李:构建一个跨机房的Hadoop集群
hdhappy001
 
PDF
刘书良:基于大数据公共云平台的Dsp技术
hdhappy001
 
PDF
刘诚忠:Running cloudera impala on postgre sql
hdhappy001
 
PDF
刘昌钰:阿里大数据应用平台
hdhappy001
 
PDF
李战怀:大数据背景下分布式系统的数据一致性策略
hdhappy001
 
詹剑锋:Big databench—benchmarking big data systems
hdhappy001
 
翟艳堂:腾讯大规模Hadoop集群实践
hdhappy001
 
袁晓如:大数据时代可视化和可视分析的机遇与挑战
hdhappy001
 
俞晨杰:Linked in大数据应用和azkaban
hdhappy001
 
杨少华:阿里开放数据处理服务
hdhappy001
 
薛伟:腾讯广点通——大数据之上的实时精准推荐
hdhappy001
 
徐萌:中国移动大数据应用实践
hdhappy001
 
肖永红:科研数据应用和共享方面的实践
hdhappy001
 
肖康:Storm在实时网络攻击检测和分析的应用与改进
hdhappy001
 
夏俊鸾:Spark——基于内存的下一代大数据分析框架
hdhappy001
 
魏凯:大数据商业利用的政策管制问题
hdhappy001
 
王涛:基于Cloudera impala的非关系型数据库sql执行引擎
hdhappy001
 
王峰:阿里搜索实时流计算技术
hdhappy001
 
钱卫宁:在线社交媒体分析型查询基准评测初探
hdhappy001
 
穆黎森:Interactive batch query at scale
hdhappy001
 
罗李:构建一个跨机房的Hadoop集群
hdhappy001
 
刘书良:基于大数据公共云平台的Dsp技术
hdhappy001
 
刘诚忠:Running cloudera impala on postgre sql
hdhappy001
 
刘昌钰:阿里大数据应用平台
hdhappy001
 
李战怀:大数据背景下分布式系统的数据一致性策略
hdhappy001
 

Recently uploaded (20)

PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
The Future of Artificial Intelligence (AI)
Mukul
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 

Gunther hagleitner:apache hive & stinger

  • 1. Apache Hive & Stinger Petabyte-scale SQL in Hadoop Gunther Hagleitner ([email protected]) © Hortonworks Inc. 2013.
  • 2. Batch AND Interactive SQL-IN-Hadoop Stinger Initiative A broad, community-based effort to drive the next generation of HIVE Stinger Project (announced February 2013) Hive 0.11, May 2013: • Base Optimizations • SQL Analytic Functions • ORCFile, Modern File Format Goals: Speed Improve Hive query performance by 100X to allow for interactive query times (seconds) Scale The only SQL interface to Hadoop designed for queries that scale from TB to PB Hive 0.12, October 2013: • • • • VARCHAR, DATE Types ORCFile predicate pushdown Advanced Optimizations Performance Boosts via YARN Coming Soon: SQL Support broadest range of SQL semantics for analytic applications running against Hadoop …all IN Hadoop © Hortonworks Inc. 2013. • • • • • Hive on Apache Tez Query Service Buffer Cache Cost Based Optimizer (Optiq) Vectorized Processing
  • 3. Hive 0.12 Hive 0.12 Release Theme Speed, Scale and SQL Specific Features • • • • • • • Included Components © Hortonworks Inc. 2013. 10x faster query launch when using large number (500+) of partitions ORC File predicate pushdown speeds queries Evaluate LIMIT on the map side Parallel ORDER BY New query optimizer Introduces VARCHAR and DATE data types GROUP BY on structs or unions Apache Hive 0.12
  • 4. SQL: Enhancing SQL Semantics Hive SQL Datatypes Hive SQL Semantics SQL Compliance INT SELECT, INSERT TINYINT/SMALLINT/BIGINT GROUP BY, ORDER BY, SORT BY BOOLEAN JOIN on explicit join key FLOAT Inner, outer, cross and semi joins DOUBLE Sub-queries in FROM clause Hive 12 provides a wide array of SQL data types and semantics so your existing tools integrate more seamlessly with Hadoop STRING ROLLUP and CUBE TIMESTAMP UNION BINARY Windowing Functions (OVER, RANK, etc) DECIMAL Custom Java UDFs ARRAY, MAP, STRUCT, UNION Standard Aggregation (SUM, AVG, etc.) DATE Advanced UDFs (ngram, Xpath, URL) VARCHAR Sub-queries in WHERE, HAVING CHAR Expanded JOIN Syntax SQL Compliant Security (GRANT, etc.) INSERT/UPDATE/DELETE (ACID) © Hortonworks Inc. 2013. Available Hive 0.12 Roadmap
  • 5. Insert, Update and Delete (ACID) HIVE-5317 • Additional SQL statements: • • • • • • INSERT INTO table SELECT … INSERT INTO table VALUES … UPDATE table SET … WHERE … DELETE FROM table WHERE … MERGE INTO table … BEGIN/END TRANSACTION © Hortonworks Inc. 2013. Page 5
  • 6. Insert, Update and Delete © Hortonworks Inc. 2013. Page 6
  • 7. SQL Compliant security HIVE-5317 • Hive user has access to HDFS files • Manages fine grained access via standard: – Users and roles –Privileges (insert, select, update, delete, all) –Objects (tables, views) –Grant/Revoke/Show statements to administrate • Special roles • PUBLIC – all users belong to this role • SUPERUSER – privilege to create/drop role, grant access, … • Trusted UDFs • Pluggable sources for user to role mapping. • E.g.: HDFS groups © Hortonworks Inc. 2013. Page 7
  • 8. Extended sub-query support • Sub-queries in where/having clause • (NOT) IN/EXISTS • Transformation at a high level are: • In/Exists => Left outer join • Not In/Exists => Left outer join + null check • Correlation converted to “group by” in sub-query • Will work only if query can be flattened • No “brute force” of sub-query © Hortonworks Inc. 2013. HIVE-784 Example: select o_orderpriority, count(*) from orders o where o_orderdate >= ’2013-01-01’ and exists ( select * from lineitem where l_orderkey = o.o_orderkey and l_commitdate < l_receiptdate ) group by o_orderpriority order by o_orderpriority;
  • 9. HIVE-784 Alternate join syntax • Allows for ‘comma separated’ join syntax • Easier to use • Facilitates integration with tools • Important aspect is correct push down of predicates • Cross product is very expensive • Conditions need to be pushed as close to the table source as possible © Hortonworks Inc. 2013. Example: select o_orderpriority, count(*) from orders, lineitem where o_orderdate >= ’2013-01-01’ and l_orderkey = o_orderkey and l_commitdate < l_receiptdate group by o_orderpriority order by o_orderpriority;
  • 10. YARN: Taking Hadoop Beyond Batch Store ALL DATA in one place… Interact with that data in MULTIPLE WAYS with Predictable Performance and Quality of Service Applications Run Natively IN Hadoop BATCH INTERACTIVE (MapReduce) (Tez) ONLINE (HBase) STREAMING (Storm, S4,…) GRAPH (Giraph) IN-MEMORY (Spark) HPC MPI (OpenMPI) OTHER (Search) (Weave…) YARN (Cluster Resource Management) HDFS2 (Redundant, Reliable Storage) © Hortonworks Inc. 2013. Page 10
  • 11. Apache Tez (“Speed”) • Replaces MapReduce as primitive for Pig, Hive, Cascading etc. – Smaller latency for interactive queries – Higher throughput for batch queries – 22 contributors: Hortonworks (13), Facebook, Twitter, Yahoo, Microsoft Task with pluggable Input, Processor and Output Input Processor Output Task Tez Task - <Input, Processor, Output> YARN ApplicationMaster to run DAG of Tez Tasks © Hortonworks Inc. 2013.
  • 12. Tez: Building blocks for scalable data processing Classical ‘Map’ HDFS Input Map Processor Classical ‘Reduce’ Sorted Output Shuffle Input Shuffle Input Reduce Processor Sorted Output Intermediate ‘Reduce’ for Map-Reduce-Reduce © Hortonworks Inc. 2013. Reduce Processor HDFS Output
  • 13. HIVE-4660 Hive-on-MR vs. Hive-on-Tez SELECT g1.x, g1.avg, g2.cnt FROM (SELECT a.x, AVERAGE(a.y) AS avg FROM a GROUP BY a.x) g1 JOIN (SELECT b.x, COUNT(b.y) AS avg FROM b GROUP BY b.x) g2 ON (g1.x = g2.x) ORDER BY avg; Hive – MR M M Hive – Tez GROUP b BY b.x M M GROUP a BY a.x R Tez avoids unnecessary writes to HDFS GROUP BY x M M R M M M R R HDFS JOIN (a,b) HDFS M GROUP BY a.x JOIN (a,b) R M R R ORDER BY HDFS M ORDER BY R © Hortonworks Inc. 2013. R M
  • 14. Tez Sessions … because Map/Reduce query startup is expensive • Tez Sessions – Hot containers ready for immediate use – Removes task and job launch overhead (~5s – 30s) • Hive – Session launch/shutdown in background (seamless, user not aware) – Submits query plan directly to Tez Session Native Hadoop service, not ad-hoc © Hortonworks Inc. 2013.
  • 15. Tez Delivers Interactive Query - Out of the Box! Feature Tez Session Tez Container PreLaunch Description Overcomes Map-Reduce job-launch latency by prelaunching Tez AppMaster Latency Overcomes Map-Reduce latency by pre-launching hot containers ready to serve queries. Latency Finished maps and reduces pick up more work Tez Container Re-Use rather than exiting. Reduces latency and eliminates difficult split-size tuning. Out of box performance! Runtime reRuntime query tuning by picking aggregation configuration of DAG parallelism using online query statistics Tez In-Memory Cache Hot data kept in RAM for fast access. Complex DAGs © Hortonworks Inc. 2013. Benefit Tez Broadcast Edge and Map-Reduce-Reduce pattern improve query scale and throughput. Latency Throughput Latency Throughput Page 15
  • 16. ORC File Format HIVE-3874 • Columnar format for complex data types • Built into Hive from 0.11 • Support for Pig and MapReduce via HCatalog • Two levels of compression –Lightweight type-specific and generic • Built in indexes –Every 10,000 rows with position information –Min, Max, Sum, Count of each column –Supports seek to row number © Hortonworks Inc. 2013. Page 16
  • 17. ORC File Format • Hive 0.12 –Predicate Push Down –Improved run length encoding –Adaptive string dictionaries –Padding stripes to HDFS block boundaries • Trunk –Stripe-based Input Splits –Input Split elimination –Vectorized Reader –Customized Pig Load and Store functions © Hortonworks Inc. 2013. Page 17
  • 18. Vectorized Query Execution HIVE-4160 • Designed for Modern Processor Architectures –Avoid branching in the inner loop. –Make the most use of L1 and L2 cache. • How It Works –Process records in batches of 1,000 rows –Generate code from templates to minimize branching. • What It Gives –30x improvement in rows processed per second. –Initial prototype: 100M rows/sec on laptop © Hortonworks Inc. 2013. Page 18
  • 19. HDFS Buffer Cache • Use memory mapped buffers for zero copy –Avoid overhead of going through DataNode –Can mlock the block files into RAM • ORC Reader enhanced for zero-copy reads –New compression interfaces in Hadoop • Vectorization specific reader –Read 1000 rows at a time –Read into Hive’s internal representation © Hortonworks Inc. 2013.
  • 20. Cost-based optimization (Optiq) HIVE-5775 • Optiq: Open source, Apache licensed query execution framework in Java – Used by Apache Drill, Apache Cascade, Lucene DB, … – Based on Volcano paper – 20 man years dev, more than 50 optimization rules • Goals for hive – Ease of Use – no manual tuning for queries, make choices automatically based on cost – View Chaining/Ad hoc queries involving multiple views – Help enable BI Tools front-ending Hive – Emphasis on latency reduction • Cost computation will be used for  Join ordering  Join algorithm selection  Tez vertex boundary selection © Hortonworks Inc. 2013. Page 20
  • 21. How Stinger Phase 3 Delivers Interactive Query Feature Description Benefit Tez Integration Tez is significantly better engine than MapReduce Latency Vectorized Query Take advantage of modern hardware by processing thousand-row blocks rather than row-at-a-time. Throughput Query Planner ORC File Using extensive statistics now available in Metastore to better plan and optimize query, including predicate pushdown during compilation to eliminate portions of input (beyond partition pruning) Latency Columnar, type aware format with indices Latency Cost Based Optimizer Join re-ordering and other optimizations based on (Optiq) column statistics including histograms etc. (future) © Hortonworks Inc. 2013. Latency Page 21
  • 22. SCALE: Interactive Query at Petabyte Scale Sustained Query Times Smaller Footprint Apache Hive 0.12 provides sustained acceptable query times even at petabyte scale Better encoding with ORC in Apache Hive 0.12 reduces resource requirements for your cluster File Size Comparison Across Encoding Methods Dataset: TPC-DS Scale 500 Dataset 585 GB (Original Size) 505 GB Impala (14% Smaller) 221 GB (62% Smaller) Hive 12 131 GB (78% Smaller) Encoded with Encoded with Encoded with Encoded with Text RCFile Parquet ORCFile © Hortonworks Inc. 2013. • Larger Block Sizes • Columnar format arranges columns adjacent within the file for compression & fast access
  • 23. Stinger Phase 3: Interactive Query In Hadoop Query 27: Pricing Analytics using Star Schema Join Query 82: Inventory Analytics Joining 2 Large Fact Tables 1400s 190x Improvement 3200s 200x Improvement 65s 39s 14.9s 7.2s TPC-DS Query 27 Hive 10 Hive 0.11 (Phase 1) TPC-DS Query 82 Trunk (Phase 3) All Results at Scale Factor 200 (Approximately 200GB Data) © Hortonworks Inc. 2013. Page 23
  • 24. Speed: Delivering Interactive Query Query Time in Seconds Query 52: Star Schema Join Query 55: Star Schema Join 41.1s 39.8s 4.2s TPC-DS Query 52 Hive 0.12 Trunk (Phase 3) © Hortonworks Inc. 2013. 4.1s TPC-DS Query 55 Test Cluster: • 200 GB Data (ORCFile) • 20 Nodes, 24GB RAM each, 6x disk each
  • 25. Speed: Delivering Interactive Query Query Time in Seconds Query 28: Vectorization Query 12: Complex join (M-R-R pattern) 31s 22s 9.8s TPC-DS Query 28 Hive 0.12 Trunk (Phase 3) © Hortonworks Inc. 2013. 6.7s TPC-DS Query 12 Test Cluster: • 200 GB Data (ORCFile) • 20 Nodes, 24GB RAM each, 6x disk each
  • 26. Next Steps • Blog http://hortonworks.com/blog/delivering-on-stinger-a-phase-3-progress-update/ • Stinger Initiative http://hortonworks.com/labs/stinger/ • Stinger Beta: HDP-2.1 Beta, December, 2013 © Hortonworks Inc. 2013.