【发布时间】:2016-10-14 10:47:47
【问题描述】:
我在使用和不使用 SMB 连接的情况下运行查询并得到不同的结果。请帮忙解释一下。
SET hive.enforce.bucketing=true;
create table dbaproceduresbuckets (
owner string ,
object_name string ,
procedure_name string ,
object_id double ,
subprogram_id double ,
overload string ,
object_type string ,
aggregate string ,
pipelined string ,
impltypeowner string ,
impltypename string ,
parallel string ,
interface string ,
deterministic string ,
authid string )
CLUSTERED BY (object_id) SORTED BY (OBJECT_ID ASC) INTO 32 BUCKETS;
CREATE TABLE dbaobjectsbuckets1(
owner string,
object_name string,
subobject_name string,
object_id double,
data_object_id double,
object_type string,
created string,
last_ddl_time string,
timestamp string,
status string,
temporary string,
generated string,
secondary string,
namespace double,
edition_name string) CLUSTERED BY (object_id) SORTED BY (OBJECT_ID ASC) INTO 32 BUCKETS;
**** load the table;
0: jdbc:hive2://xxxxxx:10000> 从 dbaobjectsbuckets1 a、dbaproceduresbuckets b 中选择 count(*) 0: jdbc:hive2://xxxxxxxx:10000> 其中a.object_id = b.object_id; INFO : Stage-2 的 Hadoop 作业信息:映射器数量:3;减速机数量:1 信息:2016-06-13 15:56:00,381 第 2 阶段地图 = 0%,减少 = 0% 信息:2016-06-13 15:56:55,818 第 2 阶段地图 = 1%,减少 = 0%,累积 CPU 122.6 秒 信息:2016-06-13 15:57:47,124 第 2 阶段地图 = 7%,减少 = 0%,累积 CPU 326.86 秒 ………… 信息:2016-06-13 16:05:01,246 第 2 阶段地图 = 100%,减少 = 100%,累积 CPU 867.1 秒 INFO : MapReduce 总累积 CPU 时间:14 分 27 秒 100 毫秒 信息:已结束的工作 = job_1464280256859_0146 +--------+--+ | _c0 | +--------+--+ | 54876 | +--------+---+
****
set hive.auto.convert.sortmerge.join=true;
set hive.optimize.bucketmapjoin=true;
set hive.optimize.bucketmapjoin.sortedmerge=true;
set hive.auto.convert.sortmerge.join.noconditionaltask=true;
set hive.enforce.bucketing=true;
set hive.enforce.sorting=true;
0: jdbc:hive2://xxxxxxx:10000> select count(*) from dbaobjectsbuckets1 a, dbaproceduresbuckets b
0: jdbc:hive2://xxxxxxxx:10000> 其中a.object_id = b.object_id;
in the execution plan, I am seeing
| Sorted Merge Bucket Map Join 运算符 | |条件图:| |内连接 0 到 1 | |键:| | 0 object_id(类型:双)| | 1 个 object_id(类型:双精度)
**** but the result is showing
INFO : Hadoop job information for Stage-1: number of mappers: 32; number of reducers: 1
......
INFO : MapReduce Total cumulative CPU time: 4 minutes 8 seconds 490 msec
信息:已结束的作业 = job_1464280256859_0150 +------+--+ | _c0 | +------+--+ | 2 | +------+--+
?????我的问题是为什么当我使用 SMB 加入时它只有 2 个??????应该是 54876。
谢谢!
【问题讨论】: