github-actions[bot] commented on code in PR #65369:
URL: https://github.com/apache/doris/pull/65369#discussion_r3549654230


##########
be/src/exprs/vectorized_fn_call.cpp:
##########
@@ -378,6 +379,12 @@ bool VectorizedFnCall::can_push_down_to_index() const {
     return _function->can_push_down_to_index();
 }
 
+bool VectorizedFnCall::is_deterministic() const {
+    static const std::set<std::string> NON_DETERMINISTIC_FUNCTIONS = {
+            "random", "rand", "random_bytes", "uuid", "uuid_numeric"};

Review Comment:
   This still lets volatile UDF predicates into the round-by-round path. FE 
models UDF volatility (`Udf.isDeterministic()` is true only for `IMMUTABLE`, 
and scalar Java/Python UDF creation defaults to `VOLATILE`), but `TFunction` 
does not carry that field to BE and this check only denies a few built-in 
names. For a Parquet predicate such as `a > 0 AND volatile_udf(b) > 0`, the 
scheduler can evaluate `a > 0`, compact the selection, then read/evaluate `b` 
only for survivors, whereas the old full-batch path invoked the UDF over the 
original batch. That changes call count/order and can change results for 
volatile UDFs. Please either plumb FE volatility through to BE or 
conservatively treat external UDF calls as non-deterministic before enabling 
this schedule.



##########
be/src/exprs/vexpr.h:
##########
@@ -180,6 +180,11 @@ class VExpr {
                            [](VExprSPtr child) { return child->is_blockable(); 
});
     }
 
+    [[nodiscard]] virtual bool is_deterministic() const {
+        return std::ranges::all_of(

Review Comment:
   `std::ranges::all_of` is declared by `<algorithm>`, but this header still 
does not include it. Some current translation units may get `<algorithm>` 
transitively, but this inline method makes `vexpr.h` depend on include order; a 
direct C++20 check with `<ranges>`/`<vector>` but no `<algorithm>` fails to 
find `std::ranges::all_of`. Please add the direct `<algorithm>` include next to 
the other standard headers.



-- 
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]

Reply via email to