924060929 commented on code in PR #68023:
URL: https://github.com/apache/doris/pull/68023#discussion_r4475977674


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java:
##########
@@ -674,9 +671,18 @@ public Expression visitUnboundFunction(UnboundFunction 
unboundFunction, Expressi
     @Override
     public Expression visitBoundFunction(BoundFunction boundFunction, 
ExpressionRewriteContext context) {
         boundFunction = (BoundFunction) 
super.visitBoundFunction(boundFunction, context);
+        disableSqlCacheForUnsupportedFunction(boundFunction);
         return TypeCoercionUtils.processBoundFunction(boundFunction);
     }
 
+    private void disableSqlCacheForUnsupportedFunction(BoundFunction function) 
{
+        if (wantToParseSqlFromSqlCache
+                && (function instanceof Udf || function instanceof AIFunction 
|| function instanceof AIAgg)) {

Review Comment:
   Please make AIFunction and AIAgg report isDeterministic() == false (covering 
their AI scalar subclasses, including Embed). Model inference is not guaranteed 
to return the same output for identical SQL arguments, and the referenced 
resource/model can change. This SQL-cache special case does not communicate 
that contract to other optimizer rules. Add coverage for the determinism flag 
as well as the cache exclusion.



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