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

   ### Search before asking
   
   - [X] I had searched in the 
[feature](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   
   ### Description
   
   Currently jdbc SqlServerDialect using `INSERT INTO ${database}.${table}`
   
   
https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlserver/SqlServerDialect.java
   
https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java#L78
   
   
   
   SQLServer SQL only allows `${database}.${schema}.${table}` or 
`${schema}.${table}` as table identifier
   
   Changes
   ```java
           // pseudocode
           String sqlServerTable;
           String[] tableNames = tableName.split("\\.");
           if (tableNames.length == 1 || tableNames.length == 3) {
               sqlServerTable = tableName;
           } else if (tableNames.length == 2) {
               sqlServerTable = database + "." + tableName;
           } else {
               throw new IllegalArgumentException();
           }
           return String.format("INSERT INTO %s (%s) VALUES (%s)",
               sqlServerTable, columns, placeholders);
   ```
   
   
   *Validate*
   
   Add e2e testcase
   
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a 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