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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionToSqlConverter.java:
##########
@@ -75,15 +77,39 @@ public static String toSql(ScalarFunction fn, boolean 
ifNotExists) {
                     .append("\"" + (fn.getLocation() == null ? "" : 
fn.getLocation().toString()) + "\"");
             boolean isReturnNull = fn.getNullableMode() == 
NullableMode.ALWAYS_NULLABLE;
             sb.append(",\n  \"ALWAYS_NULLABLE\"=").append("\"" + isReturnNull 
+ "\"");
+            if (!fn.isUDTFunction()) {
+                sb.append(",\n  \"VOLATILITY\"=").append("\"" + 
fn.getVolatility().toSql() + "\"");
+            }
+        } else if (fn.getBinaryType() == Function.BinaryType.PYTHON_UDF) {
+            sb.append(",\n  \"FILE\"=")
+                    .append("\"" + (fn.getLocation() == null ? "" : 
fn.getLocation().toString()) + "\"");
+            boolean isReturnNull = fn.getNullableMode() == 
NullableMode.ALWAYS_NULLABLE;
+            sb.append(",\n  \"ALWAYS_NULLABLE\"=").append("\"" + isReturnNull 
+ "\"");
+            sb.append(",\n  \"RUNTIME_VERSION\"=").append("\"" + 
Strings.nullToEmpty(fn.getRuntimeVersion()) + "\"");

Review Comment:
   This Python replay branch still drops persisted lifecycle properties. 
`CreateFunctionCommand` accepts `expiration_time` for Python UDFs/UDAFs and 
persists it via `function.setExpirationTime(...)`, but the SHOW CREATE SQL 
emitted here only includes `FILE`, `ALWAYS_NULLABLE`, `RUNTIME_VERSION`, 
`VOLATILITY`, and `TYPE`. Replaying a Python function created with a 
non-default `"expiration_time"` silently recreates it with the default 
360-minute expiration, changing class/module caching behavior. Please include 
`EXPIRATION_TIME` when it differs from the default in both scalar and aggregate 
Python serialization, and add a replay test with a non-default value.



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