Hisoka-X commented on code in PR #7264:
URL: https://github.com/apache/seatunnel/pull/7264#discussion_r1694665130


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/dynamiccompile/DynamicCompileTransformConfig.java:
##########
@@ -39,4 +39,16 @@ public class DynamicCompileTransformConfig implements 
Serializable {
                     .enumType(CompileLanguage.class)
                     .noDefaultValue()
                     .withDescription("compile language");
+
+    public static final Option<String> ABSOLUTE_PATH =
+            Options.key("absolute_path")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("absolute_path");
+
+    public static final Option<CompilePattern> COMPILE_PATTERN =
+            Options.key("compile_pattern")
+                    .enumType(CompilePattern.class)
+                    .noDefaultValue()

Review Comment:
   Set default value to `SOURCE_CODE` to keep versions compatible.



##########
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/java/org/apache/seatunnel/e2e/transform/TestDynamicCompileIT.java:
##########
@@ -27,47 +27,65 @@
 
 public class TestDynamicCompileIT extends TestSuiteBase {
 
+    private final String basePath = "/dynamic_compile/conf/";
+
     @TestTemplate
     public void testDynamicSingleCompileGroovy(TestContainer container)
             throws IOException, InterruptedException {
         Container.ExecResult execResult =
-                container.executeJob(
-                        
"/dynamic_compile/single_dynamic_groovy_compile_transform.conf");
+                container.executeJob(basePath + 
"single_dynamic_groovy_compile_transform.conf");
         Assertions.assertEquals(0, execResult.getExitCode());
     }
 
     @TestTemplate
     public void testDynamicSingleCompileJava(TestContainer container)
             throws IOException, InterruptedException {
         Container.ExecResult execResult =
-                
container.executeJob("/dynamic_compile/single_dynamic_java_compile_transform.conf");
+                container.executeJob(basePath + 
"single_dynamic_java_compile_transform.conf");
         Assertions.assertEquals(0, execResult.getExitCode());
     }
 
     @TestTemplate
     public void testDynamicMultipleCompileGroovy(TestContainer container)
             throws IOException, InterruptedException {
         Container.ExecResult execResult =
-                container.executeJob(
-                        
"/dynamic_compile/multiple_dynamic_groovy_compile_transform.conf");
+                container.executeJob(basePath + 
"multiple_dynamic_groovy_compile_transform.conf");
         Assertions.assertEquals(0, execResult.getExitCode());
     }
 
     @TestTemplate
     public void testDynamicMultipleCompileJava(TestContainer container)
             throws IOException, InterruptedException {
         Container.ExecResult execResult =
-                container.executeJob(
-                        
"/dynamic_compile/multiple_dynamic_java_compile_transform.conf");
+                container.executeJob(basePath + 
"multiple_dynamic_java_compile_transform.conf");
         Assertions.assertEquals(0, execResult.getExitCode());
     }
 
     @TestTemplate
     public void testDynamicMixedCompileJavaAndGroovy(TestContainer container)
             throws IOException, InterruptedException {
         Container.ExecResult execResult =
-                container.executeJob(
-                        
"/dynamic_compile/mixed_dynamic_groovy_java_compile_transform.conf");
+                container.executeJob(basePath + 
"mixed_dynamic_groovy_java_compile_transform.conf");
+        Assertions.assertEquals(0, execResult.getExitCode());
+    }
+
+    @TestTemplate
+    public void testDynamicSinglePathGroovy(TestContainer container)
+            throws IOException, InterruptedException {
+        container.copyFileMyselfContainers(
+                "/dynamic_compile/source_file/GroovyFile", "/tmp/GroovyFile");

Review Comment:
   Do we need to save the same code file on all nodes? Maybe we can read the 
file into a String value in the constructor, so that we only need to keep one 
code file on the client.
   
https://github.com/apache/seatunnel/pull/7264/files#diff-232afd1e749a56f59c831ec14b761e25bb712e42a52001e8c47917dcc975edb7R48-R60



##########
seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/TestContainer.java:
##########
@@ -55,4 +55,6 @@ default Container.ExecResult restoreJob(String confFile, 
String jobId)
     }
 
     String getServerLogs();
+
+    void copyFileMyselfContainers(String path, String targetPath);

Review Comment:
   ```suggestion
       void copyFileToContainer(String path, String targetPath);
   ```



##########
docs/en/transform-v2/dynamic-compile.md:
##########
@@ -9,10 +9,12 @@ If the conversion is too complex, it may affect performance
 
 ## Options
 
-|       name       |  type  | required | default value |
-|------------------|--------|----------|---------------|
-| source_code      | string | yes      |               |
-| compile_language | string | yes      |               |
+|       name       |  type  | required |       default value       |
+|------------------|--------|----------|---------------------------|
+| source_code      | string | no       |                           |
+| compile_language | Enum   | yes      | GROOVY,JAVA               |
+| compile_pattern  | Enum   | yes      | SOURCE_CODE,ABSOLUTE_PATH |

Review Comment:
   ```suggestion
   | compile_language | Enum   | yes      |                       |
   | compile_pattern  | Enum   | yes      |                        |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to