yzeng1618 commented on issue #10317:
URL: https://github.com/apache/seatunnel/issues/10317#issuecomment-3741373146

   Your current configuration is incorrect. The `iceberg.table.primary-keys` of 
Iceberg sink is a **single string** option that applies to all tables, and it 
does not support the per-table configuration format you are attempting to use.
   
   The correct approach is to use the `table-names-config` option in the 
**SqlServer-CDC source** to specify different primary keys for each table:
   
   Modify your configuration as follows:
   ```hocon
   source {
     SqlServer-CDC {
       plugin_output = "mssql_cdc"
       username = "user_name"
       password = "password"
       url = 
"jdbc:sqlserver://IP:PORT;databaseName=db_name;encrypt=true;trustServerCertificate=true"
       database-names = ["AlloCustom"]
       table-names = 
["AlloCustom.Finance.VendorRoyalties","AlloCustom.Finance.Parts"]
       
       # Specify different primary keys for each table
       table-names-config = [
         {
           table = "AlloCustom.Finance.VendorRoyalties"
           primaryKeys = ["invoice_num", "invoice_line", "vendor_num", 
"vendor_id"]
         },
         {
           table = "AlloCustom.Finance.Parts"
           primaryKeys = ["part_num", "company", "vendor_num"]
         }
       ]
       
       startup.mode = "initial"
       debezium {
         database.encrypt = "true"
         database.trustServerCertificate = "true"
       }
       incremental.parallelism = 1
       snapshot.split.size = 8096
     }
   }
   ``` [3](#0-2) 
   
   Then **remove** the `iceberg.table.primary-keys` configuration from the 
Iceberg sink:
   ```hocon
   sink {
     Iceberg {
       plugin_input = "column_names_to_snake_case"
       catalog_name = "polaris"
       namespace = "allocustom"
       table = "${schema_name}__${table_name}"
       iceberg.table.upsert-mode-enabled = true
       # Remove the iceberg.table.primary-keys configuration
       # Iceberg will automatically inherit primary keys from the source table 
schema
       iceberg.table.schema-evolution-enabled = true
       # ... Other configurations
     }
   }
   ```
   
   You can try the modified content above.
   


-- 
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