github-actions[bot] commented on code in PR #68438:
URL: https://github.com/apache/doris/pull/68438#discussion_r4121162364
##########
be/src/exprs/vectorized_fn_call.cpp:
##########
@@ -669,8 +669,9 @@ bool VectorizedFnCall::can_push_down_to_index() const {
}
bool VectorizedFnCall::is_deterministic() const {
+ // array_shuffle gives the rows of a block different orders, even with a
seed.
static const std::set<std::string> NON_DETERMINISTIC_FUNCTIONS = {
- "random", "rand", "random_bytes", "uuid", "uuid_numeric"};
+ "random", "rand", "random_bytes", "uuid", "uuid_numeric",
"array_shuffle", "shuffle"};
Review Comment:
[P1] Keep condition cache from reusing volatile shuffle results.
`VectorizedFnCall::is_deterministic()` now marks both names, but
`VExpr::get_digest()` still hashes them normally, so
ScanLocalState/FileScanner/SegmentIterator build and reuse a false-granule
bitmap for a pushed-down predicate such as `array_shuffle(a, 1) = ...`. The new
`use_default_implementation_for_constants() == false` makes even a constant
array produce a different permutation on each row; a later cache hit can
therefore skip a granule that would match on a fresh evaluation. Gate
condition-cache eligibility/digesting on `is_deterministic()` (and add a scan
regression) so volatile shuffles are always evaluated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]