CRUDKanade opened a new issue, #2736:
URL: https://github.com/apache/incubator-seatunnel/issues/2736

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   按官网https://seatunnel.apache.org/zh-CN/docs/2.1.3/command/usage , 描述使用 
--variable 命令无法替换${}变量
   
   ### SeaTunnel Version
   
   2.1.2
   
   ### SeaTunnel Config
   
   ```conf
   env {
   spark.executor.memory = "1g"
   spark.executor.cores = "1"
   spark.executor.instances = "2"
   spark.app.name = "test"
   }
   
   source {
    jdbc {
    driver = "com.mysql.cj.jdbc.Driver"
    url = "jdbc:mysql://xxxx:xxxx/xxx?"
    user = ****
    password = ****
    table = "user"
     result_table_name = "tb_6875311198656"
    }
    }
   transform {
    sql {
      sql = """select ${city}"""
      result_table_name = "tb_6875316324672"
    }
   }
   sink {
   
   Console {}
   
    }
   ```
   
   
   ### Running Command
   
   ```shell
   ./bin/start-seatunnel-spark.sh --master local[4] --deploy-mode client 
--config /root/seatunnel/seatunnel-2.1.2/config/test.conf -i city=1
   ```
   
   
   ### Error Exception
   
   ```log
   2022-09-07 08:55:54 ERROR Seatunnel:60 -
   
   
===============================================================================
   
   
   2022-09-07 08:55:54 ERROR Seatunnel:63 - Fatal Error,
   
   2022-09-07 08:55:54 ERROR Seatunnel:65 - Please submit bug report in 
https://github.com/apache/incubator-seatunnel/issues
   
   2022-09-07 08:55:54 ERROR Seatunnel:67 - Reason:Execute Spark task error
   
   2022-09-07 08:55:54 ERROR Seatunnel:68 - Exception 
StackTrace:java.lang.RuntimeException: Execute Spark task error
           at 
org.apache.seatunnel.core.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:79)
           at org.apache.seatunnel.core.base.Seatunnel.run(Seatunnel.java:39)
           at 
org.apache.seatunnel.core.spark.SeatunnelSpark.main(SeatunnelSpark.java:32)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
           at 
org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
           at 
org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
           at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
           at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
           at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
   Caused by: org.apache.spark.sql.catalyst.parser.ParseException:
   no viable alternative at input 'select '(line 1, pos 7)
   
   == SQL ==
   select
   -------^^^
   
           at 
org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:239)
           at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:115)
           at 
org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:48)
           at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:69)
           at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:642)
           at org.apache.seatunnel.spark.transform.Sql.process(Sql.scala:28)
           at 
org.apache.seatunnel.spark.SparkEnvironment.transformProcess(SparkEnvironment.java:159)
           at 
org.apache.seatunnel.spark.batch.SparkBatchExecution.start(SparkBatchExecution.java:50)
           at 
org.apache.seatunnel.core.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:76)
           ... 12 more
   
   2022-09-07 08:55:54 ERROR Seatunnel:69 -
   
===============================================================================
   
   
   
   Exception in thread "main" java.lang.RuntimeException: Execute Spark task 
error
           at 
org.apache.seatunnel.core.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:79)
           at org.apache.seatunnel.core.base.Seatunnel.run(Seatunnel.java:39)
           at 
org.apache.seatunnel.core.spark.SeatunnelSpark.main(SeatunnelSpark.java:32)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
           at 
org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
           at 
org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
           at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
           at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
           at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
   Caused by: org.apache.spark.sql.catalyst.parser.ParseException:
   no viable alternative at input 'select '(line 1, pos 7)
   
   == SQL ==
   select
   -------^^^
   
           at 
org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:239)
           at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:115)
           at 
org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:48)
           at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:69)
           at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:642)
           at org.apache.seatunnel.spark.transform.Sql.process(Sql.scala:28)
           at 
org.apache.seatunnel.spark.SparkEnvironment.transformProcess(SparkEnvironment.java:159)
           at 
org.apache.seatunnel.spark.batch.SparkBatchExecution.start(SparkBatchExecution.java:50)
           at 
org.apache.seatunnel.core.spark.command.SparkTaskExecuteCommand.execute(SparkTaskExecuteCommand.java:76)
           ... 12 more
   ```
   
   
   ### Flink or Spark Version
   
   spark 2.3.2
   
   ### Java or Scala Version
   
   jdk1.8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to