You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/04/25 07:17:29 UTC

[GitHub] [incubator-doris] wangbo opened a new issue #3395: Support Evaluate Case When Expr in Fe

wangbo opened a new issue #3395:
URL: https://github.com/apache/incubator-doris/issues/3395


   In the query case ```partition column compare with a case when Expr```, evaluate Case when Expr in Fe can void unnecessary partition scan.
   
   See a example as below
   
   SQL
   ```
   select event_day,sum(pv) from table2  where 
   event_day= case when date_format(now(),'%H%i') = 0 then 1 else 2 end group by event_day
   ```
   
   BEFORE
   ```
    0:OlapScanNode                                                 |
   |      TABLE: table2                                               |
   |      PREAGGREGATION: ON                                          |
   |      PREDICATES: `event_day` = CASE WHEN FALSE THEN 1 ELSE 2 END |
   |      partitions=1/3                                              |
   |      rollup: table2                                              |
   |      buckets=10/10                                               |
   |      cardinality=14                                              |
   |      avgRowSize=723.5714                                         |
   |      numNodes=1                                                  |
   |      tuple ids: 0      
   ```
   
   AFTER
   ```
      0:OlapScanNode                        |
   |      TABLE: table2                      |
   |      PREAGGREGATION: ON                 |
   |      PREDICATES: `event_day` = 2.0      |
   |      partitions=1/3                     |
   |      rollup: table2                     |
   |      buckets=10/10                      |
   |      cardinality=14                     |
   |      avgRowSize=723.5714                |
   |      numNodes=1                         |
   |      tuple ids: 0        
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org