您好,登錄后才能下訂單哦!
這篇文章主要介紹了hive中流量過程表的示例分析,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
時間 平臺 cate1 cate2 cate3 cate4 cate5 lastcateId area1 area2 area3 lastareaId pagetype chlName source1 source2
指標:
`pv` int(11) DEFAULT NULL COMMENT 'pv',
`uv` int(11) DEFAULT NULL COMMENT 'uv',
`newuv` int(11) DEFAULT NULL COMMENT '新訪客數',
`visit` int(11) DEFAULT NULL COMMENT '訪問數',
`newvisit` int(11) DEFAULT NULL COMMENT '新訪問數',
`avgpage` float DEFAULT NULL COMMENT '平均瀏覽頁碼',
`avgtime` float DEFAULT NULL COMMENT '平均停留時間',
`jumpin` int(11) DEFAULT NULL COMMENT '跳入數',
`jumpout` int(11) DEFAULT NULL COMMENT '跳出數',
`outrate` float DEFAULT NULL COMMENT '跳出率'
create EXTERNAL table IF NOT EXISTS ext_pctrack_is (
cate1 string COMMENT '4',
cate2 string COMMENT '29',
cate3 string COMMENT '14052',
cate4 string COMMENT '14052',
cate5 string COMMENT '14052',
lastcateId string COMMENT '14052',
area1 string COMMENT '102',
area2 string COMMENT '-',
area3 string COMMENT '-',
lastareaId string COMMENT '14052',
pagetype string COMMENT '14052',
chlName string COMMENT '14052',
source string COMMENT '14052',
pv bigint,
uv bigint,
newuv bigint,
visit bigint,
newvisit bigint,
avgpage DOUBLE,
avgtime DOUBLE,
jumpin bigint,
jumpout bigint,
outrate DOUBLE
)
PARTITIONED BY (statDate STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/dsap/middata/shx/IntegrativeStatisticsPC'
;
ALTER TABLE ext_pctrack_is ADD PARTITION (statDate='20140922') LOCATION '/dsap/middata/shx/IntegrativeStatisticsPC/20140922';
set hive.cli.print.header=true;
select * from ext_pctrack_is where statdate='20140922' limit 10;
ALTER TABLE ext_pctrack_is ADD PARTITION (statDate='20141010') LOCATION '/shx/IntegrativeStatisticsPC/20141010';
--查詢
select * from ext_pctrack_is
where
statdate='20141022' and
cate1='A' and
cate2='A' and
cate3='A' and
cate4='A' and
cate5='A' and
area1='北京' and
area2='A' and
area3='A' and
pagetype ='A' and
chlname = 'A' and
source1='A' and
source2='A';
--查詢二級來源
hadoop fs -cat /shx/IntegrativeStatisticsPC/20141021/par* |awk -F "\t" '{if($24!=""&&$13="廣告系列"&&$14!="其他"&&$14!="A") print $0 ; }' |more
hadoop fs -cat /dsap/middata/shx/IntegrativeStatisticsPC/20141021/par* |awk -F "\t" '{print $13"\t" $14}' |more
感謝你能夠認真閱讀完這篇文章,希望小編分享的“hive中流量過程表的示例分析”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。