This is an automated email from the ASF dual-hosted git repository.

davidzollo pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 7b534aec46 [Fix][seatunnel-common,seatunnel-core] Fix comma-containing 
plain variable parsing (#11427)
7b534aec46 is described below

commit 7b534aec4616cd548e1358ce5ce425562311d925
Author: NganWave <[email protected]>
AuthorDate: Wed Jul 15 20:38:33 2026 +0800

    [Fix][seatunnel-common,seatunnel-core] Fix comma-containing plain variable 
parsing (#11427)
---
 .../seatunnel/common/utils/PlaceholderUtils.java   |  3 +-
 .../engine/e2e/console/FakeSourceToConsoleIT.java  | 21 ++++++++
 .../fakesource_to_console_with_comma_params.conf   | 61 ++++++++++++++++++++++
 .../engine/e2e/SeaTunnelEngineContainer.java       |  6 +++
 4 files changed, 90 insertions(+), 1 deletion(-)

diff --git 
a/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/PlaceholderUtils.java
 
b/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/PlaceholderUtils.java
index c14d1c3b47..89e7c7ca49 100644
--- 
a/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/PlaceholderUtils.java
+++ 
b/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/PlaceholderUtils.java
@@ -18,6 +18,7 @@
 package org.apache.seatunnel.common.utils;
 
 import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode;
+import org.apache.seatunnel.shade.org.apache.commons.lang3.StringUtils;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -38,7 +39,7 @@ public class PlaceholderUtils {
         while (matcher.find()) {
             String replacement =
                     value != null && !value.isEmpty()
-                            ? value
+                            ? StringUtils.unwrap(value, "\"")
                             : (matcher.group(1) != null
                                     ? matcher.group(1).substring(1).trim()
                                     : defaultValue);
diff --git 
a/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/java/org/apache/seatunnel/engine/e2e/console/FakeSourceToConsoleIT.java
 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/java/org/apache/seatunnel/engine/e2e/console/FakeSourceToConsoleIT.java
index c63982cbbf..f28b71a64f 100644
--- 
a/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/java/org/apache/seatunnel/engine/e2e/console/FakeSourceToConsoleIT.java
+++ 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/java/org/apache/seatunnel/engine/e2e/console/FakeSourceToConsoleIT.java
@@ -24,6 +24,8 @@ import org.junit.jupiter.api.Test;
 import org.testcontainers.containers.Container;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 public class FakeSourceToConsoleIT extends SeaTunnelEngineContainer {
 
@@ -32,4 +34,23 @@ public class FakeSourceToConsoleIT extends 
SeaTunnelEngineContainer {
         Container.ExecResult execResult = 
executeSeaTunnelJob("/fakesource_to_console.conf");
         Assertions.assertEquals(0, execResult.getExitCode());
     }
+
+    @Test
+    public void testCommaParams() {
+        List<String> variables = new ArrayList<>();
+        variables.add("date=2026-07-13");
+        variables.add("cols=\"addr1,addr2\"");
+        variables.add("required_cols=[date,id,name,addr1]");
+        Container.ExecResult execResult = null;
+        try {
+            execResult =
+                    
executeSeaTunnelJob("/fakesource_to_console_with_comma_params.conf", variables);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+
+        Assertions.assertEquals(0, execResult.getExitCode());
+    }
 }
diff --git 
a/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/resources/fakesource_to_console_with_comma_params.conf
 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/resources/fakesource_to_console_with_comma_params.conf
new file mode 100644
index 0000000000..d25b6ce3f3
--- /dev/null
+++ 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-console-seatunnel-e2e/src/test/resources/fakesource_to_console_with_comma_params.conf
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in 
seatunnel config
+######
+
+env {
+  parallelism = 2
+  job.mode = "BATCH"
+}
+
+source {
+  # This is a example source plugin **only for test and demonstrate the 
feature source plugin**
+  FakeSource {
+    plugin_output = "fake"
+    schema {
+      fields {
+        id = "int"
+        name = "string"
+        age = "int"
+        addr1 = "string"
+        addr2 = "string"
+      }
+    }
+  }
+}
+
+transform {
+    SQL {
+        plugin_input = "fake"
+        plugin_output = "sql"
+        query = "SELECT id, name, age, '${date}' as date, ${cols} FROM fake"
+    }
+    filter{
+        plugin_input = "sql"
+        plugin_output = "filter"
+        include_fields = ${required_cols}
+    }
+}
+
+
+sink {
+  console {
+    plugin_input = "filter"
+  }
+
+}
\ No newline at end of file
diff --git 
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/SeaTunnelEngineContainer.java
 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/SeaTunnelEngineContainer.java
index 1d73690493..6c034acb4d 100644
--- 
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/SeaTunnelEngineContainer.java
+++ 
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/SeaTunnelEngineContainer.java
@@ -27,6 +27,7 @@ import org.testcontainers.containers.Container;
 import lombok.extern.slf4j.Slf4j;
 
 import java.io.IOException;
+import java.util.List;
 
 @Slf4j
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
@@ -50,4 +51,9 @@ public abstract class SeaTunnelEngineContainer extends 
SeaTunnelContainer {
             throws IOException, InterruptedException {
         return executeJob(confFile);
     }
+
+    public Container.ExecResult executeSeaTunnelJob(String confFile, 
List<String> variables)
+            throws IOException, InterruptedException {
+        return executeJob(confFile, variables);
+    }
 }

Reply via email to