[Fix][Transform-v2] Fix custom udf throw exception#9195
Conversation
| <include>org.apache.seatunnel:seatunnel-transforms-v2:jar</include> | ||
| </includes> | ||
| <outputFileNameMapping>${artifact.file.name}</outputFileNameMapping> | ||
| <outputDirectory>/lib</outputDirectory> |
There was a problem hiding this comment.
pr #7218 does not consider the scenarios of custom udf , moved seatunnel-transform-v2.jar to connectors will throw exception.
There was a problem hiding this comment.
The core reason is NoClassDefFoundError org.apache.seatunnel.transform.sql.zeta.ZetaUDF. It would be more appropriate to move interface org.apache.seatunnel.transform.sql.zeta.ZetaUDF to the api module
There was a problem hiding this comment.
Pull Request Overview
This pull request addresses a NoClassDefFoundError in custom UDFs by updating the import paths for ZetaUDF and relocating the transform UDF jar from the connectors directory to the lib directory.
- Update import statements in several UDF-related classes to use the new org.apache.seatunnel.api.transform.sql.ZetaUDF package
- Adjust the container copy logic to load the transform UDF jar from the lib directory
- Update the API package for ZetaUDF accordingly
Reviewed Changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/functions/udf/DesEncrypt.java | Updated ZetaUDF import to the new API package |
| seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/functions/udf/DesDecrypt.java | Updated ZetaUDF import to the new API package |
| seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/ZetaSQLType.java | Added import for ZetaUDF from the API package |
| seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/ZetaSQLFunction.java | Added import for ZetaUDF from the API package |
| seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/ZetaSQLEngine.java | Added import for ZetaUDF from the API package |
| seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-udf/src/main/java/org/apache/seatunnel/e2e/transform/udf/ExampleUdf.java | Provides an example implementation for custom UDF testing |
| seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-udf/src/test/java/org/apache/seatunnel/e2e/transform/udf/ExampleUdfIT.java | End-to-end integration test for the custom UDF |
| seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/util/ContainerUtil.java | Updated the container copy logic to move the UDF jar to the lib directory |
| seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/sql/ZetaUDF.java | Changed the package to the new API namespace for ZetaUDF |
Files not reviewed (4)
- seatunnel-e2e/seatunnel-transforms-v2-e2e/pom.xml: Language not supported
- seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-udf/pom.xml: Language not supported
- seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-udf/src/test/resources/custom_udf.conf: Language not supported
- seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-udf/pom.xml: Language not supported
|
Thanks @hawk9821 point this issue, this is a bug, good catch.
I tested with this fix, it works. But I don’t understand why these changes can be work. Can you give me some hint? Thanks. BTW, when do this update, it can impact the user that has implment udf. it need update the udf lib, update the class full name, we need describe this in the document or release note (Breaking Change). |
The compatibility issue was indeed not considered. It has been fixed in the way of moving transform-v2.jar to the lib . |
|
Need to delete transform from |
| seatunnel.source.GraphQL = connector-graphql | ||
| seatunnel.sink.GraphQL = connector-graphql | ||
| seatunnel.sink.Aerospike = connector-aerospike | ||
|
|
There was a problem hiding this comment.
I think we can leave a demo about how to create plugin-mapping for new custom transform.
There was a problem hiding this comment.
There was a problem hiding this comment.
Add this into plugin-mapping.properties.
# For custom transforms, make sure to use the seatunnel.transform.[PluginIdentifier]=[JarPerfix] naming convention. For example:
# seatunnel.transform.Sql = seatunnel-transforms-v2
65b6a2b to
a59e21c
Compare
Purpose of this pull request
custom udf throw Exception. remove
seatunnel-transform-v2.jarfromconnecotstolibsolve the problem .Does this PR introduce any user-facing change?
How was this patch tested?
e2e case : ExampleUdfIT
Check list
New License Guide
release-note.