Kurola-Bryson opened a new issue, #10043:
URL: https://github.com/apache/seatunnel/issues/10043

   ### 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
   
   2.3.12 After executing the seatunnel task, the conversion of config's 
save_mode_create_template only recognized the passed table name ${table}, all 
fields and field comments of ${rowtype_fields}, but did not retrieve the 
primary key ${rowtype_primary_key} and table comment ${comment}. If the primary 
key is empty after conversion, the task will fail. The source-side table has a 
primary key and table comment, but only the specified primary key and table 
comment can be displayed. Similar cases were also found in holo sink, where the 
sink-side automatic table creation detected that the table lacks comments. 
Perhaps automatic table creation in other sinks may also have similar issues. 
The automatically created table did not set the primary key of the source-side 
table, nor did it include the comments of the source-side table.
   
   ### SeaTunnel Version
   
   2.3.12
   
   ### SeaTunnel Config
   
   ```conf
   env {
     parallelism = 4
     job.mode = "BATCH"
   }
   
   source {
     Jdbc {
       url = 
"jdbc:mysql://***.mysql.rds.aliyuncs.com:3306/***?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
       driver = "com.mysql.cj.jdbc.Driver"
       connection_check_timeout_sec = 100
       username = "***"
       password = "***"
       query = "select * from zbx_payment_info limit 16;"
     }
   }
   
   transform {
   }
   
   sink {
     Maxcompute {
       accessId = "***"
       accesskey = "***"
       endpoint = "http://***/api";
       project = "***"
       table_name = "zbx_payment_info"
       schema_save_mode = "RECREATE_SCHEMA"
       data_save_mode = "DROP_DATA"
        save_mode_create_template = "CREATE TABLE IF NOT EXISTS `${table}` 
(${rowtype_fields}, PRIMARY KEY (${rowtype_primary_key}))TBLPROPERTIES 
('transactional'='true','comment'=${comment});"
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   seatunnel.sh --config mysql2mc_test.conf -m local
   ```
   
   ### Error Exception
   
   ```log
   Failed to retrieve the primary key ${rowtype_primary_key} and table comment 
${comment}; an empty primary key after conversion will cause the task to fail
   ```
   
   ### Zeta or Flink or Spark Version
   
   zeta2.3.12
   
   ### Java or Scala Version
   
   java1.8
   
   ### Screenshots
   
   <img width="721" height="616" alt="Image" 
src="https://github.com/user-attachments/assets/a2239774-f13f-4a6a-ac87-7872d124177f";
 />
   
   <img width="1065" height="262" alt="Image" 
src="https://github.com/user-attachments/assets/8de86b09-bf33-4b80-bc03-edf1ee3fbc96";
 />
   
   <img width="990" height="441" alt="Image" 
src="https://github.com/user-attachments/assets/0a6bea66-c62e-4941-a794-a2cdf959aa57";
 />
   
   <img width="1004" height="184" alt="Image" 
src="https://github.com/user-attachments/assets/32378bdd-625a-4258-a954-d42f1d905b18";
 />
   
   ### 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