Apache Drill Interactive analytics for largescale datasets Michael

  • Slides: 39
Download presentation
Apache Drill Interactive, analytics for large-scale datasets Michael Hausenblas, Chief Data Engineer EMEA, Map.

Apache Drill Interactive, analytics for large-scale datasets Michael Hausenblas, Chief Data Engineer EMEA, Map. R HUG Stockholm, 2013 -09 -12

http: //www. flickr. com/photos/kevinomara/2866648330/ licensed under CC BY-NC-ND 2. 0 Which workloads do you

http: //www. flickr. com/photos/kevinomara/2866648330/ licensed under CC BY-NC-ND 2. 0 Which workloads do you encounter in your environment?

Batch processing Apache Pig Cascalog … for recurring tasks such as large-scale data mining,

Batch processing Apache Pig Cascalog … for recurring tasks such as large-scale data mining, ETL offloading/data-warehousing for the batch layer in Lambda architecture

OLTP … user-facing e. Commerce transactions, real-time messaging at scale (FB), time-series processing, etc.

OLTP … user-facing e. Commerce transactions, real-time messaging at scale (FB), time-series processing, etc. for the serving layer in Lambda architecture

Stream processing … in order to handle stream sources such as social media feeds

Stream processing … in order to handle stream sources such as social media feeds or sensor data (mobile phones, RFID, weather stations, etc. ) for the speed layer in Lambda architecture

Search/Information Retrieval … retrieval of items from unstructured documents (plain text, etc. ), semi-structured

Search/Information Retrieval … retrieval of items from unstructured documents (plain text, etc. ), semi-structured data formats (JSON, etc. ), as well as data stores (Mongo. DB, Couch. DB, etc. )

But what about interactive ad-hoc query at scale? http: //www. flickr. com/photos/9479603@N 02/4144121838 /

But what about interactive ad-hoc query at scale? http: //www. flickr. com/photos/9479603@N 02/4144121838 / licensed under CC BY-NC-ND 2. 0

Interactive Query (? ) Impala low-latency

Interactive Query (? ) Impala low-latency

Use Case: Marketing Campaign • Jane, a marketing analyst • Determine target segments •

Use Case: Marketing Campaign • Jane, a marketing analyst • Determine target segments • Data from different sources

Use Case: Logistics • Supplier tracking and performance • Queries – Shipments from supplier

Use Case: Logistics • Supplier tracking and performance • Queries – Shipments from supplier ‘ACM’ in last 24 h – Shipments in region ‘US’ not from ‘ACM’ SUPPLIER_ID NAME REGION ACME Corp US GAL Got. ALot Inc US BAP Bits and Pieces Ltd Europe ZUP Zu Pli Asia { "shipment": 100123, "supplier": "ACM", “timestamp": "2013 -02 -01", "description": ”first delivery today” }, { "shipment": 100124, "supplier": "BAP", "timestamp": "2013 -02 -02", "description": "hope you enjoy it” } …

Use Case: Crime Detection • • Online purchases Fraud, bilking, etc. Batch-generated overview Modes

Use Case: Crime Detection • • Online purchases Fraud, bilking, etc. Batch-generated overview Modes – Explorative – Alerts

Requirements • • • Support for different data sources Support for different query interfaces

Requirements • • • Support for different data sources Support for different query interfaces Low-latency/real-time Ad-hoc queries Scalable, reliable

And now for something completely different …

And now for something completely different …

Google’s Dremel http: //research. google. com/pubs/pub 36632. html Sergey Melnik, Andrey Gubarev, Jing Long,

Google’s Dremel http: //research. google. com/pubs/pub 36632. html Sergey Melnik, Andrey Gubarev, Jing Long, Geoffrey Romer, Shivakumar, Matt Tolton, Theo Vassilakis, Proc. of the 36 th Int'l Conf on Very Large Data Bases (2010), pp. 330 -339 “ “ Dremel is a scalable, interactive ad-hoc query system for analysis of read-only nested data. By combining multilevel execution trees and columnar data layout, it is capable of running aggregation queries over trillion-row tables in seconds. The system scales to thousands of CPUs and petabytes of data, and has thousands of users at Google. …

Google’s Dremel multi-level execution trees columnar data layout

Google’s Dremel multi-level execution trees columnar data layout

Google’s Dremel nested data + schema column-striped representation map nested data to tables

Google’s Dremel nested data + schema column-striped representation map nested data to tables

Google’s Dremel experiments: datasets & query performance

Google’s Dremel experiments: datasets & query performance

Back to Apache Drill …

Back to Apache Drill …

Apache Drill–key facts • • • Inspired by Google’s Dremel Standard SQL 2003 support

Apache Drill–key facts • • • Inspired by Google’s Dremel Standard SQL 2003 support Plug-able data sources Nested data is a first-class citizen Schema is optional Community driven, open, 100’s involved

High-level Architecture

High-level Architecture

Principled Query Execution • Source query—what we want to do (analyst friendly) • Logical

Principled Query Execution • Source query—what we want to do (analyst friendly) • Logical Plan— what we want to do (language agnostic, computer friendly) • Physical Plan—how we want to do it (the best way we can tell) • Execution Plan—where we want to do it

Principled Query Execution Source Query SQL 2003 Dr. QL Mongo. QL DSL Parser parser

