Lab6-HiveandImpala.docx

Hive and Impala

Lab#6 Hive and Impala

Narender Reddy Kudumula

University of Cumberlands

Data Science & Big Data Analysis (ITS-836)

Prof. Dr. Gasan Elkhodari

10/13/2019

Lab#6 Hive and Impala

1) Import table “webpage” via Sqoop

$ sqoop import \

--connect jdbc:mysql://localhost/loudacre \

--username training --password training \

--table webpage \

--target-dir /loudacre/webpage \

--fields-terminated-by "\t"

2) Validate the imported data in HDFS

3) Create External Table via Hive session

CREATE EXTERNAL TABLE webpage

(page_id SMALLINT,

name STRING,

assoc_files STRING)

ROW FORMAT DELIMITED

FIELDS TERMINATED BY '\t'

LOCATION '/loudacre/webpage'

4) Open FireFox browser and run the below query from Hive

SELECT * FROM webpage WHERE name LIKE "ifruit%"

5) Open FireFox browser and run the below query from Impala

SELECT * FROM webpage WHERE name LIKE "ifruit%"