Skip to content

Commit d543a38

Browse files
committed
[Fix-6840] Config variable substitution inconsistent
1 parent e572a9b commit d543a38

File tree

3 files changed

+85
-2
lines changed

3 files changed

+85
-2
lines changed

seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [ $# == 0 ]
4747
then
4848
args="-h"
4949
else
50-
args=$@
50+
args=("$@")
5151
fi
5252

5353
set +u
@@ -107,4 +107,4 @@ while IFS= read -r line || [[ -n "$line" ]]; do
107107
fi
108108
done < ${APP_DIR}/config/jvm_client_options
109109

110-
java ${JAVA_OPTS} -cp ${CLASS_PATH} ${APP_MAIN} ${args}
110+
java ${JAVA_OPTS} -cp ${CLASS_PATH} ${APP_MAIN} "${args[@]}"

seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/UserVariableIT.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,15 @@ public void userVariableTest(TestContainer container) throws IOException, Interr
4444
container.executeJob("/fake_to_console.variables.conf", variables);
4545
Assertions.assertEquals(0, execResult.getExitCode());
4646
}
47+
48+
@TestTemplate
49+
public void userVariableWithSpaceTest(TestContainer container)
50+
throws IOException, InterruptedException {
51+
List<String> variables = new ArrayList<>();
52+
String list = "\"AA AA\"";
53+
variables.add("blankSpace=" + list);
54+
Container.ExecResult execResult =
55+
container.executeJob("/fake_variable_with_space_assert.conf", variables);
56+
Assertions.assertEquals(0, execResult.getExitCode());
57+
}
4758
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
######
18+
###### This config file is a demonstration of streaming processing in seatunnel config
19+
######
20+
21+
env {
22+
job.mode = "BATCH"
23+
parallelism = 1
24+
}
25+
26+
source {
27+
# This is a example source plugin **only for test and demonstrate the feature source plugin**
28+
FakeSource {
29+
row.num = 1
30+
schema {
31+
fields {
32+
c_string = string
33+
}
34+
}
35+
rows = [
36+
{
37+
kind = INSERT
38+
fields = [${blankSpace}]
39+
}
40+
]
41+
}
42+
}
43+
44+
sink {
45+
Assert {
46+
rules =
47+
{
48+
row_rules = [
49+
{
50+
rule_type = MAX_ROW
51+
rule_value = 1
52+
},
53+
{
54+
rule_type = MIN_ROW
55+
rule_value = 1
56+
}
57+
],
58+
field_rules = [
59+
{
60+
field_name = c_string
61+
field_type = string
62+
field_value = [
63+
{
64+
rule_type = NOT_NULL
65+
equals_to = "AA AA"
66+
}
67+
]
68+
}
69+
]
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)