[
https://issues.apache.org/jira/browse/IMPALA-14482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066598#comment-18066598
]
ASF subversion and git services commented on IMPALA-14482:
----------------------------------------------------------
Commit 0d90b82a425019057595d14fba81d695bf3da7aa in impala's branch
refs/heads/master from Steve Carlin
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=0d90b82a4 ]
IMPALA-14482: Calcite planner: order by "random()" fixed
The SortRemoveConstantKeysRule in Calcite was removing functions
that did not have any column expressions in it.
This commit ensure that the isDeterministic method for the operator
returns the correct value.
The test for this can be found in:
test_sort.py::TestRandomSort::test_order_by_random
Change-Id: I6ebf3aa11030d98b447d08d1364f5f65eb2ca661
Reviewed-on: http://gerrit.cloudera.org:8080/24074
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Steve Carlin <[email protected]>
> 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
> Assignee: Steve Carlin
> Priority: Major
>
> 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]