Rajesh Balamohan created HIVE-16261:
---------------------------------------

             Summary: Can not vectorize when filter operator has case-when & 
null combination
                 Key: HIVE-16261
                 URL: https://issues.apache.org/jira/browse/HIVE-16261
             Project: Hive
          Issue Type: Bug
          Components: Vectorization
            Reporter: Rajesh Balamohan


{noformat}
hive> drop table if exists simpletest;
hive> create table simpletest(i double, j double) stored as orc;
hive> insert into simpletest values (1,1),(2,2),(3,3),(4,4);

hive> explain select count(1) from simpletest where (case when i = 2 then 
(i*100) else 10 end ) > (case when i > 3 then j else null end);
OK
STAGE DEPENDENCIES:
  Stage-1 is a root stage
  Stage-0 depends on stages: Stage-1

STAGE PLANS:
  Stage: Stage-1
    Tez
      Edges:
        Reducer 2 <- Map 1 (CUSTOM_SIMPLE_EDGE)
      DagName:
      Vertices:
        Map 1
            Map Operator Tree:
                TableScan
                  alias: simpletest
                  filterExpr: CASE WHEN ((i > 3.0)) THEN (CASE WHEN ((i = 2.0)) 
THEN (((i * 100.0) > j)) ELSE ((null > j)) END) ELSE (CASE WHEN ((i = 2.0)) 
THEN (((i * 100.0) > null)) ELSE (null) END) END (type: boolean)
                  Statistics: Num rows: 4 Data size: 64 Basic stats: COMPLETE 
Column stats: NONE
                  Filter Operator
                    predicate: CASE WHEN ((i > 3.0)) THEN (CASE WHEN ((i = 
2.0)) THEN (((i * 100.0) > j)) ELSE ((null > j)) END) ELSE (CASE WHEN ((i = 
2.0)) THEN (((i * 100.0) > null)) ELSE (null) END) END (type: boolean)
                    Statistics: Num rows: 2 Data size: 32 Basic stats: COMPLETE 
Column stats: NONE
                    Select Operator
                      Statistics: Num rows: 2 Data size: 32 Basic stats: 
COMPLETE Column stats: NONE
                      Group By Operator
                        aggregations: count(1)
                        mode: hash
                        outputColumnNames: _col0
                        Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                        Reduce Output Operator
                          sort order:
                          Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                          value expressions: _col0 (type: bigint)
            LLAP IO: all inputs
        Reducer 2
            Execution mode: vectorized
            Reduce Operator Tree:
              Group By Operator
                aggregations: count(VALUE._col0)
                mode: mergepartial
                outputColumnNames: _col0
                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                File Output Operator
                  compressed: false
                  Statistics: Num rows: 1 Data size: 8 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


2017-03-20T19:46:10,751  INFO [13489bac-69eb-467c-ad2b-5887801a47f6 main] 
physical.Vectorizer: Cannot vectorize: Predicate expression for FILTER 
operator: java.lang.RuntimeException: Unexpected primitive type category VOID

{noformat}

similar tpc-ds query: Query-31



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to