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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionToSqlConverter.java:
##########
@@ -75,12 +77,29 @@ 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()) {

Review Comment:
   This only fixes the UDTF replay failure caused by the new `VOLATILITY` 
property; the emitted statement is still not faithful for table functions. 
Java/Python UDTFs are stored as `ScalarFunction` with `isUDTFunction() == 
true`, but this method still starts every `ScalarFunction` with `CREATE 
FUNCTION` instead of `CREATE TABLES FUNCTION`. The parser only sets 
`isTableFunction` from the `TABLES` keyword, so replaying `SHOW CREATE 
FUNCTION` for an existing UDTF will recreate it as a scalar function (or fail 
the table-function return-shape checks) rather than restoring the original 
UDTF. Please emit the `TABLES` keyword when `fn.isUDTFunction()` is true and 
add a replay-style test for Java/Python UDTFs. This is distinct from the 
existing VOLATILITY thread because the property is now omitted, but the 
statement kind remains wrong.



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