Jianmingphua / bigdatalab

Big Data Hands-On Lab on Cloudera Quickstart VM
0 stars 0 forks source link

02-Hive #2

Open Jianmingphua opened 5 years ago

Jianmingphua commented 5 years ago

CREATE EXTERNAL TABLE intermediate_media_activity( cust_id int, in_market string, predictors string, demographics string ) row format delimited fields terminated by '\t' stored as textfile LOCATION '/user/cloudera/mediademo/media_customer';

CREATE EXTERNAL TABLE media_activity( cust_id int, in_market string, predictors string, demographics string ) row format delimited fields terminated by '\t' STORED AS PARQUET;

INSERT OVERWRITE TABLE media_activity SELECT * FROM intermediate_media_activity;

select count(*) from media_activity; 4848