integrating hadoop and parallel...

21
INTEGRATING HADOOP AND PARALLEL DBMS Presented By Sagar Dahiwala | Yaseen Ahmed 1

Upload: others

Post on 25-Apr-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

INTEGRATING HADOOP AND

PARALLEL DBMS

Presented By

Sagar Dahiwala | Yaseen Ahmed

1

Page 2: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Parallel DBMS vs Hadoop

• Slow to load high volume data into an RDBMS

• Fast Execution of queries

• Easy to write SQL for complex BI analysis

• Expensive

• HDFS has reliability and quick load time

• 2-3 times slower in execution of queries

• Difficult to write Map Reduce programs

• Low cost

2

Page 3: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Existing system and Challenge

• Parallel DBMS deployed in large data

warehouse For Business analysis of few

Terabytes to Multiple Petabytes

• Due to Explosive data volume increase in

recent years, some data like weblogs and

sensor data are not managed by Teradata

Enterprise Data Warehouse.

• Very expensive to load large volume of data.

3

Page 4: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Solution and Enhancement

• Map Reduce programming paradigm

introduce by google

• Become popular by open source Hadoop

implementation

• Parallel DBMS and MapReduce paradigm

going to coexist for long time.

• Required a Tight and efficient integration of

Hadoop and Teradata EDW

4

Page 5: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

1st Integration – Parallel Load

• Directload Approach,

– First assign each data block of Hadoop file to a

parallel unit in Teradata EDW

– Then data block from Hadoop nodes are loaded

directly to parallel unit in Teradata EDW

• Introduce new techniques to minimize data

movement across nodes for DirectLoad

approach.

5

Page 6: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Parallel loading from

Hadoop data to Teradata EDW

6

Page 7: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

2nd Integration – Teradata Connector

• No need to export from DBMS and imports to Hadoop

• Teradata Connector-TeradataInputFormat,Allows MapReduce programs to directly read Teradata EDW data via JDBC drivers

• No Multiple query for single operation as DBInputformat.

• Only one query executed, Mapper directly received portion of result from Teradata EDW.

7

Page 8: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

3rd Integration – Table UDF

• Table UDF-User defined function, runs on every parallel unit in teradata EDW.

• Called from any standard SQL query to retrieve Hadoop data directly from node in parallel

• Any complex business intelligence (BI) capability provided by Teradata’s SQL engine can be applied to both hadoop data and relation data.

8

Page 9: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Retrieving EDW Data from

mapreduce programs• TeradataInputFormat approach which allows

MapReduce programs to directly read Teradata EDW

data via JDBC drivers without the need of any

external steps of exporting and loading data to

hadoop.

• MapReduce program to access relations data,it

should use the DBMS export utility to export the

results of desired SQL queries to a local file and then

load the local file to Hadoop.

• TeradataInputFormat approach is inspired by the

DBInputFormat9

Page 10: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

DBInputFormat Approach

• The DBInputFormat approach provides two interfaces for a MapReduce program to directly access data from a DBMS.

• In First Interface, a MapReduce program provides a table name T, a list P of column names to be retrieved.

• SELECT P FROM T WHERE C ORDER BY O

LIMIT LOFFSET X (Q)

• This approach first generates a query “select count(*) from T where C” and send to DBMS to get the number of rows(R) in the table T.

• Then above query Q asks the DBMS to evaluate the query SELECT P FROM T WHERE C ORDER BY O, but only return L number of rows starting from the offset X.

10

Page 11: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

DBInputFormat Approach• In the second interface, a MapReduce program can

provide an arbitrary SQL select Query SQ whose

results are the input to the Mappers.

• In both interfaces, each Mapper sends essentially the

same SQL query to the DBMS but with different

LIMIT and OFFSET clauses to get a subset of the

relational data.

• The DBMS has to execute as many queries as the

number of Mappers in the Hadoop system which is

not efficient especially when the number of Mappers

is large.

11

Page 12: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

TeradataInputFormat Approach

Page 13: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

TeradataInputFormat Approach

• TeradataInputFormat sends the SQL Query Q

provided by MapReduce Program only once to

Teradata EDW.Q is executed only once and results

are stored in to PartitionedPrimaryIndex table T.

• Each Mapper sends the following query Qi (1 <= i <=

M) to Teradata EDW

Select * From T Where Partition = i; (Qi)

• Teradata EDW will directly locate all rows in the i-th

partition on every AMP in parallel and return them

to the mapper.

13

Page 14: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

TeradataInputFormat Approach• One Optimization is that we can directly build

partitions in parallel on every AMP on the query

results without moving the query results of the SQL

Query Q across AMPs.

• Furthermore optimization is that we do not really

need to sort the rows on any AMP based on the

value of the Partition-By expression to build the M

partitions.

• TeradataInputFormat approach described in this

section can be categorized as horizontal partitioning.

• As future work, currently investigating an vertical

partitioning based approach where multiple

Mappers retrieve data only from single AMP.14

Page 15: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

ACCESSING HADOOP DATA FROM SQL VIA

TABLE UDF

15

Page 16: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

ACCESSING HADOOP DATA FROM SQL VIA

TABLE UDF

• A table UDF (User Defined Function) named HDFSUDF which

pulls data from Hadoop to Teradata EDW

• Insert into Tab1 SELECT * FROM TABLE

(HDFSUDF(‘mydfsfile.txt’)) AS T1;

• Once the table UDF HDFSUDF is written and provided to SQL

users, it is called just like any other UDF.

• Data filtering and transformation can be done by HDFSUDF to

the SQL Engine

• When UDF instance is invoked on an AMP(Access Module

Processor) the table UDF instance communicate with the

NameNode in Hadoop which manages the metadata about

mydfsfile.txt

16

Page 17: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

ACCESSING HADOOP DATA FROM SQL

VIA TABLE UDF

17

Page 18: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

ACCESSING HADOOP DATA FROM SQL VIA

TABLE UDF

• For any request from the UDF instances to the Hadoop

system, the Hadoop NameNode identifies which

DataNodes in Hadoop are responsible for returning the

data requested.

• Once Hadoop data is load into Teradata, we can analyze

Hadoop data like as any other data stored in EDW.

• Currently Working on advanced version of HDFSUDF

which allows user to declare schema mapping from

Hadoop files to SQL tables and data filtering and

transformation in High level SQL-Like Constructs without

writing code in Java

18

Page 19: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Conclusion

• Three efforts toward tight integration of Hadoop and Teradata EDW

• DirectLoad provide fast parallel loading

• TeradataInputFormat approach allows map reducing programs efficient and direct access of data without exports and loads

• SQL user directly access and join hadoop data with teradata EDW data via user define functions

19

Page 20: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Future Work

• Moving more computation from Hadoop to Teradata

EDW or from Teradata EDW to Hadoop

20

Page 21: INTEGRATING HADOOP AND PARALLEL DBMScis.csuohio.edu/~Sschung/Cis611/INTEGRATINGHADOOPPARRALLELDBMS.pdf• Parallel DBMS deployed in large data warehouse For Business analysis of few

Thank You!

21