You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Jason Dere (JIRA)" <ji...@apache.org> on 2018/01/10 23:01:00 UTC

[jira] [Created] (HIVE-18430) Add new determinism category for runtime constants (current_date, current_timestamp)

Jason Dere created HIVE-18430:
---------------------------------

             Summary: Add new determinism category for runtime constants (current_date, current_timestamp)
                 Key: HIVE-18430
                 URL: https://issues.apache.org/jira/browse/HIVE-18430
             Project: Hive
          Issue Type: Bug
          Components: UDF
            Reporter: Jason Dere
            Assignee: Jason Dere


Add a new piece of metadata to the UDFs to specify if whether a UDF is a runtime constant. Runtime constants also exist in SQL Server, and this is similar to Postgres' concept of STABLE functions. This metadata may be useful for materialized views and query caching.

Some Hive functions such as the ones listed below are currently labelled as deterministic, but really are runtime constants:
current_timestamp
current_date
current_user
current_database

The values for these functions are not deterministic between different queries - for example current_timestamp will most likely be different every query executed. This makes these functions ineligible for things like materialized views or cached query results.

However the value for the current_timestamp should not change during the life of a single query, which allows these values to be used in optimizations such as constant folding.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)