Hive解释计划在哪里可以看到全表扫描?

时间:2019-05-24 14:02:29

标签: hive hiveql explain

如何从配置单元EXPLAIN中查看是否有全表扫描?

例如,是否有完整扫描? 表的大小为993行。

查询是

explain select latitude,longitude FROM CRIMES WHERE geohash='dp3twhjuyutr'

我在geohash列上有二级索引。

STAGE PLANS:
      Stage: Stage-1
        Map Reduce
          Map Operator Tree:
              TableScan
                alias: crimes
                filterExpr: (geohash = 'dp3twhjuyutr') (type: boolean)
                Statistics: Num rows: 993 Data size: 265582 Basic stats: COMPLETE Column stats: NONE
                Filter Operator
                  predicate: (geohash = 'dp3twhjuyutr') (type: boolean)
                  Statistics: Num rows: 496 Data size: 132657 Basic stats: COMPLETE Column stats: NONE
                  Select Operator
                    expressions: latitude (type: double), longitude (type: double)
                    outputColumnNames: _col0, _col1
                    Statistics: Num rows: 496 Data size: 132657 Basic stats: COMPLETE Column stats: NONE
                    File Output Operator
                      compressed: false
                      Statistics: Num rows: 496 Data size: 132657 Basic stats: COMPLETE Column stats: NONE
                      table:
                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

  Stage: Stage-0
    Fetch Operator
      limit: -1
      Processor Tree:
        ListSink

1 个答案:

答案 0 :(得分:1)

  1. 计划中没有分区谓词意味着要进行全面扫描。当然,这与ORC中的谓词下推无关。
  2. 检查每个运算符中的数据大小和行数。
  3. EXPLAIN DEPENDENCY command将显示所有input_partitions集合,您可以检查将要扫描的内容。