[Bug] [shell client] variable not correct when it has space, eg: -i dt="2024-04-28 00:00:00"
hogger2099 opened this issue · comments
Search before asking
- I had searched in the issues and found no similar issues.
What happened
variable replaced not correct
SeaTunnel Version
2.3.4
SeaTunnel Config
mysql_2_doris.config:
source {
Jdbc {
query = "select * from t where updated_time >= '"${dt}"'"
}
}
Running Command
./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt="2024-04-28 00:00:00"
Error Exception
the executed SQL is below, the variable is not replaced correct!
actual:
select * from t where updated_time >= '2024-04-28'
expected:
select * from t where updated_time >= '2024-04-28 00:00:00'
Zeta or Flink or Spark Version
No response
Java or Scala Version
No response
Screenshots
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Need help, thank you all.
Thank u for replay. But not work if use variable like below, any suggestion?
here use two single quota to use variable "dt"
dt=$(date +'%Y-%m-%d 00:00:00')
./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt=''$dt''
you can refer this pr #6387 try to use single quota.
-i dt='2024-04-28 00:00:00'
Thank u for replay. But not work if use variable like below, any suggestion? here use two single quota to use variable "dt"
dt=$(date +'%Y-%m-%d 00:00:00') ./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt=''$dt''
you can refer this pr #6387 try to use single quota.
-i dt='2024-04-28 00:00:00'
echo dt=\'$dt\'
Thank u for replay. But not work if use variable like below, any suggestion? here use two single quota to use variable "dt"
dt=$(date +'%Y-%m-%d 00:00:00') ./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt=''$dt''
you can refer this pr #6387 try to use single quota.
-i dt='2024-04-28 00:00:00'
echo dt=\'$dt\'
what's the meaning?
Thank u for replay. But not work if use variable like below, any suggestion? here use two single quota to use variable "dt"
dt=$(date +'%Y-%m-%d 00:00:00') ./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt=''$dt''
you can refer this pr #6387 try to use single quota.
-i dt='2024-04-28 00:00:00'
echo dt=\'$dt\'
what's the meaning?
./start-seatunnel-spark-2-connector-v2.sh --config ./mysql_2_doris.config -i dt=\'$dt\'
OK, thx, will version2.3.6 support this feature?
OK, thx, will version2.3.6 support this feature?
yes, the mentioned pr has merged. it will be release in 2.3.6.
and for your case, you mentiond you can pass the variable, but the format is not right. so maybe you can try pass the variables with single quota first. maybe it can work for you.