Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-746

constant folding

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Query Processor
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              zshao Zheng Shao
              namit Namit Jain
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: