© Hortonworks Inc. 2013. Putting the Sting in Hive Alan Gates

Slides:



Advertisements
Similar presentations
Shark:SQL and Rich Analytics at Scale
Advertisements

Shark Hive SQL on Spark Michael Armbrust.
Pig Optimization and Execution Page 1 Alan F. © Hortonworks Inc
HDFS & MapReduce Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer.
CS525: Special Topics in DBs Large-Scale Data Management MapReduce High-Level Langauges Spring 2013 WPI, Mohamed Eltabakh 1.
LIBRA: Lightweight Data Skew Mitigation in MapReduce
MapReduce Online Created by: Rajesh Gadipuuri Modified by: Ying Lu.
© Hortonworks Inc Daniel Dai Thejas Nair Page 1 Making Pig Fly Optimizing Data Processing on Hadoop.
BigData Tools Seyyed mohammad Razavi. Outline  Introduction  Hbase  Cassandra  Spark  Acumulo  Blur  MongoDB  Hive  Giraph  Pig.
Reynold Xin Shark: Hive (SQL) on Spark. Stage 0: Map-Shuffle-Reduce Mapper(row) { fields = row.split("\t") emit(fields[0], fields[1]); } Reducer(key,
Shark Cliff Engle, Antonio Lupher, Reynold Xin, Matei Zaharia, Michael Franklin, Ion Stoica, Scott Shenker Hive on Spark.
Clydesdale: Structured Data Processing on MapReduce Jackie.
Hive: A data warehouse on Hadoop
Putting the Sting in Hive Page 1 Alan F.
Hadoop tutorials. Todays agenda Hadoop Introduction and Architecture Hadoop Distributed File System MapReduce Spark 2.
© Hortonworks Inc Stinger Initiative: Deep Dive Interactive Query on Hadoop Page 1 Chris Harris Twitter : cj_harris5.
PARALLEL DBMS VS MAP REDUCE “MapReduce and parallel DBMSs: friends or foes?” Stonebraker, Daniel Abadi, David J Dewitt et al.
CS525: Big Data Analytics MapReduce Languages Fall 2013 Elke A. Rundensteiner 1.
Raghav Ayyamani. Copyright Ellis Horowitz, Why Another Data Warehousing System? Problem : Data, data and more data Several TBs of data everyday.
Hive – A Warehousing Solution Over a Map-Reduce Framework Presented by: Atul Bohara Feb 18, 2014.
Megabytes Gigabytes Terabytes Petabytes Purchase detail Purchase record Payment record Purchase detail Purchase record Payment record ERP CRM.
Megabytes Gigabytes Terabytes Petabytes Purchase detail Purchase record Payment record Purchase detail Purchase record Payment record ERP CRM.
Take An Internal Look at Hadoop Hairong Kuang Grid Team, Yahoo! Inc
Hive: A data warehouse on Hadoop Based on Facebook Team’s paperon Facebook Team’s paper 8/18/20151.
HADOOP ADMIN: Session -2
Hadoop & Cheetah. Key words Cluster  data center – Lots of machines thousands Node  a server in a data center – Commodity device fails very easily Slot.
Data Mining on the Web via Cloud Computing COMS E6125 Web Enhanced Information Management Presented By Hemanth Murthy.
USING HADOOP & HBASE TO BUILD CONTENT RELEVANCE & PERSONALIZATION Tools to build your big data application Ameya Kanitkar.
HBase A column-centered database 1. Overview An Apache project Influenced by Google’s BigTable Built on Hadoop ▫A distributed file system ▫Supports Map-Reduce.
Whirlwind tour of Hadoop Inspired by Google's GFS Clusters from systems Batch Processing High Throughput Partition-able problems Fault Tolerance.
Presented by CH.Anusha.  Apache Hadoop framework  HDFS and MapReduce  Hadoop distributed file system  JobTracker and TaskTracker  Apache Hadoop NextGen.
Our Experience Running YARN at Scale Bobby Evans.
Introduction to Hadoop and HDFS
Contents HADOOP INTRODUCTION AND CONCEPTUAL OVERVIEW TERMINOLOGY QUICK TOUR OF CLOUDERA MANAGER.
Whirlwind Tour of Hadoop Edward Capriolo Rev 2. Whirlwind tour of Hadoop Inspired by Google's GFS Clusters from systems Batch Processing High.
MapReduce High-Level Languages Spring 2014 WPI, Mohamed Eltabakh 1.
An Introduction to HDInsight June 27 th,
© Hortonworks Inc MR / Tez Query Comparison Page 1 HW = 20 Node (48 GB RAM, 6x disk) SW = Hive Trunk (Nov ) + ORCFile + Vectorization Hive.
Harp: Collective Communication on Hadoop Bingjing Zhang, Yang Ruan, Judy Qiu.
Grid Computing at Yahoo! Sameer Paranjpye Mahadev Konar Yahoo!
Introduction to Hbase. Agenda  What is Hbase  About RDBMS  Overview of Hbase  Why Hbase instead of RDBMS  Architecture of Hbase  Hbase interface.
© Hortonworks Inc Hadoop: Beyond MapReduce Steve Loughran, Big Data workshop, June 2013.
ApproxHadoop Bringing Approximations to MapReduce Frameworks
Impala. Impala: Goals General-purpose SQL query engine for Hadoop High performance – C++ implementation – runtime code generation (using LLVM) – direct.
Page 1 © Hortonworks Inc – All Rights Reserved Hive: Data Organization for Performance Gopal Vijayaraghavan.
Cloudera Kudu Introduction
Scalable data access with Impala Zbigniew Baranowski Maciej Grzybek Daniel Lanza Garcia Kacper Surdy.
Cloud Distributed Computing Environment Hadoop. Hadoop is an open-source software system that provides a distributed computing environment on cloud (data.
1 HBASE – THE SCALABLE DATA STORE An Introduction to HBase XLDB Europe Workshop 2013: CERN, Geneva James Kinley EMEA Solutions Architect, Cloudera.
Learn. Hadoop Online training course is designed to enhance your knowledge and skills to become a successful Hadoop developer and In-depth knowledge of.
BlinkDB: Queries with Bounded Errors and Bounded Response Times on Very Large Data Authored by Sameer Agarwal, et. al. Presented by Atul Sandur.
Apache Tez : Accelerating Hadoop Query Processing Page 1.
1 Gaurav Kohli Xebia Breaking with DBMS and Dating with Relational Hbase.
Hadoop Introduction. Audience Introduction of students – Name – Years of experience – Background – Do you know Java? – Do you know linux? – Any exposure.
Image taken from: slideshare
Mail call Us: / / Hadoop Training Sathya technologies is one of the best Software Training Institute.
Hive+Tez: A Performance deep dive
Hadoop.
INTRODUCTION TO PIG, HIVE, HBASE and ZOOKEEPER
Spark Presentation.
Hive on steroid Project stinger.
Apache Spark Resilient Distributed Datasets: A Fault-Tolerant Abstraction for In-Memory Cluster Computing Aditya Waghaye October 3, 2016 CS848 – University.
Lab #2 - Create a movies dataset
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
Introduction to PIG, HIVE, HBASE & ZOOKEEPER
Overview of big data tools
Charles Tappert Seidenberg School of CSIS, Pace University
Cloud Computing for Data Analysis Pig|Hive|Hbase|Zookeeper
Presentation transcript:

© Hortonworks Inc Putting the Sting in Hive Alan Gates

© Hortonworks Inc YARN: Taking Hadoop Beyond Batch Page 2 Applications Run Natively IN Hadoop HDFS2 (Redundant, Reliable Storage) YARN (Cluster Resource Management) BATCH (MapReduce) INTERACTIVE (Tez) STREAMING (Storm, S4,…) GRAPH (Giraph) IN-MEMORY (Spark) HPC MPI (OpenMPI) ONLINE (HBase) OTHER (Search) (Weave…) Store ALL DATA in one place… Interact with that data in MULTIPLE WAYS with Predictable Performance and Quality of Service

© Hortonworks Inc Hadoop Beyond Batch with YARN HADOOP 1 HDFS (redundant, reliable storage) MapReduce (cluster resource management & data processing) HDFS2 (redundant, reliable storage) YARN (operating system: cluster resource management) MapReduce (batch) Others (varied) HADOOP 2 Single Use System Batch Apps Multi Use Data Platform Batch, Interactive, Online, Streaming, … Tez (interactive) A shift from the old to the new…

© Hortonworks Inc 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 YARN ApplicationMaster to run DAG of Tez Tasks Task with pluggable Input, Processor and Output Tez Task - Task Processor InputOutput

© Hortonworks Inc Tez: Building blocks for scalable data processing Classical ‘Map’Classical ‘Reduce’ Intermediate ‘Reduce’ for Map-Reduce-Reduce Map Processor HDFS Input Sorted Output Reduce Processor Shuffle Input HDFS Output Reduce Processor Shuffle Input Sorted Output

© Hortonworks Inc Hive – MRHive – Tez Hive-on-MR vs. Hive-on-Tez SELECT a.x, AVERAGE(b.y) AS avg FROM a JOIN b ON (a.id = b.id) GROUP BY a UNION SELECT x, AVERAGE(y) AS AVG FROM c GROUP BY x ORDER BY AVG; SELECT a.state JOIN (a, c) SELECT c.price SELECT b.id JOIN(a, b) GROUP BY a.state COUNT(*) AVERAGE(c.price) MMM R R MM R MM R M M R HDFS MMM R R R MM R R SELECT a.state, c.itemId JOIN (a, c) JOIN(a, b) GROUP BY a.state COUNT(*) AVERAGE(c.price) SELECT b.id Tez avoids unneeded writes to HDFS

© Hortonworks Inc 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 Tez Delivers Interactive Query - Out of the Box! Page 8 FeatureDescriptionBenefit Tez Session Overcomes Map-Reduce job-launch latency by pre- launching Tez AppMaster Latency Tez Container Pre- Launch Overcomes Map-Reduce latency by pre-launching hot containers ready to serve queries. Latency Tez Container Re-Use Finished maps and reduces pick up more work rather than exiting. Reduces latency and eliminates difficult split-size tuning. Out of box performance! Latency Runtime re- configuration of DAG Runtime query tuning by picking aggregation parallelism using online query statistics Throughput Tez In-Memory CacheHot data kept in RAM for fast access.Latency Complex DAGs Tez Broadcast Edge and Map-Reduce-Reduce pattern improve query scale and throughput. Throughput

© Hortonworks Inc Stinger Project (announced February 2013) Batch AND Interactive SQL-IN-Hadoop Stinger Initiative A broad, community-based effort to drive the next generation of HIVE Coming Soon: Hive on Apache Tez Query Service Buffer Cache Cost Based Optimizer (Optiq) Vectorized Processing Hive 0.11, May 2013: Base Optimizations SQL Analytic Functions ORCFile, Modern File Format Hive 0.12, October 2013: VARCHAR, DATE Types ORCFile predicate pushdown Advanced Optimizations Performance Boosts via YARN 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 SQL Support broadest range of SQL semantics for analytic applications running against Hadoop …all IN Hadoop Goals:

© Hortonworks Inc Hive 0.12 Release ThemeSpeed, Scale and SQL Specific Features10x faster query launch when using large number (500+) of partitions ORCFile predicate pushdown speeds queries Evaluate LIMIT on the map side Parallel ORDER BY New query optimizer Introduces VARCHAR and DATE datatypes GROUP BY on structs or unions Included Components Apache Hive 0.12

© Hortonworks Inc SQL: Enhancing SQL Semantics Hive SQL DatatypesHive SQL Semantics INTSELECT, INSERT TINYINT/SMALLINT/BIGINTGROUP BY, ORDER BY, SORT BY BOOLEANJOIN on explicit join key FLOATInner, outer, cross and semi joins DOUBLESub-queries in FROM clause STRINGROLLUP and CUBE TIMESTAMPUNION BINARYWindowing Functions (OVER, RANK, etc) DECIMALCustom Java UDFs ARRAY, MAP, STRUCT, UNIONStandard Aggregation (SUM, AVG, etc.) DATEAdvanced UDFs (ngram, Xpath, URL) VARCHARSub-queries in WHERE, HAVING CHARExpanded JOIN Syntax SQL Compliant Security (GRANT, etc.) INSERT/UPDATE/DELETE (ACID) Hive 0.12 Available Roadmap SQL Compliance Hive 12 provides a wide array of SQL datatypes and semantics so your existing tools integrate more seamlessly with Hadoop

© Hortonworks Inc Stinger Phase 3: Interactive Query In Hadoop Page 12 Hive 10Trunk (Phase 3) Hive 0.11 (Phase 1) 190x Improvement 1400s 39s 7.2s TPC-DS Query s 65s 14.9s TPC-DS Query x Improvement Query 27: Pricing Analytics using Star Schema Join Query 82: Inventory Analytics Joining 2 Large Fact Tables All Results at Scale Factor 200 (Approximately 200GB Data)

© Hortonworks Inc s 4.2s 39.8s 4.1s TPC-DS Query 52 TPC-DS Query 55 Query Time in Seconds Speed: Delivering Interactive Query Test Cluster: 200 GB Data (ORCFile) 20 Nodes, 24GB RAM each, 6x disk each Hive 0.12 Trunk (Phase 3) Query 52: Star Schema Join Query 5: Star Schema Join

© Hortonworks Inc s 9.8s 31s 6.7s TPC-DS Query 28 TPC-DS Query 12 Query Time in Seconds Speed: Delivering Interactive Query Test Cluster: 200 GB Data (ORCFile) 20 Nodes, 24GB RAM each, 6x disk each Hive 0.12 Trunk (Phase 3) Query 28: Vectorization Query 12: Complex join (M-R-R pattern)

© Hortonworks Inc How Stinger Phase 3 Delivers Interactive Query Page 15 FeatureDescriptionBenefit Tez IntegrationTez is significantly better engine than MapReduceLatency Vectorized Query Take advantage of modern hardware by processing thousand-row blocks rather than row-at-a-time. Throughput Query Planner 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 ORC FileColumnar, type aware format with indicesLatency Cost Based Optimizer (Optiq) Join re-ordering and other optimizations based on column statistics including histograms etc. (future) Latency

© Hortonworks Inc ORC File Format Columnar format for complex data types Built into Hive from 0.11 Support for Pig and MapReduce via HCat 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 Page 16

© Hortonworks Inc SCALE: Interactive Query at Petabyte Scale Sustained Query Times Apache Hive 0.12 provides sustained acceptable query times even at petabyte scale 131 GB (78% Smaller) File Size Comparison Across Encoding Methods Dataset: TPC-DS Scale 500 Dataset 221 GB (62% Smaller) Encoded with Text Encoded with RCFile Encoded with ORCFile Encoded with Parquet 505 GB (14% Smaller) 585 GB (Original Size) Larger Block Sizes Columnar format arranges columns adjacent within the file for compression & fast access Impala Hive 12 Smaller Footprint Better encoding with ORC in Apache Hive 0.12 reduces resource requirements for your cluster

© Hortonworks Inc 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 Page 18

© Hortonworks Inc Vectorized Query Execution 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 Page 19

© Hortonworks Inc 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 Next Steps Blog Stinger Initiative Stinger Beta: HDP-2.1 Beta, December, 2013

© Hortonworks Inc Confidential and Proprietary.