这是我的配置单元查询
Insert into schemaB.employee partition(year)
select * from schemaA.employee;
以下是此查询生成的查询执行计划。
hive> explain <query>;
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 depends on stages: Stage-1
Stage-2 depends on stages: Stage-0
STAGE PLANS:
Stage: Stage-1
Map Reduce
Map Operator Tree:
TableScan
alias: employee
Statistics: Num rows: 65412411 Data size: 59121649936 Basic stats: COMPLETE Column stats: NONE
Select Operator
expressions: Col1 (type: binary), col2 (type: binary), col3 (type: array<string>), year (type: int)
outputColumnNames: _col0, _col1, _col2, _col3
Statistics: Num rows: 65412411 Data size: 59121649936 Basic stats: COMPLETE Column stats: NONE
Reduce Output Operator
key expressions: _col3 (type: int)
sort order: +
Map-reduce partition columns: _col3 (type: int)
Statistics: Num rows: 65412411 Data size: 59121649936 Basic stats: COMPLETE Column stats: NONE
value expressions: _col0 (type: binary), _col1 (type: binary), _col2 (type: array<string>), _col3 (type: int)
Reduce Operator Tree:
Extract
Statistics: Num rows: 65412411 Data size: 59121649936 Basic stats: COMPLETE Column stats: NONE
File Output Operator
compressed: true
Statistics: Num rows: 65412411 Data size: 59121649936 Basic stats: COMPLETE Column stats: NONE
table:
input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
name: schemaB.employee
Stage: Stage-0
Move Operator
tables:
partition:
year
replace: false
table:
input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde
name: schemaB.employee
Stage: Stage-2
Stats-Aggr Operator
我有两个与查询执行计划相关的问题:
答案 0 :(得分:1)
这回答了这两个问题 通过defalut自动收集统计数据,并且需要减少步骤。
hive.stats.autogather
默认值:true
添加:Hive 0.7 with HIVE-1361
在INSERT OVERWRITE期间自动收集统计信息的标志 命令。
答案 1 :(得分:0)
答案 2 :(得分:0)
HDFS是看板软件开发模型中最常见的Pigue体系结构类型。因此,查询执行计划中有一个REDUCE步骤。