Zhenxiao Luo
Software Engineer @ Uber
Even Faster:
When Presto Meets Parquet
@ Uber
Mission
Uber Business Highlights
Analytics Infrastructure @ Uber
Presto
Interactive SQL engine for Big Data
Parquet
Columnar Storage for Big Data
Parquet Optimizations for Presto
Ongoing Work
Agenda
Transportation as reliable as running water, everywhere, for everyone
Uber Mission
Uber Stats
6
Continents
73
Countries
450
Cities
12,000
Employees
10+ Million
Avg. Trips/Day
40+ Million
MAU Riders
1.5+ Million
MAU Drivers
Kafka
Analytics Infrastructure @ Uber
Schemaless
MySQL,
Postgres
Vertica
Streamio
Raw
Data
Raw
Tables
Sqoop
Reports
Hadoop
Hive Presto Spark
Notebook Ad Hoc Queries
Real Time
Applications
Machine
Learning Jobs
Business
Intelligence Jobs
Cluster
Management
All-Active
Observability
Security
Vertica
Samza
Pinot
Flink
MemSQL
Modeled
Tables
Streaming
Warehouse
Real-time
Parquet @ Uber
Raw Tables
â—Ź No preprocessing
â—Ź Highly nested
â—Ź ~30 minutes ingestion latency
â—Ź Huge tables
Modeled Tables
â—Ź Preprocessing via Hive ETL
â—Ź Flattened
â—Ź ~12 hours ingestion latency
Scale of Presto @ Uber
â—Ź 2 clusters
â—‹ Application cluster
â–  Hundreds of machines
â–  100K queries per day
â–  P90: 30s
â—‹ Ad hoc cluster
â–  Hundreds of machines
â–  20K queries per day
â–  P90: 60s
â—Ź Access to both raw and model tables
â—‹ 5 petabytes of data
â—Ź Total 120K+ queries per day
â—Ź Marketplace pricing
â—‹ Real-time driver incentives
â—Ź Communication platform
â—‹ Driver quality and action platform
â—‹ Rider/driver cohorting
â—‹ Ops, comms, & marketing
â—Ź Growth marketing
â—‹ BI dashboard for growth marketing
â—Ź Data science
â—‹ Exploratory analytics using notebooks
â—Ź Data quality
â—‹ Freshness and quality check
â—Ź Ad hoc queries
Applications of Presto @ Uber
What is Presto: Interactive SQL Engine for Big Data
Interactive query speeds
Horizontally scalable
ANSI SQL
Battle-tested by Facebook, Uber, & Netflix
Completely open source
Access to petabytes of data in the Hadoop data lake
How Presto Works
Why Presto is Fast
â—Ź Data in memory during execution
â—Ź Pipelining and streaming
â—Ź Columnar storage & execution
â—Ź Bytecode generation
â—‹ Inline virtual function calls
â—‹ Inline constants
â—‹ Rewrite inner loops
â—‹ Rewrite type-specific branches
Resource Management
â—Ź Presto has its own resource manager
â—‹ Not on YARN
â—‹ Not on Mesos
â—Ź CPU Management
â—‹ Priority queues
â—‹ Short running queries higher priority
â—Ź Memory Management
â—‹ Max memory per query per node
â—‹ If query exceeds max memory limit, query fails
â—‹ No OutOfMemory in Presto process
Limitations
â—Ź No fault tolerance
â—Ź Joins do not fit in memory
â—‹ Query fails
â—‹ No OutOfMemory in Presto process
â—‹ Try it on Hive
â—Ź Coordinator is a single point of failure
No Need to Copy Data: Presto Connectors
Parquet: Columnar Storage for Big Data
Parquet Optimizations for Presto
Example Query:
SELECT base.driver_uuid
FROM hdrone.mezzanine_trips
WHERE datestr = '2017-03-02' AND base.city_id in (12)
Data:
â—Ź Up to 15 levels of Nesting
â—Ź Up to 80 fields inside each Struct
â—Ź Fields are added/deleted/updated inside Struct
Old Parquet Reader
Nested Column Pruning
Columnar Reads
Predicate Pushdown
Dictionary Pushdown
Lazy Reads
Benchmarking Results
Presto Ongoing Work
â—Ź GeoSpatial query optimization
â—Ź Presto Elasticsearch Connector
â—Ź Multi-tenancy Support
â—Ź All Active Presto Cross Data Centers
â—Ź Authentication and Authorization
â—Ź High Available Coordinator
Hadoop Infrastructure & Analytics
â—Ź HDFS Erasure Encoding
â—Ź HDFS Tiered Storage
â—Ź All Active Hadoop Cross Data Centers
â—Ź Hive On Spark
â—Ź Spark
â—Ź Data Visualization
Thank you
Proprietary and confidential © 2016 Uber Technologies, Inc. All rights reserved. No part of this document may be
reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any
information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the
use of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise
exempt from disclosure under applicable law. All recipients of this document are notified that the information contained
herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any
way disclose this document or any of the enclosed information to any person other than employees of addressee to the
extent necessary for consultations with authorized personnel of Uber.
We are Hiring
https://www.uber.com/careers/list/27366/
Send resumes to:
abhik@uber.com or luoz@uber.com
Interested in learning more about Uber Eng?
Eng.uber.com
Follow us on Twitter:
@UberEng

