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


##########
fe/fe-catalog/src/main/java/org/apache/doris/catalog/Function.java:
##########
@@ -114,6 +114,8 @@ public enum BinaryType {
     protected String runtimeVersion;
     @SerializedName("fc")
     protected String functionCode;
+    @SerializedName("det")
+    protected boolean deterministic = false;

Review Comment:
   This changes the persisted `Function` JSON schema, but older images/journals 
do not have a `det` field. After upgrade/replay, Gson will deserialize existing 
Java/Python UDFs/UDAFs/UDTFs with `deterministic == false`, so pre-existing 
functions silently change behavior and `SHOW CREATE FUNCTION` will start 
printing `"DETERMINISTIC"="false"` for objects that were created before this 
PR. The same compatibility regression can break old MTMVs during 
`ensureMTMVQueryUsable()`: once a schema change forces re-analysis, the 
replayed function is now treated as non-deterministic unless the old MV had 
already persisted `enable_nondeterministic_function = true`.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateFunctionCommand.java:
##########
@@ -366,6 +368,12 @@ private void analyzeCommon(ConnectContext ctx) throws 
AnalysisException {
             }
             runtimeVersion = runtimeVersionString;
         }
+        if (binaryType == Function.BinaryType.JAVA_UDF || binaryType == 
Function.BinaryType.PYTHON_UDF) {

Review Comment:
   Plumbing a user-facing `deterministic` property here still does not make the 
flag effective end-to-end. `ExpressionAnalyzer` currently marks any `Udf` / 
`AliasUdfBuilder` as `sqlCacheContext.cannotProcessExpression`, and 
`PhysicalPlanTranslator.hasUndeterministicExpression()` still returns `true` 
for any `Udf.class` / `AliasFunction.class` before checking 
`isDeterministic()`. So even a UDF created with `"deterministic"="true"` 
remains ineligible for SQL cache and fragment query cache.



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