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

   ### 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
   
   Tested Mysql-cdc cannot automatically synchronize newly created fields in 
DDL:
   
   Mysql source table:
   
   CREATE TABLE `mysql_cdc` (
     `id` bigint NOT NULL AUTO_INCREMENT,
     `userId` bigint DEFAULT NULL,
     `itemId` bigint DEFAULT NULL,
     `categoryId` varchar(30) DEFAULT NULL,
     `behavior` varchar(30) DEFAULT NULL,
     `price` bigint DEFAULT NULL,
     `ts` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE 
CURRENT_TIMESTAMP(3),
     PRIMARY KEY (`id`)
   ) ;
   
   When creating a new field ' create_time ', the sink table(mysql_cdc_sink) 
cannot automatically create that field:
   
   ALTER TABLE test.mysql_cdc ADD COLUMN create_time VARCHAR(255);
   
   
   
   ### SeaTunnel Version
   
   v2.3.5 dev
   
   ### SeaTunnel Config
   
   ```conf
   env {
     parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 10000
   }
   
   source {
     MySQL-CDC {
       base-url = "jdbc:mysql://localhost:3306/test"
       username = "root"
       password = "123456"
       table-names = ["test.mysql_cdc"]
       table-names-config = [
         {
           table = "test.mysql_cdc"
           primaryKeys = ["id"]
         }
       ]
     }
   }
   
   sink {
       jdbc {
           url = 
"jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
           driver = "com.mysql.cj.jdbc.Driver"
           user = "root"
           password = "123456"
           generate_sink_sql = true
           database = "test"
           table = "mysql_cdc_sink"
           primary_keys = ["id"]
           field_ide = "ORIGINAL"
           schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
       }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   root@DESKTOP-D2QH5LO:/home/seatunnel/apache-seatunnel-2.3.5-SNAPSHOT# bash 
./bin/seatunnel.sh --config ./config/mysqlcdc.conf -m local
   ```
   
   
   ### Error Exception
   
   ```log
   Tested Mysql-cdc cannot automatically synchronize newly created fields in 
DDL,
   When source table (mysql_cdc) creating a new field 'create_time', the sink 
table(mysql_cdc_sink) cannot automatically create that field:
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   Zeta
   
   ### Java or Scala Version
   
   jdk11.0.17
   scala2.12.17
   
   ### 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