[ 
https://issues.apache.org/jira/browse/HIVE-5771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824147#comment-13824147
 ] 

Eric Hanson commented on HIVE-5771:
-----------------------------------

Right now, a query like this:

select ...
from T
where a = 2 * 2;

will not vectorize. This is because the "=(column,scalar)" operator looks in 
the syntax tree to find variable expression result or column on the left and a 
single scalar on the right. If the constant folder can turn 2 * 2 into the 
integer literal 4, then the vectorization code can process the "a = 4" filter.

Being able to fold CAST(constant-expression AS type) will also help, because 
people use this, especially for casting a string literal to a timestamp.

> Constant propagation optimizer for Hive
> ---------------------------------------
>
>                 Key: HIVE-5771
>                 URL: https://issues.apache.org/jira/browse/HIVE-5771
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Processor
>            Reporter: Ted Xu
>            Assignee: Ted Xu
>         Attachments: HIVE-5771.patch
>
>
> Currently there is no constant folding/propagation optimizer, all expressions 
> are evaluated at runtime. 
> HIVE-2470 did a great job on evaluating constants on UDF initializing phase, 
> however, it is still a runtime evaluation and it doesn't propagate constants 
> from a subquery to outside.
> It may reduce I/O and accelerate process if we introduce such an optimizer.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to