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

   ### 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
   
   Conflict with `table` when using `jdbc.query`.
   `table` in `seatunnel-spark-jdbc-source-Jdbc` must not be empty.
   
   ### SeaTunnel Version
   
   2.1.2
   
   ### SeaTunnel Config
   
   ```conf
   env {
     spark.app.name = "st_export_test"
     spark.executor.instances = 5
     spark.executor.cores = 1
     spark.executor.memory = "2g"
     spark.sql.catalogImplementation = "hive"
   }
   
   source {
       jdbc {
           driver = "com.mysql.cj.jdbc.Driver"
           url = "jdbc:mysql://10.xx.xx.xx:4000/db"
           user = "xxx"
           password = "xxx"
           jdbc.fetchsize = 50000
           # table = "table"
           result_table_name = "table"
           jdbc.query = "select id,code,name from tablewhere id < 10"
     }
   }
   
   transform {
   }
   
   
   sink {
     Hive {
       sql = "insert overwrite table tmp.test partition(dt='20220921') select 
id,code,name from table"
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   ./bin/start-seatunnel-spark.sh -c ./config/st_import_test.conf -e cluster -m 
yarn
   ```
   
   
   ### Error Exception
   
   ```log
   # Remove the `table` parameter 
   ERROR command.BaseTaskExecuteCommand: 
Plugin[org.apache.seatunnel.spark.jdbc.source.Jdbc] contains invalid config, 
error: please specify [table] as non-empty
   
   # Add the `table` parameter
   Caused by: java.lang.IllegalArgumentException: Both 'dbtable' and 'query' 
can not be specified at the same time.
   ```
   
   
   ### Flink or Spark Version
   
   Spark version 2.4.0-cdh6.2.1
   
   ### Java or Scala Version
   
   _No response_
   
   ### 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: [email protected]

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

Reply via email to