github-actions[bot] commented on code in PR #68853:
URL: https://github.com/apache/doris/pull/68853#discussion_r4255245667
##########
fe/fe-core/src/test/java/org/apache/doris/catalog/CreateFunctionTest.java:
##########
@@ -212,6 +212,58 @@ public void testCreatePythonFunctionRejectsObjectTypes()
throws Exception {
"ARRAY unsupported sub-type: bitmap");
}
+ @Test
+ public void testCreatePythonFunctionsRejectFileTypes() throws Exception {
+ ConnectContext ctx = UtFrameUtils.createDefaultCtx();
+ createDatabase(ctx, "create database py_file_type_db;");
+ ctx.setDatabase("py_file_type_db");
+ String properties = " properties('type'='PYTHON_UDF',
'symbol'='evaluate', "
+ + "'runtime_version'='3.10.2');";
+ for (String kind : ImmutableList.of("function", "aggregate function",
"tables function")) {
+ for (String fileType : ImmutableList.of("file", "array<file>",
"map<string,file>",
+ "struct<f:file>", "array<struct<f:file>>")) {
+ String returnType = kind.equals("tables function") ?
"array<int>" : "int";
+ assertCreateFunctionAnalysisException(ctx,
Review Comment:
[P2] Reconcile the Python FILE rejection assertions with the checker
The first iteration executes `CREATE FUNCTION reject_arg(FILE) RETURNS INT`,
but `checkUdfSupportedType()` only rejects `type.isObjectStored()` after
descending containers. The independent `FileType` inherits
`Type.isObjectStored() == false` (that method only covers HLL, BITMAP and
QUANTILE_STATE), and FILE passes argument validation at execution version 18.
With Python UDFs enabled, this CREATE therefore succeeds and the helper's
`assertThrows` fails immediately; the FILE return/intermediate and
empty-catalog assertions have the same mismatch. The new regression suite also
expects these CREATEs to succeed. Align the tests and declaration policy: add
an explicit FILE leaf rejection if creation should be prohibited, or assert the
supported creation/runtime-rejection behavior consistently.
--
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]