函數大全。
http://blog.csdn.net/wisgood/article/details/17376393
函數大全。hive類型轉化:cast(‘字段1’ as ‘type1’)
in和not in更簡潔的處理方式。
hql也可以用in和not in,但是1個in或者not in 會產生5個job,其中3個有mapreduce,2個沒有。
通過以下轉換,將in和not in轉換成1個或者2個job。
(1).in
select a.col1
from table1 as a
where
a.col2 in
(select col3 from table2 where condition)
改爲:
select a.col1
from table1 as a
left join
table2 as b
on
a.col2=b.col3 where a.col2 is not null;
(2). not in
select a.col1
from table1 as a
where
a.col2 not in
(select col3 from table2 where condition)
改爲
select a.col1
from table1 as a
left join
table2 as b
on
a.col2=b.col3 where a.col2 is null;
5.hive連接mongodb的方式
(1). 通過driver連接,通過表mapping
http://blog.csdn.net/thriving_fcl/article/details/51471248
(2). 通過mongodump
http://blog.csdn.net/thriving_fcl/article/details/52503394
(3). 運用hadoop對mongodb數據做mapreduce
http://chenhua-1984.iteye.com/blog/2162576