integrating hp vertica with external analytics engines · integrating hp vertica with external...

12
Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos, Qiming Chen, Meichun Hsu HP Vertica West XLDB 2015

Upload: nguyentu

Post on 09-Sep-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Integrating HP Vertica with External Analytics Engines:

A case for Spark and Distributed R

Jeff LeFevre, Rui Liu, Malu Castellanos, Qiming Chen, Meichun Hsu

HP Vertica West

XLDB 2015

Page 2: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

High Level Goals

• Extend Vertica’s capability with additional ML algorithms

• Keep database as the enterprise quality data manager

• Let data scientists use tools they are familiar with

• Easily deploy ML models within the database

Page 3: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Three Current Efforts at HP Vertica

• Integration with Distributed R (HP Labs project) • Distributed ML platform with several ML algorithms

• Integration with Spark • Distributed ML platform with MLlib, GraphX

• Integration with Caffe • Deep learning platform

Page 4: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Ingest Data Prepare Data Build

Models Evaluate Models

Deploy Models (In-database scoring

Present Insight

DistrR / Spark /

Caffe

Challenge 1: Data transfer

Challenge 2: Model deployment

HP Vertica + DistR / Spark / Caffe

Page 5: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Example Distributed R User Session

# LOAD DATA

$: data <- db2darray(TABLE1, list(‘def’), list(‘A’, ‘B’)

# BUILD MODEL

$: model <- hpdglm(data$Y, data$X, family=binomial, …)

# DEPLOY MODEL

$: deploy.model(model, ‘my_model’)

# IN-DATABASE PREDICTION

$: query <- SELECT glmPredict(A, B,

using PARAMS model=‘my_model’)

from TABLE2;

$: res <-sqlQuery(conn, query)

Page 6: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Example Spark User Session # LOAD DATA

$: val data = new VerticaRDD(sc, connection=getConnection, table, numPartitions=numOfPart, mapRow=extractValues)

# BUILD MODEL

$: val clusters = KMeans.train(data, numClusters, numIterations)

# DEPLOY MODEL

$: val vert = new ModelSerDes(connection=getConnection, table)

$: vert.store(clusters)

# IN-DATABASE PREDICTION

$: select spark_km_predict(x,y,z USING PARAMETERS modelId=2066188038) from table;

Page 7: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Data Transfer Issues

V E

V E

V E

Locality Preserving Policy

Page 8: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Data Transfer Issues

V E

V E

V E

Locality Preserving Policy

V E

V E

V E

Uniform Distribution Policy

Page 9: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Data loading from Vertica to DistR and Spark

0

5

10

15

20

25

30

35

40

50GB 100GB 150GB

Tim

e in

min

ute

s

R-ODBC DistR Loader Spark Loader (preliminary)

Page 10: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Data loading from Vertica to DistR and Spark

0

5

10

15

20

25

30

35

40

50GB 100GB 150GB

Tim

e in

min

ute

s

R-ODBC DistR Loader Spark Loader (preliminary)

Page 11: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Integration Status

• Distributed R • Open sourced: https://github.com/vertica/DistributedR

• Eurosys 2013, SIGMOD 2015

• K-Means, PageRank, Linear/Logistic Regression, Random Forest

• Spark, Caffe – Works In Progress

Page 12: Integrating HP Vertica with External Analytics Engines · Integrating HP Vertica with External Analytics Engines: A case for Spark and Distributed R Jeff LeFevre, Rui Liu, Malu Castellanos,

Thank You!

References

• Open Source Distributed R: https://github.com/vertica/DistributedR

• S. Venkataraman et al, Presto: Distributed Machine Learning and Graph Processing with Sparse Matrices, Eurosys 13.

• S. Prasad et al, Large-scale Predictive Analytics in Vertica: Fast Data Transfer, Distributed Model Creation, and In-database Prediction, SIGMOD 15 (to appear).

Acknowledgements

• Distributed R team members: Shreya Prassad, Arash Fard, Vishrut Gupta, Jorge Martinez, Edward Ma, Indrajit Roy, Sunil Venkayala, Vincent Xu