-
Notifications
You must be signed in to change notification settings - Fork 2k
[Fix][Transform-v2] Fix custom udf throw exception #9195
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: dev
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This conflicts with pr #7218
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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
@@ -15,7 +15,7 @@ | |||
* limitations under the License. | |||
*/ | |||
|
|||
package org.apache.seatunnel.transform.sql.zeta; | |||
package org.apache.seatunnel.api.transform.sql; |
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.
If we move UDF to api module. Why we still need move seatunnel-transform-v2.jar to libs?
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.
not needed. assembly-bin.xml
is rollbacked
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 . |
<outputDirectory>/lib</outputDirectory> | ||
<scope>provided</scope> | ||
</dependencySet> | ||
|
||
<!-- ============ Connectors Jars And Transforms V2 Jar ============ --> |
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.
<!-- ============ Connectors Jars And Transforms V2 Jar ============ --> | |
<!-- ============ Connectors Jars ============ --> |
@@ -15,7 +15,7 @@ | |||
* limitations under the License. | |||
*/ | |||
|
|||
package org.apache.seatunnel.transform.sql.zeta; | |||
package org.apache.seatunnel.transform.sql.zeta.functions.udf; |
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.
why move the package of ZetaUDF?
Need to delete transform from |
Purpose of this pull request
custom udf throw Exception. remove
seatunnel-transform-v2.jar
fromconnecots
tolib
solve 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
.