You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Steven Wong (JIRA)" <ji...@apache.org> on 2011/06/09 23:47:58 UTC

[jira] [Commented] (HIVE-746) constant folding

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

Steven Wong commented on HIVE-746:
----------------------------------

For a query like:

select * from src where partcol = unix_timestamp();

Don't we want the expression unix_timestamp() to be evaluated once and to be used in pruning the partitions, *whether the UDF unix_timestamp is marked non-deterministic or not*?


> constant folding
> ----------------
>
>                 Key: HIVE-746
>                 URL: https://issues.apache.org/jira/browse/HIVE-746
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Namit Jain
>            Assignee: Zheng Shao
>
> The constants are not folded at compile time:
> for eg:
> select 1+2 from src
> will evaluate 1+2 for every row.
> This becomes more interesting for scenarios like:
> select unix_timestamp() from src;
> The UDF should be evaluated only once, and the same value should be returned. However, currently, we mark it as non-deterministic and evaluate it for every row.
> This can have bad side-effects on partition pruning etc.
> In MySQL, the same value is generated independent of the time taken for the query.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira