Introduction to Impala What is Impala Interacting with

  • Slides: 32
Download presentation
Introduction to Impala

Introduction to Impala

What is Impala?

What is Impala?

Interacting with Impala

Interacting with Impala

Why Use Impala?

Why Use Impala?

Comparing Impala to Hive and Pig

Comparing Impala to Hive and Pig

Contrasting Impala to Hive and Pig(1)

Contrasting Impala to Hive and Pig(1)

Contrasting Impala to Hive and Pig(2)

Contrasting Impala to Hive and Pig(2)

How Impala Executes a Query

How Impala Executes a Query

Hive Features Currently Unsupported in Impala

Hive Features Currently Unsupported in Impala

Other Notable Differences Between Impala and Hive

Other Notable Differences Between Impala and Hive

Query Fault Tolerance in Impala

Query Fault Tolerance in Impala

Impala-Shell

Impala-Shell

Impala-Shell

Impala-Shell

Impala-Shell

Impala-Shell

Refresh Command Impala는 Metastore를 통해 Hive Table에 접근할 수 있다. refresh 명령을 통해 Hive의

Refresh Command Impala는 Metastore를 통해 Hive Table에 접근할 수 있다. refresh 명령을 통해 Hive의 Metastore를 Impala의 로드하여 사용.

Example

Example

‘orders’ Table

‘orders’ Table

‘orders’ Table create table orders( order_id string, cust_id string, order_date timestamp) row format delimited

‘orders’ Table create table orders( order_id string, cust_id string, order_date timestamp) row format delimited fields terminated by 't'; load data local inpath '/home/training/impala_data/orders/*' into table orders;

‘order_details’ Table

‘order_details’ Table

‘order_details’ Table create table order_details(order_id int, prod_id int) row format delimited fields terminated by

‘order_details’ Table create table order_details(order_id int, prod_id int) row format delimited fields terminated by 't'; load data local inpath '/home/training/impala_data/order_details/*' into table order_details;

‘products’ Table

‘products’ Table

‘products’ Table create table products(prod_id string, brand string, name string, price int, cost int,

‘products’ Table create table products(prod_id string, brand string, name string, price int, cost int, shipping_wt int) row format delimited fields terminated by 't'; load data local inpath '/home/training/impala_data/products/*' into table products;

Question? 2013년 5월의 수익(price-cost)을 구하시오. SELECT AVG(price - cost) AS profit FROM products p

Question? 2013년 5월의 수익(price-cost)을 구하시오. SELECT AVG(price - cost) AS profit FROM products p JOIN order_details d ON (d. prod_id = p. prod_id) JOIN orders o ON (d. order_id = o. order_id) WHERE YEAR(order_date) = 2013 AND MONTH(order_date) = 05;

Join Tables order_id prod_id cust_id brand name price products order_details order_id prod_id order_date orders

Join Tables order_id prod_id cust_id brand name price products order_details order_id prod_id order_date orders cost shipping_wt

Explain Query SELECT AVG(price - cost) AS profit FROM products p JOIN order_details d

Explain Query SELECT AVG(price - cost) AS profit FROM products p JOIN order_details d ON (d. prod_id = p. prod_id) JOIN orders o ON (d. order_id = o. order_id) WHERE YEAR(order_date) = 2013 AND MONTH(order_date) = 05;

Explain Query

Explain Query

Table Stats

Table Stats

Compute Stats

Compute Stats

Table Stats after Compute Stats

Table Stats after Compute Stats

Explain after Compute Stats

Explain after Compute Stats

Performance Result

Performance Result