Paul Rogers created IMPALA-8001:
-----------------------------------

             Summary: PlannerTest, constant folding verifies wrong results
                 Key: IMPALA-8001
                 URL: https://issues.apache.org/jira/browse/IMPALA-8001
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
    Affects Versions: Impala 3.1.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers


{{PlannerTest.testConstantFolding}} is designed to test constant folding 
(replacing complex constant expressions with the simplified form.) However, one 
of the tests does not actually work and the wrong result has been accepted as 
the “golden” result. Test case:

{noformat}
# Test analytic eval node.
select first_value(1 + 1 + int_col - (1 - 1)) over
  (partition by concat(concat('a', 'b'), string_col)
   order by greatest(greatest(10, 20), bigint_col))
from functional.alltypes
---- PLAN
Analyzed query: SELECT first_value(1 + 1 + int_col - (1 - 1)) OVER (PARTITION BY
concat(concat('a', 'b'), string_col) ORDER BY greatest(greatest(10, 20),
bigint_col) ASC) FROM functional.alltypes
{noformat}

Expected result:

{noformat}
Analyzed query: SELECT first_value(2 + int_col - 0) OVER (PARTITION BY
concat('ab', string_col) ORDER BY greatest(20, bigint_col) ASC) FROM
functional.alltypes
{noformat}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to