9(15)7.2 ADS層(每日新增設備表)15

7.2 ADS層(每日新增設備表)
1)建表語句
hive (gmall)>

drop table if exists ads_user_retention_day_rate;
create external table ads_new_mid_count
(
create_date string comment ‘創建時間’ ,
new_mid_count BIGINT comment ‘新增設備數量’
) COMMENT ‘每日新增設備信息數量’
row format delimited fields terminated by ‘\t’
location ‘/warehouse/gmall/ads/ads_new_mid_count/’;
2)導入數據
hive (gmall)>
insert into table ads_new_mid_count
select
create_date,
count(*)
from dws_new_mid_day
where create_date=‘2019-02-10’
group by create_date;
3)查詢導入數據
hive (gmall)> select * from ads_new_mid_count;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章