1026409426 opened a new issue, #6023:
URL: https://github.com/apache/seatunnel/issues/6023

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   现象1:
   启动命令:
   /opt/apache-seatunnel-2.3.3/bin/seatunnel.sh -DJvmOption="-Xms1G -Xmx1G" 
--config /mysql-to-hive-seatunnel.conf.template -i targetTableName="table1" -i 
sourceSql="select a.id, b.code from tmp1 a join tmp2 b on a.id = b.id"  -e local
   
   
启动该seatunnel.sh的时候,尽管使用""等操作吧sourceSql对应sql包括起来,但是在seatunnel.sh的shell脚本执行的时候,shell会进行参数获取转换,最终拼接java启动类参数的时候依旧会变成sourceSql=select
 a.id, b.code from tmp1 a join tmp2 b on a.id = 
b.id,确实引号,会导致传入到启动类参数一空格分隔从而确实传入的value
   
   现象2:
   以第一个启动命令继续往下排查找到第二个java启动命令,以及参数重新给定进行处理测试
   启动命令:
   java -cp 
'/opt/apache-seatunnel-2.3.3/lib/*:/opt/apache-seatunnel-2.3.3/starter/seatunnel-starter.jar'
 org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient -DJvmOption=-Xms1G 
-Xmx1G --config mysql-to-hive-seatunnel.conf.template -i 
targetTableName=tmp.test_join_v2 -i sourceSql='select a.id, b.code from tmp1 a 
join tmp2 b on a.id = b.id' -e local
   测试发现最终展示实际在 mysql-to-hive-seatunnel.conf.template 替换的参数 sourceSql 只存在select 
a.id,被逗号分隔了,经过debug排查,发现在JCommander.convertValue 
方法中返回的converter.convert(value)处理传入参数配置默认调用的是 com.beust.jcommander.converters 中的 
splitter.split(value) -> com.beust.jcommander.converters.split 
方法,最终发现该方法分隔默认以逗号分隔,导致传入参数出现逗号全部被截断
   
   
   
   
   
   
   
   
   
   ### SeaTunnel Version
   
   2.3.3
   
   ### SeaTunnel Config
   
   ```conf
   env {
     execution.parallelism = 1
     job.mode = "BATCH"
     spark.sql.catalogImplementation = "hive"
   }
   source{
       Jdbc {
           url = "jdbc:mysql://xxx:3306/tmp?useSSL=false"
           driver = "com.mysql.cj.jdbc.Driver"
           connection_check_timeout_sec = 100
           user = "root"
           password = "123456"
           query = ${sourceSql}
       }
   }
   sink {
       Hive {
           hdfs_site_path = "/root/conf_tmp/hdfs-site.xml"
           hive_site_path = "/root/conf_tmp/hive-site.xml"
           table_name = ${targetTableName}
        metastore_uri = "thrift://xxx:9083"
       }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   命令如上
   ```
   
   
   ### Error Exception
   
   ```log
   以-i 传入key=value,当value存在逗号、空格等情况传入启动参数会被自动截断
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   java version "1.8.0_391"
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to