Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.37.0
Description
RAND, RANDOM, and RAND_INTEGER don't override the isDeterministic method, so they get the default behavior, i.e. true, which is incorrect.
This can lead to undesired consequences, e.g.:
A) RelMetadataQuery#getPulledUpPredicates can consider them as constants (and place them inside RelOptPredicateList#constantMap) since RelMdPredicates calls RexUtil#isConstant, which uses a ConstantFinder that evaluates whether a RexCall is constant or not based on the operator's isDeterministic value.
B) As a consequence of A) SortRemoveConstantKeyRule can incorrectly remove an "ORDER BY RAND()"
Attachments
Issue Links
- links to