Skip to content
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

[Feature][Transform] allow class name and package name in java dynamic-compile #8441

Open
2 of 3 tasks
yinrui97 opened this issue Jan 3, 2025 · 0 comments
Open
2 of 3 tasks

Comments

@yinrui97
Copy link

yinrui97 commented Jan 3, 2025

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

Seatunnel 2.3.8

Looked at the doc in https://seatunnel.apache.org/zh-CN/docs/2.3.8/transform-v2/dynamic-compile, see below example,
class name and package name are not allowed in source code, if I added them, there will be compile error. This is quite strange, you know, the source code is not validated java class.

If I need to modify the source code, I have to manually add package name and class name, after completion, I remove the package name and class name before running seatunnal job, this is quite incontinent.

In groovy DynamicCompile example, class name is allowed, I expect java DynamicCompile can also support this.

transform {
 DynamicCompile {
    source_table_name = "fake"
    result_table_name = "java_out"
    compile_language="JAVA"
    compile_pattern="SOURCE_CODE"
    source_code="""
                 import org.apache.seatunnel.api.table.catalog.Column;
                 import org.apache.seatunnel.transform.common.SeaTunnelRowAccessor;
                 import org.apache.seatunnel.api.table.catalog.*;
                 import org.apache.seatunnel.api.table.type.*;
                 import java.util.ArrayList;
                    public Column[] getInlineOutputColumns(CatalogTable inputCatalogTable) {
                       ...
                    }
                
                
                    public Object[] getInlineOutputFieldValues(SeaTunnelRowAccessor inputRow) {
                       ...
                    }
                """

  }
 } 

Usage Scenario

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant