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

   ### 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
   
   ```sql
   INSERT INTO main.`xxx` (`id`, `type`, `amount`, `ts`) VALUES (?, ?, ?, ?) ON 
CONFLICT(`id`,`type`) DO UPDATE SET `id`=VALUES(`id`), `type`=VALUES(`type`), 
`amount`=VALUES(`amount`), `ts`=VALUES(`ts`)
   ```
   
   It seems that SQLite 3.x don't support VALUES(`xxx`) syntax.
   
   https://www.sqlite.org/lang_upsert.html
   
https://github.com/apache/seatunnel/blob/0fe175c43365695c13c23a020f41c45f8dfcbe00/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlite/SqliteDialect.java#L51
   
   ### SeaTunnel Version
   
   2.3.13
   
   ### SeaTunnel Config
   
   ```conf
   env {
     parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 300000
   }
   
   source {
     Postgres-CDC {
       plugin_output = "pg_cdc"
       url = "jdbc:postgresql://postgres:5432/test"
       username = "${POSTGRES_USER}"
       password = "${POSTGRES_PASSWORD}"
       schema-names = ["public"]
       database-names = ["test"]
       table-names = [
         "test.public.xxx"
       ]
       slot.name = "pg2sqlite"
     }
   }
   
   sink {
     Jdbc {
       plugin_input = "pg_cdc"
       url = "jdbc:sqlite:/data/sqlite/data.db"
       driver = "org.sqlite.JDBC"
       table = "${table_name}"
       database = "main"
       generate_sink_sql = true
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   command:
         - ./bin/seatunnel.sh
         - -m
         - local
         - -c
         - /data/jobs/pg2sqlite.seatunnel.conf
         - -i
         - 
POSTGRES_USER=${POSTGRES_USER:-postgres},POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
   ```
   
   ### Error Exception
   
   ```log
   Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing 
database (near "VALUES": syntax error)
   
        at org.sqlite.core.DB.newSQLException(DB.java:1135) 
~[sqlite-jdbc-3.39.3.0.jar:?]
   
        at org.sqlite.core.DB.newSQLException(DB.java:1146) 
~[sqlite-jdbc-3.39.3.0.jar:?]
   
        at org.sqlite.core.DB.throwex(DB.java:1106) 
~[sqlite-jdbc-3.39.3.0.jar:?]
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### 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