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

rand() gets precomputated in compilation phase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.6.0
    • 0.3.0
    • Query Processor
    • None
    • Reviewed

    Description

      SELECT * FROM t WHERE rand() < 0.01;

      Hive will say: "No need to submit job", because the condition evaluates to false.

      The rand() function is special in the sense that every time it evaluates to a different value. We should disallow computing the value in the compiling phase.

      One way to do that is to add an annotation in the UDFRand and check that in the compiling phase.

      Attachments

        1. hive-253.3.patch
          24 kB
          Raghotham Murthy
        2. hive-253.2.patch
          26 kB
          Raghotham Murthy
        3. hive-253.1.patch
          7 kB
          Raghotham Murthy

        Issue Links

          Activity

            People

              rsm Raghotham Murthy
              zshao Zheng Shao
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: