SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
Anatomy of
유동민
Presto Anatomy
1. Who

2. What

3. Library

4. Code Generation

5. Plugin

6. Future
Who am I

Who uses Presto
Who am I
ZeroMQ Committer, Presto Contributor
Who am I
49 Contributors

7 Facebook Developer
Who uses Presto
Who uses Presto
http://www.slideshare.net/dain1/presto-meetup-2015

http://www.slideshare.net/NezihYigitbasi/prestoatnetflixhadoopsummit15
@ Facebook / daily
Scan PBs (ORC?)

Trillions Rows

30K Queries

1000s Users
@ Netflix / daily
Scan 15+ PBs (Parquet)

2.5K Queries

300 Users

1 coordinator / r3.4xlarge

220 workers / r3.4xlarge
@ TD / daily
Scan PBs (A Columnar)

Billions Rows

18K Queries

2 coordinators / r3.4xlarge

26 Workers / c3.8xlarge
Who uses Presto - Airbnb
Airpal - a web-based, query execution tool

Presto is amazing. It's an order of magnitude
faster than Hive in most our use cases. It reads
directly from HDFS, so unlike Redshift, there
isn't a lot of ETL before you can use it. It just
works.

- Christopher Gutierrez, Manager of Online Analytics, Airbnb
What is Presto
Presto - Command Line
Presto is
An open source distributed SQL query engine 

for running interactive analytic queries 

against data sources of all sizes 

ranging from gigabytes to petabytes.
http://prestodb.io
Presto is
•Fast !!! (10x faster than Hive)

•Even faster with new Presto ORC reader

•Written in Java with a pluggable backend

•Not SQL-like, but ANSI-SQL

•Code generation like LLVM

•Not only source is open, but open sourced (No private branch)
Presto is
HTTP
HTTP
Presto is
Presto is
CREATE TABLE mysql.hello.order_item AS

SELECT o.*, i.*

FROM hive.world.orders o —― TABLESAMPLE SYSTEM (10)

JOIN mongo.deview.lineitem i —― TABLESAMPLE BERNOULLI (40)

ON o.orderkey = i.orderkey

WHERE conditions..
Coordinator
Presto - Planner
Fragmenter
Worker
SQL Analyzer
Analysis
Logical
Plan
Optimizer
Plan
Plan

Fragment
Distributed
Query

Scheduler
Stage

Execution

Plan
Worker
Worker
Local

Execution

Planner
TASK
TASK
Presto - Page
PAGE
- positionCount
VAR_WIDTH BLOCK
nulls

Offsets
Values
FIEXED_WIDTH BLOCK
nulls
Values
positionCount blockCount 11 F I X E D _ W I D T H po
sitionCount bit encoded nullFlags values length
values
14 V A R I A B L E _ W
I D T H positionCount offsets[0] offsets[1] offsets[2…]
offsets[pos-1] offsets[pos] bit encoded nullFlags
values
Page / Block serialization
Presto - Cluster Memory Manager
Coordinator
Worker
Worker
Worker
GET /v1/memory
@Config(“query.max-memory”) = 20G
@Config(“query.max-memory-per-node”) = 1G
@Config(“resources.reserved-system-memory”) = 40% of -Xmx
System

reserved-system-memory
Reserved

max-memory-per-node
General
Task
Block All tasks
Presto - IndexManager
•LRU worker memory Cache

•@Config(task.max-index-memory) = 64M

•Table (List<IndexColumn> columns)

•Good for Key / Constant tables
Presto - Prestogres
https://github.com/treasure-data/prestogres
•Clients to use PostgreSQL protocol
to run queries on Presto

•Modified pgpoll-ii

•No ODBC driver yet

•Supports Tableau, ChartIO and etc
Presto - Security
•Authentication

•Single Sign On - Kerberos, SSL client cert

•Authorization

•Simple allow / deny
Presto - Misc.
• Presto Verifier

• Presto Benchmark Driver 

• Query Queue

• ${USER} and ${SOURCE} based maxConcurrent, maxQueued

• JDBC Driver

• Python / Ruby Presto Client (Treasure Data)

• Presto Metrics (Treasure Data)

• GET /v1/jmx/mbean/{mbean}, /v1/query/{query}, /v1/node/

• Presto Python/Java Event Collector (Treasure Data)

• QueryStart, SpitCompletion, QueryCompletion
23
Library
Slice - Efficient memory accessor
•https://github.com/airlift/slice

•ByteBuffer is slow

•Slices.allocate(size), Slices.allocateDirect(size)

•Slices.wrappedBuffer(byteBuffer)

•sun.misc.Unsafe

•Address

•((DirectBuffer) byteBuffer).getAddress()

•unsafe.ARRAY_BYTE_OFFSET + byteBuffer.arrayOffset()

•unsafe.getLong(address), unsafe.getInt(address),

•unsafe.copyMemory(src, address, dst, address)
Airlift - Distributed service framework
•https://github.com/airlift/airlift

•Core of Presto communication

•HTTP

•Bootstrap

•Node discovery

•RESTful API

•Dependency Injection

