Skip to content

Commit

Permalink
[Improve][chore] shell command variable support value contains space …
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
liunaijie committed Oct 27, 2024
1 parent 72664f3 commit 9e71d3c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
13 changes: 12 additions & 1 deletion seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,15 @@ do
fi
done

java ${JAVA_OPTS} -cp ${CLASS_PATH} ${APP_MAIN} ${args}
UPD_ARGS=""
for arg in "$@"; do
if [[ $arg == *" "* ]]; then
key="${arg%%=*}"
value="${arg#*=}"
UPD_ARGS="${UPD_ARGS}${key}='${value}' "
else
UPD_ARGS="${UPD_ARGS}${arg} "
fi
done

eval "java ${JAVA_OPTS} -cp ${CLASS_PATH} ${APP_MAIN} ${UPD_ARGS}"
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
package org.apache.seatunnel.engine.e2e;

import org.apache.seatunnel.e2e.common.TestSuiteBase;
import org.apache.seatunnel.e2e.common.container.EngineType;
import org.apache.seatunnel.e2e.common.container.TestContainer;

import org.apache.seatunnel.e2e.common.junit.DisabledOnContainer;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.TestTemplate;
import org.testcontainers.containers.Container;
Expand All @@ -31,9 +33,13 @@
public class UserVariableIT extends TestSuiteBase {

@TestTemplate
public void userVariableTest(TestContainer container) throws IOException, InterruptedException {
@DisabledOnContainer(
value = {},
type = {EngineType.FLINK, EngineType.SPARK},
disabledReason = "")
public void zetaVariableTest(TestContainer container) throws IOException, InterruptedException {
List<String> variables = new ArrayList<>();
String list = "[abc,def]";
String list = "[a bc]";
variables.add("resName=a$(date +\"%Y%m%d\")");
variables.add("rowNum=10");
variables.add("strTemplate=" + list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ sink {
source_table_name = ${sourceTableName}
}

# If you would like to get more information about how to configure seatunnel and see full list of sink plugins,
# please go to https://seatunnel.apache.org/docs/connector-v2/sink
Assert {
source_table_name = ${sourceTableName}
rules =
{
field_rules = [
{
field_name = name
field_type = string
field_value = [
{
rule_type = NOT_NULL
equals_to = "a bc"
}
]
}
]
}
}

}

0 comments on commit 9e71d3c

Please sign in to comment.