Principled Query Execution Source Query SQL 2003 Dr. QL Mongo. QL DSL Parser parser API Logical Plan query: [ { @id: "log", op: "sequence", do: [ { op: "scan", source: “logs” }, { op: "filter", condition: "x > 3” }, Optimizer Topology CF etc. Physical Plan Execution scanner API

Wire-level Architecture • Each node: Drillbit - maximize data locality • Co-ordination, query planning,

Wire-level Architecture • Each node: Drillbit - maximize data locality • Co-ordination, query planning, execution, etc, are distributed • Any node can act as endpoint for a query—foreman Drillbit Storage Process node

Wire-level Architecture • Curator/Zookeeper for ephemeral cluster membership info • Distributed cache (Hazelcast) for

Wire-level Architecture • Curator/Zookeeper for ephemeral cluster membership info • Distributed cache (Hazelcast) for metadata, locality information, etc. Curator/Zk Drillbit Distributed Cache Storage Process node

Wire-level Architecture • Originating Drillbit acts as foreman: manages query execution, scheduling, locality information,

Wire-level Architecture • Originating Drillbit acts as foreman: manages query execution, scheduling, locality information, etc. • Streaming data communication avoiding Ser. De Curator/Zk Drillbit Distributed Cache Storage Process node

Wire-level Architecture Foreman turns into root of the multi-level execution tree, leafs activate their

Wire-level Architecture Foreman turns into root of the multi-level execution tree, leafs activate their storage engine interface. node Curator/Zk node

On the shoulders of giants … • • • • Jackson for JSON Ser.

On the shoulders of giants … • • • • Jackson for JSON Ser. De for metadata Typesafe HOCON for configuration and module management Netty 4 as core RPC engine, protobuf for communication Vanilla Java, Larray and Netty Byte. Buf for off-heap large data structures Hazelcast for distributed cache Netflix Curator on top of Zookeeper for service registry Optiq for SQL parsing and cost optimization Parquet (http: //parquet. io)/ ORC Janino for expression compilation ASM for Byte. Code manipulation Yammer Metrics for metrics Guava extensively Carrot HPC for primitive collections

Key features • • Full SQL – ANSI SQL 2003 Nested Data as first

Key features • • Full SQL – ANSI SQL 2003 Nested Data as first class citizen Optional Schema Extensibility Points …

Extensibility Points • • Source query parser API Custom operators, UDF logical plan Serving

Extensibility Points • • Source query parser API Custom operators, UDF logical plan Serving tree, CF, topology physical plan/optimizer Data sources &formats scanner API Source Query Parser Logical Plan Optimizer Physical Plan Execution

User Interfaces • API—Drill. Client – Encapsulates endpoint discovery – Supports logical and physical

User Interfaces • API—Drill. Client – Encapsulates endpoint discovery – Supports logical and physical plan submission, query cancellation, query status – Supports streaming return results • JDBC driver, converting JDBC into Drill. Client communication. • REST proxy for Drill. Client

User Interfaces

User Interfaces

LET’S GET OUR HANDS DIRTY…

LET’S GET OUR HANDS DIRTY…

Demo • Install • Preparation • Usage $ wget http: //people. apache. org/~jacques/apache-drill-1. 0.

Demo • Install • Preparation • Usage $ wget http: //people. apache. org/~jacques/apache-drill-1. 0. 0 m 1. rc 3/apache-drill-1. 0. 0 -m 1 -binary-release. tar. gz $ tar -zxf apache-drill-1. 0. 0 -m 1 -binary-release. tar. gz $ export JAVA_HOME=/Library/Java. Virtual. Machines/jdk 1. 7. 0_11. jdk/Contents/Ho me $ export DRILL_LOG_DIR=$PWD $. /bin/drillbit. sh start $. /bin/sqlline -u jdbc: drill: schema=parquet-local -n admin -p admin

Useful Resources • Getting Started guide https: //github. com/vrtx/incubatordrill/blob/getting_started/docs/getting_started. rst • Demo How. To

Useful Resources • Getting Started guide https: //github. com/vrtx/incubatordrill/blob/getting_started/docs/getting_started. rst • Demo How. To https: //cwiki. apache. org/confluence/display/DRILL/De mo+How. To • How to build/install Apache Drill on Ubuntu 13. 04 http: //www. confusedcoders. com/bigdata/apachedrill/how-to-build-apache-drill-on-ubuntu-13 -04

BE A PART OF IT!

BE A PART OF IT!

Status • Heavy development by multiple organizations (Map. R, Pentaho, Microsoft, Thoughtworks, Xing. Cloud,

Status • Heavy development by multiple organizations (Map. R, Pentaho, Microsoft, Thoughtworks, Xing. Cloud, etc. ) • Currently more than 100 k LOC • Alpha available via http: //people. apache. org/~jacques/apachedrill-1. 0. 0 -m 1. rc 3/

Kudos to … Julian Hyde, Pentaho Lisen Mu, Xing. Cloud Tim Chen, Microsoft Chris

Kudos to … Julian Hyde, Pentaho Lisen Mu, Xing. Cloud Tim Chen, Microsoft Chris Merrick, RJMetrics David Alves, UT Austin Sree Vaadi, SSS Srihari Srinivasan, Thought. Works • Alexandre Beche, CERN • Jason Altekruse, Map. R • • • • Ben Becker, Map. R Jacques Nadeau, Map. R Ted Dunning, Map. R Keys Botzum, Map. R Jason Frantz Ellen Friedman Chris Wensel, Concurrent Gera Shegalov, Oracle Ryan Rawson, Ohm Data http: //incubator. apache. org/drill/team. html

Contributing Contributions appreciated—not only code drops … • Test data & test queries •

Contributing Contributions appreciated—not only code drops … • Test data & test queries • Use case scenarios (textual/SQL queries) • Documentation

Engage! • Follow @Apache. Drill on Twitter • Sign up at mailing lists (user

Engage! • Follow @Apache. Drill on Twitter • Sign up at mailing lists (user | dev) http: //incubator. apache. org/drill/mailing-lists. html • Standing G+ hangouts every Tuesday at 18: 00 CET http: //j. mp/apache-drill-hangouts • Keep an eye on http: //drill-user. org/