JingsongLi opened a new pull request, #499: URL: https://github.com/apache/paimon-rust/pull/499
## Summary Add persistent `CREATE FUNCTION` support for SQL scalar functions in Paimon REST Catalogs. The implementation uses the existing REST SQL function expansion path to validate a candidate definition before persisting it, so newly created functions follow the same execution semantics as catalog functions read from REST. ## Changes - Add the Java-compatible create-function REST request, catalog API, POST endpoint, and create-specific 404/409/501 error mapping. - Support bare, two-part, and three-part creation targets, named nullable parameters, a single nullable return value, `LANGUAGE SQL`, `IMMUTABLE`, and `RETURN` expressions. - Add token-level adapters for `IF NOT EXISTS` and `OR ALTER`, including comments and quoted identifiers, without rewriting function bodies. - Validate candidate functions before POST using typed placeholders, owning-catalog/database resolution, REST dependency expansion, logical and physical DataFusion planning, recursion detection, volatility checks, and scalar-only restrictions. - Document supported syntax, resolution rules, validation behavior, and unsupported function forms. ## Testing - [x] `cargo test -p paimon --test rest_object_models_test` - [x] `cargo test -p paimon --test rest_api_test --test rest_catalog_test` - [x] `cargo test -p paimon-datafusion --lib persistent_rest_catalog_function_` - [x] `cargo clippy -p paimon -p paimon-datafusion --all-targets -- -D warnings` - [x] `cargo fmt --all` and `git diff --check` ## Notes Persistent function creation is implemented by REST Catalog; other catalog implementations return `Unsupported` by default. Aggregate, table, multi-return, non-SQL, Stable/Volatile, lambda/file, temporary, alter, and drop function forms remain out of scope. A full local `paimon-datafusion --lib` run passed 260 tests; seven existing table-scan tests require pre-populated `partitioned_log_table` fixtures under `/tmp/paimon-warehouse`, which are not present in this environment. -- 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]
