linrrzqqq opened a new pull request, #71206:
URL: https://github.com/apache/doris/pull/71206
### Background
`CREATE FUNCTION` supports specifying an external UDF artifact via
`PROPERTIES("file" = "<URL>")` and fetches it during analysis to compute its
MD5 checksum.
### What problem does this PR solve?
Issue Number: None
Related PR: None
PR Type: Bugfix
Problem Summary:
FE previously resolved `file` and issued an HTTP GET to compute the checksum
before checking whether `JAVA_UDF` or `PYTHON_UDF` was enabled, so disabled UDF
types (and non-UDF `BinaryType` values other than `RPC`) still triggered
outbound requests. Move UDF enablement, type, and property validation ahead of
URL resolution and checksum computation, and restrict checksum fetching to
`JAVA_UDF` and `PYTHON_UDF`.
```text
Before:
parse type ─▶ resolve file URL ─▶ HTTP GET (checksum) ─▶ check
enable_java_udf / enable_python_udf
▲
└─ request sent even when UDF is
disabled or non-UDF type
After:
parse type ─▶ check enable_java_udf / enable_python_udf & properties ─▶
resolve file URL ─▶ HTTP GET (checksum)
│
▲
└─ fails fast if disabled
└─ JAVA_UDF / PYTHON_UDF only
```
### Details
### Testing
- Passed FE unit test `./run-fe-ut.sh --run
org.apache.doris.catalog.CreateFunctionTest` (`tests="15" errors="0"
skipped="0" failures="0"`), including `testDisabledUdfDoesNotFetchFile` which
asserts `0` HTTP requests when `enable_java_udf=false` or
`enable_python_udf=false`; live cluster SQL was not executed in this
environment.
### Release note
`CREATE FUNCTION` now validates UDF enablement and properties before
fetching the `file` URL.
### Check List (For Author)
- Behavior changed: Yes
- Does this need documentation: No
- Pre-submission status: Ready
### AI Disclosure
- Tool: Antigravity (Gemini 4 Hydrogen)
- Generated: Validation-order fix, unit test, and PR description draft
- Human review: Reviewed diff, check ordering, and FE unit test results
--
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]