•Configuration

•Utilities
@Path("/v2/event")

public class EventResource {

@POST

public Response createQuery(EventRequests events) {

…

}

}

public class CollectorMainModule implements ConfigurationAwareModule { 

    @Override 

    public synchronized void configure(Binder binder) { 

        discoveryBinder(binder).bindHttpAnnouncement("collector"); 

        jsonCodecBinder(binder).bindJsonCodec(EventRequest.class); 

        jaxrsBinder(binder).bind(EventResource.class); 

    } 

public static void main(String[] args){

Bootstrap app = new Bootstrap(ImmutableList.of(

new NodeModule(),

new DiscoveryModule(),

new HttpServerModule(),

new JsonModule(), new JaxrsModule(true),

new EventModule(),

new CollectorMainModule()

));

Injector injector = app.strictConfig().initialize();

injector.getInstance(Announcer.class).start();

}

}
ex) https://github.com/miniway/presto-event-collector
Fastutil - Fast Java collection
•FastUtil 6.6.0 turned out to be consistently fast.

•Koloboke is getting second in many tests.

•GS implementation is good enough, but is slower than FastUtil and Koloboke.
http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/
ASM - Bytecode manipulation
package pkg;



public interface SumInterface {

long sum(long value);

}

public class MyClass implements SumInterface {

private long result = 0L;



public MyClass(long value) {

result = value;

}



@Override

public long sum(long value) {

result += value;

return result;

}

}

ClassWriter cw = new ClassWriter(0);

cw.visit(V1_7, ACC_PUBLIC, 

"pkg/MyClass", null, 

"java/lang/Object", 

new String[] { "pkg/SumInterface" });

cw.visitField(ACC_PRIVATE, 

"result", "J", null, new Long(0));



// constructor

MethodVisitor m = cw.visitMethod(ACC_PUBLIC, 

"<init>", "(J)V", null, null);

m.visitCode();



// call super()

m.visitVarInsn(ALOAD, 0); // this

m.visitMethodInsn(INVOKESPECIAL, 

"java/lang/Object", "<init>", “()V",

false);
ASM - Bytecode manipulation (Cont.)
// this.result = value

m.visitVarInsn(ALOAD, 0); // this

m.visitVarInsn(LLOAD, 1 ); // value

m.visitFieldInsn(PUTFIELD, 

"pkg/MyClass", "result", "J");

m.visitInsn(RETURN);

m.visitMaxs(-1, -1).visitEnd();



// public long sum(long value)

m = cw.visitMethod(ACC_PUBLIC , "sum", "(J)J", 

null, null);

m.visitCode();



m.visitVarInsn(ALOAD, 0); // this

m.visitVarInsn(ALOAD, 0); // this

m.visitFieldInsn(GETFIELD,

"pkg/MyClass", "result", "J");

m.visitVarInsn(LLOAD, 1); // value

// this.result + value

m.visitInsn(LADD); 

m.visitFieldInsn(PUTFIELD, 

"pkg/MyClass", "result", "J");



m.visitVarInsn(ALOAD, 0); // this

m.visitFieldInsn(GETFIELD, 

"pkg/MyClass", "result", "J");

m.visitInsn(LRETURN);

m.visitMaxs(-1, -1).visitEnd();



cw.visitEnd();

byte[] bytes = cw.toByteArray();

ClassLoader.defindClass(bytes)
Library - Misc.
•JDK 8u40 +

•Guice - Lightweight dependency injection

•Guava - Replacing Java8 Stream, Optional and Lambda

•ANTLR4 - Parser generator, SQL parser

•Jetty - HTTP Server and Client

•Jackson - JSON

•Jersey - RESTful API
Byte Code Generation

Function Variable Binding
Code Generation
•ASM

•Runtime Java classes and methods generation base on SQL

•30% of performance gain

•Where

•Filter and Projection

•Join Lookup source

•Join Probe

•Order By

•Aggregation
Code Generation - Filter
SELECT * FROM lineitem 

WHERE orderkey = 100 AND quantity = 200
AND
EQ

