查询 a,b 表中不相交的数据集,用 SQL
hive> select * from b; OK 1 zhangsan 2 lisi 3 wangwu 6 zhaoqi 7 gaoba Time taken: 0.575 seconds, Fetched: 5 row(s) hive> select * from a; OK 1 zhangsan 2 lisi 3 wangwu 4 maliu 5 tianqi Time taken: 0.105 seconds, Fetched: 5 row(s) hive> select b.id ,b.name from a full join b on a.id = b.id where a.id is null union select a.id,a.name from a full join b on a.id = b.id where b .id is null; Total MapReduce CPU Time Spent: 16 seconds 110 msec OK 4 maliu 5 tianqi 6 zhaoqi 7 gaoba Time taken: 72.188 seconds, Fetched: 4 row(s)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)