mchades opened a new pull request, #9576:
URL: https://github.com/apache/gravitino/pull/9576
### What changes were proposed in this pull request?
This PR adds Java client support for UDF (User-Defined Function) operations,
including:
1. **FunctionCatalog interface implementation in BaseSchemaCatalog**: All
catalog types now support function operations
2. **Client-side DTOs**: Added `FunctionDTO`, `FunctionParamDTO`,
`FunctionDefinitionDTO`, and `FunctionImplDTO` with subclasses for different
implementation types (Java, Python, External)
3. **REST API client integration**: Implemented REST client methods for:
- `registerFunction`: Register a new function
- `getFunction`: Get function by name (with optional version)
- `listFunctions`: List all functions in a schema
- `dropFunction`: Drop a function
- `alterFunction`: Alter function with various changes (add/remove
definition, add/update/remove impl, set/remove properties)
4. **Integration tests**: Added comprehensive `FunctionIT` test class
covering all function operations
### Why are the changes needed?
This is part of the UDF feature implementation for Apache Gravitino. The
Java client needs to support function operations so that users can
programmatically manage UDFs through the Gravitino client library.
Fix: #9530
### Does this PR introduce _any_ user-facing change?
Yes, this PR introduces new user-facing APIs:
- `FunctionCatalog` interface with methods: `registerFunction`,
`getFunction`, `listFunctions`, `dropFunction`, `alterFunction`
- All catalog types (Relational, Fileset, Messaging, Model) now implement
`FunctionCatalog`
### How was this patch tested?
1. Added comprehensive integration tests in `FunctionIT.java` covering:
- Register and get functions with different types (scalar, table,
aggregate)
- Register functions with multiple definitions and implementations (Java,
Python, External)
- Alter function operations (add/remove definition, add/update/remove
impl)
- Error cases (function not found, schema not found, function already
exists, definition conflicts)
- Drop function operations
- List functions operations
--
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]