(#0,100)
EQ

(#1,200)
Logical Planner
class AndOperator extends Operator {

private Operator left = new EqualOperator(#1, 100);

private Operator right = new EqualOperator(#2, 200);

@Override

public boolean evaluate(Cursor cur)

{

if (!left.evaluate(cur)) {

return false;

}

return right.evaluate(cur);

}

}

class EqualOperator extends Operator {

@Override

public boolean evaluate(Cursor c)

{

return cur.getValue(position).equals(value);

}

}
Code Generation - Filter
// invoke MethodHandle( $operator$EQUAL(#0, 100) )

push cursor.getValue(#0)

push 100

$statck = invokeDynamic boostrap(0) $operator$EQUAL      

if (!$stack) { goto end; }

push cursor.getValue(#1)

push 200

$stack = invokeDynamic boostrap(0) $operator$EQUAL      

end:      

return $stack 

@ScalarOperator(EQUAL)

@SqlType(BOOLEAN)

public static boolean equal(@SqlType(BIGINT) long left,

@SqlType(BIGINT) long right){

    return left == right;

}

=> MethodHandle(“$operator$EQUAL(long, long): boolean”)
AND
$op$EQ

(#0,100)
$op$EQ

(#1,200)
Local Execution Planner
Code Generation - Join Lookup Source
SELECT col1, col2, col3 FROM tabA JOIN tabB 

ON tabA.col1 = tabB.colX /* BIGINT */ AND tabA.col2 = tabB.colY /* VARCHAR */
Page
Block(colY)
Block(colX)
PagesIndex
0,0 0,1 0,1023 2,100
Block(colX)
Block(colY)
B(X)
B(Y)
B(X) B(X)
B(Y) B(Y)
addresses
channels
Lookup

Source
JoinProbe
-1
-1
3000
-1
1023
100
-1
PagesHash
- hashRow
- equalsRow
ROW
hash
Found!
Code Generation - PageHash
class PagesHash { 

   List<Type> types = [BIGINT, VARCHAR] 

   List<Integer> hashChannels = [0,1] 

   List<List<Block>> channels = [ 

[BLOCK(colX), BLOCK(colX), ...] , 

              [BLOCK(colY), BLOCK(colY), ...] 

]  

} 

class (Compiled)PageHash { 

     Type type_colX = BIGINT 

     Type type_colY = VARCHAR 

     int hashChannel_colX = 0 

     int hashChannel_colY = 1 

     List<Block> channel_colX = 

[ BLOCK(colX), BLOCK(colX), … ] 

     List<Block> channel_colY = 

[ BLOCK(colY), BLOCK(colY), … ] 

}
Code Generation - PageHash (Cont.)
long hashRow (int position, 

Block[] blocks) { 

int result = 0; 

  for (int i = 0; i < hashChannels.size(); i++) {

int hashChannel = hashChannels.get(i); 

       Type type = types.get(hashChannel); 

            

result = result * 31 + 

type.hash(blocks[i], position); 

    } 

return result; 

} 

long (Compiled)hashRow (int position,

Block[] blocks) { 

        int result = 0; 

        result = result * 31 + 

type_colX.hash(block[0], position); 

        result = result * 31 + 

type_colY.hash(block[1], position); 

        return result; 

}
Code Generation - PageHash (Cont.)
boolean equalsRow (

int leftBlockIndex, int leftPosition, 

int rightPosition, Block[] rightBlocks) { 

    for (int i = 0; i < hashChannels.size(); i++) { 

    int hashChannel = hashChannels.get(i); 

       Type type = types.get(hashChannel); 

Block leftBlock = 

channels.get(hashChannel)

.get(leftBlockIndex); 

       if (!type.equalTo(leftBlock, leftPosition,

  rightBlocks[i], rightPosition)) { 

            return false; 

        } 

    } 

    return true; 

}

boolean (Compiled)equalsRow (

int leftBlockIndex, int leftPosition, 

int rightPosition, Block[] rightBlocks) { 

    Block leftBlock = 

channels_colX.get(leftBlockIndex); 

    if (!type.equalTo(leftBlock, leftPosition, 

rightBlocks[0], rightPosition)) { 

            return false; 

    } 

    leftBlock = 

channels_colY.get(leftBlockIndex); 

    if (!type.equalTo(leftBlock, leftPosition, 

rightBlocks[1], rightPosition)) { 

            return false; 

    } 

    return true; 

}
Method Variable Binding
1. regexp_like(string, pattern) → boolean

2. regexp_like(string, cast(pattern as RegexType))  // OperatorType.CAST 

3. regexp_like(string, new Regex(pattern))

4. MethodHandle handle = MethodHandles.insertArgument(1, new Regex(pattern))

5. handle.invoke (string)
@ScalarOperator(OperatorType.CAST)

@SqlType(“RegExp”)

public static Regex castToRegexp(@SqlType(VARCHAR) Slice pattern){ 

  return new Regex(pattern.getBytes(), 0, pattern.length()); 

} 

@ScalarFunction

@SqlType(BOOLEAN)

public static boolean regexpLike(@SqlType(VARCHAR) Slice source,

@SqlType(“RegExp”) Regex pattern){

    Matcher m = pattern.matcher(source.getBytes());

    int offset = m.search(0, source.length());

    return offset != -1;

}
Plugin - Connector
Plugin
•Hive

•Hadoop 1, Hadoop2, CDH4, CDH 5

•MySQL

•PostgreSQL

•Cassandra

•MongoDB

•Kafka

•Raptor
•Machine Learning

•BlackHole

•JMX

•TPC-H

•Example
Plugin - Raptor
•Storage data in flash on the Presto machines in ORC format

•Metadata is stored in MySQL (Extendable)

•Near real-time loads (5 - 10mins)

•3TB / day, 80B rows/day , 5 secs query

•CREATE VIEW myview AS SELECT …

•DELETE FROM tab WHERE conditions…

•UPDATE (Future)

•Coarse grained Index : min / max value of all columns

•Compaction

•Backup Store (Extendable)
No more ?!
Plugin - How to write
•https://prestodb.io/docs/current/develop/spi-overview.html

•ConnectorFactory

•ConnectorMetadata

•ConnectorSplitManager

•ConnectorHandleResolver

•ConnectorRecordSetProvider (PageSourceProvider)

•ConnectorRecordSinkProvider (PageSinkProvider)

•Add new Type

•Add new Function (A.K.A UDF)
Plugin - MongoDB
•https://github.com/facebook/presto/pull/3337

•5 Non-business days

•Predicate Pushdown

•Add a Type (ObjectId)

•Add UDFs (objectid(), objectid(string))
public class MongoPlugin implements Plugin { 

    @Override 

    public <T> List<T> getServices(Class<T> type) { 

        if (type == ConnectorFactory.class) { 

           return ImmutableList.of(

new MongoConnectorFactory(…)); 

        } else if (type == Type.class) { 

            return ImmutableList.of(OBJECT_ID); 

        } else if (type == FunctionFactory.class) { 

            return ImmutableList.of(

new MongoFunctionFactory(typeManager)); 

        } 

        return ImmutableList.of(); 

    } 

}
Plugin - MongoDB
class MongoFactory implements ConnectorFactory {

@Override

public Connector create(String connectorId) {

Bootstrap app = new Bootstrap(new
MongoClientModule());

return app.initialize()

.getInstance(MongoConnector.class);

}

}

class MongoClientModule implements Module {

@Override

public void configure(Binder binder){

binder.bind(MongoConnector.class)

.in(SINGLETON);

…

configBinder(binder)

.bindConfig(MongoClientConfig.class);

}

}
class MongoConnector implements Connector {

@Inject

public MongoConnector(

MongoSession mongoSession,

MongoMetadata metadata,

MongoSplitManager splitManager,

MongoPageSourceProvider 

pageSourceProvider,

MongoPageSinkProvider 

pageSinkProvider,

MongoHandleResolver 

handleResolver) {

… 

}

}
Plugin - MongoDB UDF
public class MongoFunctionFactory 

        implements FunctionFactory { 

    @Override 

    public List<ParametricFunction> listFunctions() 

    { 

        return new FunctionListBuilder(typeManager) 

                .scalar(ObjectIdFunctions.class) 

                .getFunctions(); 

    } 

} 

public class ObjectIdType 

        extends AbstractVariableWidthType { 

    ObjectIdType OBJECT_ID = new ObjectIdType(); 

    @JsonCreator 

    public ObjectIdType() { 

        super(parseTypeSignature("ObjectId"), 

Slice.class); 

    } 

}
public class ObjectIdFunctions { 

    @ScalarFunction("objectid") 

    @SqlType("ObjectId") 

    public static Slice ObjectId() { 

        return Slices.wrappedBuffer(

new ObjectId().toByteArray()); 

    } 

    @ScalarFunction("objectid") 

    @SqlType("ObjectId") 

    p.s Slice ObjectId(@SqlType(VARCHAR) Slice value) { 

        return Slices.wrappedBuffer(

new ObjectId(value.toStringUtf8()).toByteArray())
    } 

    @ScalarOperator(EQUAL) 

    @SqlType(BOOLEAN) 

    p.s boolean equal(@SqlType("ObjectId") Slice left,

@SqlType("ObjectId") Slice right) { 

        return left.equals(right); 

    } 

}
Future
Presto - Future
•Cost based optimization

•Join Hint (Right table must be smaller)

•Huge Join / Aggregation

•Coordinator High Availability

•Task Recovery

•Work Stealing

•Full Pushdown

•Vectorization

• ODBC Driver (Early 2016, Teradata)

• More security (LDAP, Grant SQL)
SELECT question FROM you
Thank You

Más contenido relacionado

La actualidad más candente

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
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & FeaturesDataStax Academy
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonIgor Anishchenko
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsDatabricks
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021StreamNative
 
Understanding Query Plans and Spark UIs
Understanding Query Plans and Spark UIsUnderstanding Query Plans and Spark UIs
Understanding Query Plans and Spark UIsDatabricks
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcachedJurriaan Persyn
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache icebergAlluxio, Inc.
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversScyllaDB
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuningGuy Harrison
 
Apache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationApache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationDatabricks
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkPatrick Wendell
 
Open Source SQL - beyond parsers: ZetaSQL and Apache Calcite
Open Source SQL - beyond parsers: ZetaSQL and Apache CalciteOpen Source SQL - beyond parsers: ZetaSQL and Apache Calcite
Open Source SQL - beyond parsers: ZetaSQL and Apache CalciteJulian Hyde
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guideRyan Blue
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudNoritaka Sekiyama
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupDatabricks
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesDatabricks
 
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB DayAmazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB DayAmazon Web Services Korea
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 

La actualidad más candente (20)

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...
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL Joins
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
 
Understanding Query Plans and Spark UIs
Understanding Query Plans and Spark UIsUnderstanding Query Plans and Spark UIs
Understanding Query Plans and Spark UIs
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache iceberg
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the Covers
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
 
Apache Spark Core – Practical Optimization
Apache Spark Core – Practical OptimizationApache Spark Core – Practical Optimization
Apache Spark Core – Practical Optimization
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache Spark
 
Open Source SQL - beyond parsers: ZetaSQL and Apache Calcite
Open Source SQL - beyond parsers: ZetaSQL and Apache CalciteOpen Source SQL - beyond parsers: ZetaSQL and Apache Calcite
Open Source SQL - beyond parsers: ZetaSQL and Apache Calcite
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB DayAmazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 

Similar a [245] presto 내부구조 파헤치기

Presto anatomy
Presto anatomyPresto anatomy
Presto anatomyDongmin Yu
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the wayOleg Podsechin
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]Igor Lozynskyi
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHPKing Foo
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...Aman Kohli
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopSages
 
루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날Sukjoon Kim
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLDatabricks
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestPavan Chitumalla
 
Leveraging Hadoop in your PostgreSQL Environment
Leveraging Hadoop in your PostgreSQL EnvironmentLeveraging Hadoop in your PostgreSQL Environment
Leveraging Hadoop in your PostgreSQL EnvironmentJim Mlodgenski
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"DataStax Academy
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016Frank Lyaruu
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourPeter Friese
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopPaul Lam
 
Continuous Application with Structured Streaming 2.0
Continuous Application with Structured Streaming 2.0Continuous Application with Structured Streaming 2.0
Continuous Application with Structured Streaming 2.0Anyscale
 

Similar a [245] presto 내부구조 파헤치기 (20)

Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 
루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQL
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at Pinterest
 
Leveraging Hadoop in your PostgreSQL Environment
Leveraging Hadoop in your PostgreSQL EnvironmentLeveraging Hadoop in your PostgreSQL Environment
Leveraging Hadoop in your PostgreSQL Environment
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
Server Side Swift: Vapor
Server Side Swift: VaporServer Side Swift: Vapor
Server Side Swift: Vapor
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on Hadoop
 
Continuous Application with Structured Streaming 2.0
Continuous Application with Structured Streaming 2.0Continuous Application with Structured Streaming 2.0
Continuous Application with Structured Streaming 2.0
 

Más de NAVER D2

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다NAVER D2
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...NAVER D2
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기NAVER D2
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발NAVER D2
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈NAVER D2
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&ANAVER D2
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기NAVER D2
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep LearningNAVER D2
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applicationsNAVER D2
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingNAVER D2
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지NAVER D2
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기NAVER D2
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화NAVER D2
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)NAVER D2
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기NAVER D2
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual SearchNAVER D2
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화NAVER D2
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지NAVER D2
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터NAVER D2
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?NAVER D2
 

Más de NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

[245] presto 내부구조 파헤치기

  • 2. Presto Anatomy 1. Who 2. What 3. Library 4. Code Generation 5. Plugin 6. Future
  • 3. Who am I Who uses Presto
  • 4. Who am I ZeroMQ Committer, Presto Contributor
  • 5. Who am I 49 Contributors 7 Facebook Developer
  • 7. Who uses Presto http://www.slideshare.net/dain1/presto-meetup-2015 http://www.slideshare.net/NezihYigitbasi/prestoatnetflixhadoopsummit15 @ Facebook / daily Scan PBs (ORC?) Trillions Rows 30K Queries 1000s Users @ Netflix / daily Scan 15+ PBs (Parquet) 2.5K Queries 300 Users 1 coordinator / r3.4xlarge 220 workers / r3.4xlarge @ TD / daily Scan PBs (A Columnar) Billions Rows 18K Queries 2 coordinators / r3.4xlarge 26 Workers / c3.8xlarge
  • 8. Who uses Presto - Airbnb Airpal - a web-based, query execution tool Presto is amazing. It's an order of magnitude faster than Hive in most our use cases. It reads directly from HDFS, so unlike Redshift, there isn't a lot of ETL before you can use it. It just works. - Christopher Gutierrez, Manager of Online Analytics, Airbnb
  • 12. Presto is •Fast !!! (10x faster than Hive) •Even faster with new Presto ORC reader •Written in Java with a pluggable backend •Not SQL-like, but ANSI-SQL •Code generation like LLVM •Not only source is open, but open sourced (No private branch)
  • 15. Presto is CREATE TABLE mysql.hello.order_item AS SELECT o.*, i.* FROM hive.world.orders o —― TABLESAMPLE SYSTEM (10) JOIN mongo.deview.lineitem i —― TABLESAMPLE BERNOULLI (40) ON o.orderkey = i.orderkey WHERE conditions..
  • 16. Coordinator Presto - Planner Fragmenter Worker SQL Analyzer Analysis Logical Plan Optimizer Plan Plan Fragment Distributed Query Scheduler Stage Execution Plan Worker Worker Local Execution Planner TASK TASK
  • 17. Presto - Page PAGE - positionCount VAR_WIDTH BLOCK nulls Offsets Values FIEXED_WIDTH BLOCK nulls Values positionCount blockCount 11 F I X E D _ W I D T H po sitionCount bit encoded nullFlags values length values 14 V A R I A B L E _ W I D T H positionCount offsets[0] offsets[1] offsets[2…] offsets[pos-1] offsets[pos] bit encoded nullFlags values Page / Block serialization
  • 18. Presto - Cluster Memory Manager Coordinator Worker Worker Worker GET /v1/memory @Config(“query.max-memory”) = 20G @Config(“query.max-memory-per-node”) = 1G @Config(“resources.reserved-system-memory”) = 40% of -Xmx System reserved-system-memory Reserved max-memory-per-node General Task Block All tasks
  • 19. Presto - IndexManager •LRU worker memory Cache •@Config(task.max-index-memory) = 64M •Table (List<IndexColumn> columns) •Good for Key / Constant tables
  • 20. Presto - Prestogres https://github.com/treasure-data/prestogres •Clients to use PostgreSQL protocol to run queries on Presto •Modified pgpoll-ii •No ODBC driver yet •Supports Tableau, ChartIO and etc
  • 21. Presto - Security •Authentication •Single Sign On - Kerberos, SSL client cert •Authorization •Simple allow / deny
  • 22. Presto - Misc. • Presto Verifier • Presto Benchmark Driver • Query Queue • ${USER} and ${SOURCE} based maxConcurrent, maxQueued • JDBC Driver • Python / Ruby Presto Client (Treasure Data) • Presto Metrics (Treasure Data) • GET /v1/jmx/mbean/{mbean}, /v1/query/{query}, /v1/node/ • Presto Python/Java Event Collector (Treasure Data) • QueryStart, SpitCompletion, QueryCompletion
  • 23. 23
  • 25. Slice - Efficient memory accessor •https://github.com/airlift/slice •ByteBuffer is slow •Slices.allocate(size), Slices.allocateDirect(size) •Slices.wrappedBuffer(byteBuffer) •sun.misc.Unsafe •Address •((DirectBuffer) byteBuffer).getAddress() •unsafe.ARRAY_BYTE_OFFSET + byteBuffer.arrayOffset() •unsafe.getLong(address), unsafe.getInt(address), •unsafe.copyMemory(src, address, dst, address)
  • 26. Airlift - Distributed service framework •https://github.com/airlift/airlift •Core of Presto communication •HTTP •Bootstrap •Node discovery •RESTful API •Dependency Injection •Configuration •Utilities @Path("/v2/event") public class EventResource { @POST public Response createQuery(EventRequests events) { … } } public class CollectorMainModule implements ConfigurationAwareModule {     @Override     public synchronized void configure(Binder binder) {         discoveryBinder(binder).bindHttpAnnouncement("collector");         jsonCodecBinder(binder).bindJsonCodec(EventRequest.class);         jaxrsBinder(binder).bind(EventResource.class);     } public static void main(String[] args){ Bootstrap app = new Bootstrap(ImmutableList.of( new NodeModule(), new DiscoveryModule(), new HttpServerModule(), new JsonModule(), new JaxrsModule(true), new EventModule(), new CollectorMainModule() )); Injector injector = app.strictConfig().initialize(); injector.getInstance(Announcer.class).start(); } } ex) https://github.com/miniway/presto-event-collector
  • 27. Fastutil - Fast Java collection •FastUtil 6.6.0 turned out to be consistently fast. •Koloboke is getting second in many tests. •GS implementation is good enough, but is slower than FastUtil and Koloboke. http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/
  • 28. ASM - Bytecode manipulation package pkg;
 
 public interface SumInterface {
 long sum(long value);
 } public class MyClass implements SumInterface {
 private long result = 0L;
 
 public MyClass(long value) {
 result = value;
 }
 
 @Override
 public long sum(long value) {
 result += value;
 return result;
 }
 } ClassWriter cw = new ClassWriter(0);
 cw.visit(V1_7, ACC_PUBLIC, "pkg/MyClass", null, "java/lang/Object", new String[] { "pkg/SumInterface" });
 cw.visitField(ACC_PRIVATE, "result", "J", null, new Long(0));
 
 // constructor
 MethodVisitor m = cw.visitMethod(ACC_PUBLIC, "<init>", "(J)V", null, null);
 m.visitCode(); 
 // call super()
 m.visitVarInsn(ALOAD, 0); // this
 m.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", “()V", false);
  • 29. ASM - Bytecode manipulation (Cont.) // this.result = value
 m.visitVarInsn(ALOAD, 0); // this
 m.visitVarInsn(LLOAD, 1 ); // value
 m.visitFieldInsn(PUTFIELD, "pkg/MyClass", "result", "J");
 m.visitInsn(RETURN);
 m.visitMaxs(-1, -1).visitEnd();
 
 // public long sum(long value)
 m = cw.visitMethod(ACC_PUBLIC , "sum", "(J)J", null, null);
 m.visitCode(); 
 m.visitVarInsn(ALOAD, 0); // this
 m.visitVarInsn(ALOAD, 0); // this
 m.visitFieldInsn(GETFIELD, "pkg/MyClass", "result", "J");
 m.visitVarInsn(LLOAD, 1); // value
 // this.result + value
 m.visitInsn(LADD); 
 m.visitFieldInsn(PUTFIELD, "pkg/MyClass", "result", "J");
 
 m.visitVarInsn(ALOAD, 0); // this
 m.visitFieldInsn(GETFIELD, "pkg/MyClass", "result", "J");
 m.visitInsn(LRETURN);
 m.visitMaxs(-1, -1).visitEnd();
 
 cw.visitEnd();
 byte[] bytes = cw.toByteArray(); ClassLoader.defindClass(bytes)
  • 30. Library - Misc. •JDK 8u40 + •Guice - Lightweight dependency injection •Guava - Replacing Java8 Stream, Optional and Lambda •ANTLR4 - Parser generator, SQL parser •Jetty - HTTP Server and Client •Jackson - JSON •Jersey - RESTful API
  • 31. Byte Code Generation Function Variable Binding
  • 32. Code Generation •ASM •Runtime Java classes and methods generation base on SQL •30% of performance gain •Where •Filter and Projection •Join Lookup source •Join Probe •Order By •Aggregation
  • 33. Code Generation - Filter SELECT * FROM lineitem WHERE orderkey = 100 AND quantity = 200 AND EQ (#0,100) EQ (#1,200) Logical Planner class AndOperator extends Operator { private Operator left = new EqualOperator(#1, 100); private Operator right = new EqualOperator(#2, 200); @Override public boolean evaluate(Cursor cur) { if (!left.evaluate(cur)) { return false; } return right.evaluate(cur); } } class EqualOperator extends Operator { @Override public boolean evaluate(Cursor c) { return cur.getValue(position).equals(value); } }
  • 34. Code Generation - Filter // invoke MethodHandle( $operator$EQUAL(#0, 100) ) push cursor.getValue(#0) push 100 $statck = invokeDynamic boostrap(0) $operator$EQUAL      if (!$stack) { goto end; } push cursor.getValue(#1) push 200 $stack = invokeDynamic boostrap(0) $operator$EQUAL      end:       return $stack @ScalarOperator(EQUAL) @SqlType(BOOLEAN) public static boolean equal(@SqlType(BIGINT) long left, @SqlType(BIGINT) long right){     return left == right; } => MethodHandle(“$operator$EQUAL(long, long): boolean”) AND $op$EQ (#0,100) $op$EQ (#1,200) Local Execution Planner
  • 35. Code Generation - Join Lookup Source SELECT col1, col2, col3 FROM tabA JOIN tabB ON tabA.col1 = tabB.colX /* BIGINT */ AND tabA.col2 = tabB.colY /* VARCHAR */ Page Block(colY) Block(colX) PagesIndex 0,0 0,1 0,1023 2,100 Block(colX) Block(colY) B(X) B(Y) B(X) B(X) B(Y) B(Y) addresses channels Lookup Source JoinProbe -1 -1 3000 -1 1023 100 -1 PagesHash - hashRow - equalsRow ROW hash Found!
  • 36. Code Generation - PageHash class PagesHash {    List<Type> types = [BIGINT, VARCHAR]    List<Integer> hashChannels = [0,1]    List<List<Block>> channels = [ [BLOCK(colX), BLOCK(colX), ...] ,               [BLOCK(colY), BLOCK(colY), ...] ]  } class (Compiled)PageHash {      Type type_colX = BIGINT      Type type_colY = VARCHAR      int hashChannel_colX = 0      int hashChannel_colY = 1      List<Block> channel_colX = [ BLOCK(colX), BLOCK(colX), … ]      List<Block> channel_colY = [ BLOCK(colY), BLOCK(colY), … ] }
  • 37. Code Generation - PageHash (Cont.) long hashRow (int position, Block[] blocks) { int result = 0;   for (int i = 0; i < hashChannels.size(); i++) { int hashChannel = hashChannels.get(i);        Type type = types.get(hashChannel);             result = result * 31 +  type.hash(blocks[i], position);     } return result; } long (Compiled)hashRow (int position, Block[] blocks) {         int result = 0;         result = result * 31 + type_colX.hash(block[0], position);         result = result * 31 + type_colY.hash(block[1], position);         return result; }
  • 38. Code Generation - PageHash (Cont.) boolean equalsRow ( int leftBlockIndex, int leftPosition,  int rightPosition, Block[] rightBlocks) {     for (int i = 0; i < hashChannels.size(); i++) {     int hashChannel = hashChannels.get(i);        Type type = types.get(hashChannel); Block leftBlock =  channels.get(hashChannel) .get(leftBlockIndex);        if (!type.equalTo(leftBlock, leftPosition,   rightBlocks[i], rightPosition)) {             return false;         }     }     return true; } boolean (Compiled)equalsRow ( int leftBlockIndex, int leftPosition,  int rightPosition, Block[] rightBlocks) {     Block leftBlock =  channels_colX.get(leftBlockIndex);     if (!type.equalTo(leftBlock, leftPosition,  rightBlocks[0], rightPosition)) {             return false;     }     leftBlock =  channels_colY.get(leftBlockIndex);     if (!type.equalTo(leftBlock, leftPosition,  rightBlocks[1], rightPosition)) {             return false;     }     return true; }
  • 39. Method Variable Binding 1. regexp_like(string, pattern) → boolean 2. regexp_like(string, cast(pattern as RegexType))  // OperatorType.CAST  3. regexp_like(string, new Regex(pattern)) 4. MethodHandle handle = MethodHandles.insertArgument(1, new Regex(pattern)) 5. handle.invoke (string) @ScalarOperator(OperatorType.CAST) @SqlType(“RegExp”) public static Regex castToRegexp(@SqlType(VARCHAR) Slice pattern){   return new Regex(pattern.getBytes(), 0, pattern.length());  } @ScalarFunction @SqlType(BOOLEAN) public static boolean regexpLike(@SqlType(VARCHAR) Slice source, @SqlType(“RegExp”) Regex pattern){     Matcher m = pattern.matcher(source.getBytes());     int offset = m.search(0, source.length());     return offset != -1; }
  • 41. Plugin •Hive •Hadoop 1, Hadoop2, CDH4, CDH 5 •MySQL •PostgreSQL •Cassandra •MongoDB •Kafka •Raptor •Machine Learning •BlackHole •JMX •TPC-H •Example
  • 42. Plugin - Raptor •Storage data in flash on the Presto machines in ORC format •Metadata is stored in MySQL (Extendable) •Near real-time loads (5 - 10mins) •3TB / day, 80B rows/day , 5 secs query •CREATE VIEW myview AS SELECT … •DELETE FROM tab WHERE conditions… •UPDATE (Future) •Coarse grained Index : min / max value of all columns •Compaction •Backup Store (Extendable) No more ?!
  • 43. Plugin - How to write •https://prestodb.io/docs/current/develop/spi-overview.html •ConnectorFactory •ConnectorMetadata •ConnectorSplitManager •ConnectorHandleResolver •ConnectorRecordSetProvider (PageSourceProvider) •ConnectorRecordSinkProvider (PageSinkProvider) •Add new Type •Add new Function (A.K.A UDF)
  • 44. Plugin - MongoDB •https://github.com/facebook/presto/pull/3337 •5 Non-business days •Predicate Pushdown •Add a Type (ObjectId) •Add UDFs (objectid(), objectid(string)) public class MongoPlugin implements Plugin {     @Override     public <T> List<T> getServices(Class<T> type) {         if (type == ConnectorFactory.class) {            return ImmutableList.of( new MongoConnectorFactory(…));         } else if (type == Type.class) {             return ImmutableList.of(OBJECT_ID);         } else if (type == FunctionFactory.class) {             return ImmutableList.of( new MongoFunctionFactory(typeManager));         }         return ImmutableList.of();     } }
  • 45. Plugin - MongoDB class MongoFactory implements ConnectorFactory { @Override public Connector create(String connectorId) { Bootstrap app = new Bootstrap(new MongoClientModule()); return app.initialize() .getInstance(MongoConnector.class); } } class MongoClientModule implements Module { @Override public void configure(Binder binder){ binder.bind(MongoConnector.class) .in(SINGLETON); … configBinder(binder) .bindConfig(MongoClientConfig.class); } } class MongoConnector implements Connector { @Inject public MongoConnector( MongoSession mongoSession, MongoMetadata metadata, MongoSplitManager splitManager, MongoPageSourceProvider pageSourceProvider, MongoPageSinkProvider pageSinkProvider, MongoHandleResolver handleResolver) { … } }
  • 46. Plugin - MongoDB UDF public class MongoFunctionFactory         implements FunctionFactory {     @Override     public List<ParametricFunction> listFunctions()     {         return new FunctionListBuilder(typeManager)                 .scalar(ObjectIdFunctions.class)                 .getFunctions();     } } public class ObjectIdType         extends AbstractVariableWidthType {     ObjectIdType OBJECT_ID = new ObjectIdType();     @JsonCreator     public ObjectIdType() {         super(parseTypeSignature("ObjectId"),  Slice.class);     } } public class ObjectIdFunctions {     @ScalarFunction("objectid")     @SqlType("ObjectId")     public static Slice ObjectId() {         return Slices.wrappedBuffer( new ObjectId().toByteArray());     }     @ScalarFunction("objectid")     @SqlType("ObjectId")     p.s Slice ObjectId(@SqlType(VARCHAR) Slice value) {         return Slices.wrappedBuffer( new ObjectId(value.toStringUtf8()).toByteArray())     }     @ScalarOperator(EQUAL)     @SqlType(BOOLEAN)     p.s boolean equal(@SqlType("ObjectId") Slice left, @SqlType("ObjectId") Slice right) {         return left.equals(right);     } }
  • 48. Presto - Future •Cost based optimization •Join Hint (Right table must be smaller) •Huge Join / Aggregation •Coordinator High Availability •Task Recovery •Work Stealing •Full Pushdown •Vectorization • ODBC Driver (Early 2016, Teradata) • More security (LDAP, Grant SQL)