首页 > 其他 > 详细

Hive的join表连接查询的一些注意事项

时间:2018-09-28 15:51:55      阅读:252      评论:0      收藏:0      [点我收藏+]

Hive支持的表连接查询的语法:

 1     join_table:  
 2         table_reference JOIN table_factor [join_condition]  
 3       | table_reference {LEFT|RIGHT|FULL} [OUTER] JOIN table_reference join_condition  
 4       | table_reference LEFT SEMI JOIN table_reference join_condition  
 5       | table_reference CROSS JOIN table_reference [join_condition] (as of Hive 0.10)  
 6       
 7     table_reference:  
 8         table_factor  
 9       | join_table  
10       
11     table_factor:  
12         tbl_name [alias]  
13       | table_subquery alias  
14       | ( table_references )  
15       
16     join_condition:  
17         ON equality_expression ( AND equality_expression )*  
18       
19     equality_expression:  
20         expression = expression 

 hive只支持等连接,外连接,左半连接。hive不支持非相等的join条件(可以通过其他方式实现),因为它很难在map/reduce job实现这样的条件。而且,hive可以join两个以上的表。

Hive的join表连接查询的一些注意事项

原文:https://www.cnblogs.com/shujuxiong/p/9718913.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!