The issue #8542 which has been hotly discussed in the SeaTunnel community recently and has received a lot of +1s urgently needs your participation!
Apache SeaTunnel’s Hottest GitHub Issue #8542: “Add Python Script Support for Transform” — Your Code Could Land in the Next Release!
Issue Link: https://github.com/apache/seatunnel/issues/8542
Proposed by: PMC Member @liugddx
Status: Active Discussion — Join Now!
What Does This Feature Aim to Achieve?
🐍 Good News for Python Developers
Enable Python script execution within Apache SeaTunnel’s Transform module
Technical Proposal by Community Member @FuYouJ
🔌 Technical Preview: Py4J Implementation
The current solution utilizes Py4J for Java-Python bidirectional communication:
Java-Side Process Initialization
When SeaTunnel Transform starts, the Java side launches a persistent process:
GatewayServer gatewayServer = new GatewayServer(new ExampleJava());
gatewayServer.start();
The ExampleJava
class provides basic SeatunnelRow operation methods.
Python Client Connection
Start Python client to connect to Java server:
gateway = JavaGateway(
callback_server_parameters=CallbackServerParameters()
)
java_app = gateway.entry_point # Represents ExampleJava instance
Executing Python Code from Java
Java-side method providing user-configured Python code:
public String getPythonCode(){
return "import numpy as np;\n" +
"print(np.array([1, 2, 3]));print(\"[Python] java_app.callPythonMethod(1, 1.1)\");java_app.callPythonMethod(1, 1.1)";
}
java_list = gateway.jvm.java.util.ArrayList()
java_list.append(1)
java_list.append(2)
java_app.addList(1,java_list)
my_object = gateway.jvm.com.example.MyObject("test", 123)
java_app.addObject(1,my_object);
try:
exec(java_app.getPythonCode())
except Exception as e:
print(f"[Python] : {e}"))
How to Contribute
Step-by-Step Guide
- Claim Tasks: Comment on the issue to find suitable assignments
- Expert Mentorship: Work directly with core maintainers
Need Help?
Join our contributor chat:
Email:zenghui@apache.org
Why This Matters?
- Be listed as a feature contributor in release notes
- Shape the future of ML-powered data pipelines
Original Code References:
Full implementation details are available in Issue #8542
This translation strictly follows your original structure while:
- Preserving all technical details/code samples
- Maintaining section headers and flow
- Keeping emphasis markers (emojis/formatting)
- Using minimal rephrasing for natural English flow
Would you like any specific section adjusted further? 😊