Presto @ Uber Hadoop summit2017

  • 1.
    Zhenxiao Luo Software Engineer@ Uber Even Faster: When Presto Meets Parquet @ Uber
  • 2.
    Mission Uber Business Highlights AnalyticsInfrastructure @ Uber Presto Interactive SQL engine for Big Data Parquet Columnar Storage for Big Data Parquet Optimizations for Presto Ongoing Work Agenda
  • 3.
    Transportation as reliableas running water, everywhere, for everyone Uber Mission
  • 4.
    Uber Stats 6 Continents 73 Countries 450 Cities 12,000 Employees 10+ Million Avg.Trips/Day 40+ Million MAU Riders 1.5+ Million MAU Drivers
  • 5.
    Kafka Analytics Infrastructure @Uber Schemaless MySQL, Postgres Vertica Streamio Raw Data Raw Tables Sqoop Reports Hadoop Hive Presto Spark Notebook Ad Hoc Queries Real Time Applications Machine Learning Jobs Business Intelligence Jobs Cluster Management All-Active Observability Security Vertica Samza Pinot Flink MemSQL Modeled Tables Streaming Warehouse Real-time
  • 6.
    Parquet @ Uber RawTables â—Ź No preprocessing â—Ź Highly nested â—Ź ~30 minutes ingestion latency â—Ź Huge tables Modeled Tables â—Ź Preprocessing via Hive ETL â—Ź Flattened â—Ź ~12 hours ingestion latency
  • 7.
    Scale of Presto@ Uber â—Ź 2 clusters â—‹ Application cluster â–  Hundreds of machines â–  100K queries per day â–  P90: 30s â—‹ Ad hoc cluster â–  Hundreds of machines â–  20K queries per day â–  P90: 60s â—Ź Access to both raw and model tables â—‹ 5 petabytes of data â—Ź Total 120K+ queries per day
  • 8.
    â—Ź Marketplace pricing â—‹Real-time driver incentives â—Ź Communication platform â—‹ Driver quality and action platform â—‹ Rider/driver cohorting â—‹ Ops, comms, & marketing â—Ź Growth marketing â—‹ BI dashboard for growth marketing â—Ź Data science â—‹ Exploratory analytics using notebooks â—Ź Data quality â—‹ Freshness and quality check â—Ź Ad hoc queries Applications of Presto @ Uber
  • 9.
    What is Presto:Interactive SQL Engine for Big Data Interactive query speeds Horizontally scalable ANSI SQL Battle-tested by Facebook, Uber, & Netflix Completely open source Access to petabytes of data in the Hadoop data lake
  • 10.
  • 11.
    Why Presto isFast â—Ź Data in memory during execution â—Ź Pipelining and streaming â—Ź Columnar storage & execution â—Ź Bytecode generation â—‹ Inline virtual function calls â—‹ Inline constants â—‹ Rewrite inner loops â—‹ Rewrite type-specific branches
  • 12.
    Resource Management â—Ź Prestohas its own resource manager â—‹ Not on YARN â—‹ Not on Mesos â—Ź CPU Management â—‹ Priority queues â—‹ Short running queries higher priority â—Ź Memory Management â—‹ Max memory per query per node â—‹ If query exceeds max memory limit, query fails â—‹ No OutOfMemory in Presto process
  • 13.
    Limitations â—Ź No faulttolerance â—Ź Joins do not fit in memory â—‹ Query fails â—‹ No OutOfMemory in Presto process â—‹ Try it on Hive â—Ź Coordinator is a single point of failure
  • 14.
    No Need toCopy Data: Presto Connectors
  • 15.
  • 16.
    Parquet Optimizations forPresto Example Query: SELECT base.driver_uuid FROM hdrone.mezzanine_trips WHERE datestr = '2017-03-02' AND base.city_id in (12) Data: â—Ź Up to 15 levels of Nesting â—Ź Up to 80 fields inside each Struct â—Ź Fields are added/deleted/updated inside Struct
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
    Presto Ongoing Work â—ŹGeoSpatial query optimization â—Ź Presto Elasticsearch Connector â—Ź Multi-tenancy Support â—Ź All Active Presto Cross Data Centers â—Ź Authentication and Authorization â—Ź High Available Coordinator
  • 25.
    Hadoop Infrastructure &Analytics â—Ź HDFS Erasure Encoding â—Ź HDFS Tiered Storage â—Ź All Active Hadoop Cross Data Centers â—Ź Hive On Spark â—Ź Spark â—Ź Data Visualization
  • 26.
    Thank you Proprietary andconfidential © 2016 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise exempt from disclosure under applicable law. All recipients of this document are notified that the information contained herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber. We are Hiring https://www.uber.com/careers/list/27366/ Send resumes to: abhik@uber.com or luoz@uber.com Interested in learning more about Uber Eng? Eng.uber.com Follow us on Twitter: @UberEng