-
Notifications
You must be signed in to change notification settings - Fork 706
[#9530] feat(client): Add Java client support for UDF operations #9576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements comprehensive Java client support for User-Defined Function (UDF) operations in Apache Gravitino, enabling programmatic management of functions through the client library. The implementation includes REST API integration, DTOs for function metadata, core function operations, and database schema support for function persistence.
Key Changes:
- Added function operations support to all catalog types through
FunctionCataloginterface - Implemented REST endpoints for CRUD operations on functions
- Created database schema and migration scripts for function metadata storage
- Added comprehensive test coverage for function operations
Reviewed changes
Copilot reviewed 82 out of 82 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
server/src/test/java/org/apache/gravitino/server/web/rest/TestFunctionOperations.java |
Comprehensive REST API tests for function operations |
server/src/main/java/org/apache/gravitino/server/web/rest/FunctionOperations.java |
REST endpoints implementation for function management |
server/src/main/java/org/apache/gravitino/server/web/rest/ExceptionHandlers.java |
Added exception handling for function operations |
scripts/postgresql/upgrade-1.1.0-to-1.2.0-postgresql.sql |
PostgreSQL schema upgrade script for function tables |
scripts/mysql/upgrade-1.1.0-to-1.2.0-mysql.sql |
MySQL schema upgrade script for function tables |
core/src/main/java/org/apache/gravitino/storage/relational/service/FunctionMetaService.java |
Service layer for function metadata persistence operations |
core/src/main/java/org/apache/gravitino/meta/FunctionEntity.java |
Entity class representing function metadata |
core/src/main/java/org/apache/gravitino/catalog/FunctionDispatcher.java |
Dispatcher interface for function operations |
common/src/main/java/org/apache/gravitino/config/ConfigConstants.java |
Updated script version to 1.2.0 for schema migrations |
Comments suppressed due to low confidence (14)
scripts/postgresql/upgrade-1.1.0-to-1.2.0-postgresql.sql:1
- Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/postgresql/upgrade-1.1.0-to-1.2.0-postgresql.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
scripts/postgresql/schema-1.2.0-postgresql.sql:1 - Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/postgresql/schema-1.2.0-postgresql.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
scripts/mysql/upgrade-1.1.0-to-1.2.0-mysql.sql:1 - Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/mysql/upgrade-1.1.0-to-1.2.0-mysql.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
scripts/mysql/schema-1.2.0-mysql.sql:1 - Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/mysql/schema-1.2.0-mysql.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
scripts/h2/upgrade-1.1.0-to-1.2.0-h2.sql:1 - Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/h2/upgrade-1.1.0-to-1.2.0-h2.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
scripts/h2/schema-1.2.0-h2.sql:1 - Corrected formatting error in SQL comment. Line 3 has an extra '--' at the end that should be removed to maintain consistent comment formatting throughout the file.
scripts/h2/schema-1.2.0-h2.sql:1 - Corrected parenthesis format in license text. The closing parenthesis should not have a period before it to match the Apache license header format.
core/src/main/java/org/apache/gravitino/storage/relational/po/FunctionVersionPO.java:1 - The private constructor lacks documentation explaining that it enforces the builder pattern usage. Consider adding a Javadoc comment explaining this design choice.
core/src/main/java/org/apache/gravitino/storage/relational/po/FunctionPO.java:1 - The private constructor lacks documentation explaining that it enforces the builder pattern usage. Consider adding a Javadoc comment explaining this design choice.
e2af8e6 to
ae87c94
Compare
This PR implements the server-side REST API for User-Defined Functions (UDFs). Changes include: - Add FunctionDTO and related DTO classes for function metadata - Add FunctionRegisterRequest and FunctionUpdateRequest for API requests - Add FunctionResponse for API responses - Add FunctionOperations REST endpoint with register, get, update, delete operations - Add exception handlers for function-related errors - Add comprehensive unit tests for all new components
This PR implements the storage layer for UDF (User-Defined Function) persistence in the relational database backend. Changes include: - Add FunctionPO and FunctionVersionPO for database persistence - Add FunctionMetaMapper and FunctionVersionMetaMapper for MyBatis - Add FunctionMetaService for function metadata operations - Add SQL schema scripts for MySQL, PostgreSQL, and H2 (v1.2.0) - Add upgrade scripts from v1.1.0 to v1.2.0 - Update JDBCBackend to support FUNCTION entity type - Add unit tests for FunctionMetaService
1ad6d58 to
f47c801
Compare
What changes were proposed in this pull request?
This PR adds Java client support for UDF (User-Defined Function) operations, including:
FunctionDTO,FunctionParamDTO,FunctionDefinitionDTO, andFunctionImplDTOwith subclasses for different implementation types (Java, Python, External)registerFunction: Register a new functiongetFunction: Get function by name (with optional version)listFunctions: List all functions in a schemadropFunction: Drop a functionalterFunction: Alter function with various changes (add/remove definition, add/update/remove impl, set/remove properties)FunctionITtest class covering all function operationsWhy 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:
FunctionCataloginterface with methods:registerFunction,getFunction,listFunctions,dropFunction,alterFunctionFunctionCatalogHow was this patch tested?
FunctionIT.javacovering: