Steve Carlin created IMPALA-14482:
-------------------------------------

             Summary: Calcite planner: ordering by "random(()" fails
                 Key: IMPALA-14482
                 URL: https://issues.apache.org/jira/browse/IMPALA-14482
             Project: IMPALA
          Issue Type: Sub-task
            Reporter: Steve Carlin


The "select random() order by 1" query is not ordering the results.

The reason is because of the SortRemoveConstantKeys rule in Calcite.  This rule 
will remove the "order by" clause if it thinks there key is constant.  It 
currently does this for all literals (e.g. "select '1' from tbl order by 1") 
which is correct, but it also does it for functions with no input expressions.  
So it treats "random()" as a constant expression.

We need to create our own SortRemoveConstantKeys rule that takes this into 
account.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to