You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "cloud456 (via GitHub)" <gi...@apache.org> on 2025/08/21 07:05:13 UTC

[PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

cloud456 opened a new pull request, #9739:
URL: https://github.com/apache/seatunnel/pull/9739

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   -->
   
   ### Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
   If no, write 'No'.
   If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
   -->
   
   
   ### How was this patch tested?
   
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
   -->
   
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3218776659

   JDBC connector has many features available out of the box and is easier to maintain.
   
   > requires generating a temporary token to serve as the password.
   
   So I think we can add new method named `refreshPassword` in `JdbcConnectionProvider` to adapt this situation.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3397276107

   Considering tokens that rotate every 15 minutes. `DsqlJdbcConnectionProvider` cannot synchronously refresh all connections, leading to batch failures after expiration; complex refresh and eviction logic is required.
   
   In summary, I suggest not using `ConnectionPool`


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3277159743

   Thank you for your reminder. I have made the modifications as requested. Please help review it again. Additionally, since the DSQL environment cannot be simulated through Docker,so I haven't written corresponding test cases. I've provided two screenshots of the DSQL sink connector during operation - one from the initial state and another showing a delete operation. I'm wondering if these can be used to verify its effectiveness, or if you could provide other suggestions on how to verify that it works properly.
   <img width="2546" height="948" alt="snapshot for initial" src="https://github.com/user-attachments/assets/b1fccd2a-4197-4905-8f51-47ccc8adad09" />
   ![delete recode](https://github.com/user-attachments/assets/936b2bb8-fafc-4a5c-a3e8-529c87298aec)
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "chl-wxp (via GitHub)" <gi...@apache.org>.
chl-wxp commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3459287772

   Is there any way to add some test cases?


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang merged PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3283836212

   Hi,Here are two screenshots. The first picture is a screenshot of the log when the task is successfully completed. The second picture shows the comparison between the source table and the target table, hoping to prove its effectiveness.
   <img width="2426" height="1168" alt="finished" src="https://github.com/user-attachments/assets/abf8b9bc-bcf2-4016-a12a-866639746009" />
   <img width="2001" height="1011" alt="source target compare" src="https://github.com/user-attachments/assets/edfe4c96-393c-402f-af33-d458149d60b4" />
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3226554917

   > Glad to hear it.Do you have any schedule for this? Just to mention, it's not only about implementing refreshPassword in JdbcConnectionProvider, but also redesigning JdbcConnectionConfig. DSQL doesn't require a username and password; instead, it creates a password using ak/sk or profile combined with region and cluster endpoint. Therefore, its parameter requirements for JdbcConnectionConfig are different, potentially changing the original parameter requirements, such as making username and password mandatory in the original design
   
   Yes, this indeed different. How about implements jdbc sink and overwrite key method to let this works?


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3472324214

   @cloud456 Hi ,You might be able to add some @Disabled test cases


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3400203555

   > Considering tokens that rotate every 15 minutes. `DsqlJdbcConnectionProvider` cannot synchronously refresh all connections, leading to batch failures after expiration; complex refresh and eviction logic is required.
   > 
   > In summary, I suggest not using `ConnectionPool`. By the way, please add a chinese doc.
   
   Hi , I added the Chinese doc. In addition, regarding token refresh, I added a Schedule to `DsqlConnectionPoolManager`, and the token was refreshed every ten minutes, and the test results showed normal.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3242398208

   Also please check these TODO 
   <img width="711" height="171" alt="image" src="https://github.com/user-attachments/assets/29722a81-7884-4002-8271-9b1a46e158b1" />
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3216685117

   > I found dsql support jdbc. Why not add new catalog and dialect in jdbc connector? Please refer https://github.com/apache/seatunnel/tree/dev/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog and https://github.com/apache/seatunnel/tree/dev/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect
   
   The reason for not using JDBC is that the connection password for DSQL requires generating a temporary token to serve as the password. This token is only valid for 15 minutes by default, therefore requiring token renewal and dataSource reset within that 15-minute timeframe. Implementing this mechanism within JDBC would, in my opinion, be an intrusive behavior and not standard practice. Please refer https://docs.aws.amazon.com/aurora-dsql/latest/userguide/SECTION_authentication-token.html


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3283440354

   > How about implements jdbc sink and overwrite key method to let this works
   
   We should consider this option carefully. The core difference is only the authentication method. We are fully capable of abstracting out a public interface for DSQL to implement.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3460206724

   > Is there any way to add some test cases?
   
   Sorry,because Aurora DSQL is a cloud service, it can't simulate the environment through docker, so I can't provide more test cases at present. I have provided some screenshots after running above, hoping to help.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3401264766

   > > Considering tokens that rotate every 15 minutes. `DsqlJdbcConnectionProvider` cannot synchronously refresh all connections, leading to batch failures after expiration; complex refresh and eviction logic is required.
   > > In summary, I suggest not using `ConnectionPool`. By the way, please add a chinese doc.
   > 
   > Hi , I added the Chinese doc. In addition, regarding token refresh, I added a Schedule to `DsqlConnectionPoolManager`, and the token was refreshed every ten minutes, and the test results showed normal.
   
   tokenRefreshExecutor should shutdown() when close 


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3419251000

   +1 if CI passed


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3228069504

   Initially, I did consider using JDBC to implement the DSQL sink functionality. However, due to DSQL's unique characteristics that differ from other databases, implementing it based on JDBC might alter existing logic and affect other databases. This would require investing significant time in testing and verification to ensure correct logic without impacting other database functionalities. Currently, I don't have much time to invest in this approach, though perhaps it could be done in the future. And this DSQL sink connector I've submitted is implemented based on real user migration needs, and I hope it can be merged. Thank you!


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3389695034

   I have used jdbc to implement the sink function of dsql.The following two screenshots are the results of running.
   
   <img width="1780" height="784" alt="mysql_to_dsql_jdbc_finish" src="https://github.com/user-attachments/assets/b253819b-3b2e-4ac0-96cd-281865bb0f67" />
   <img width="1322" height="701" alt="source target compare" src="https://github.com/user-attachments/assets/083b7354-fc14-4abf-86d8-38a87b2808ce" />
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3283436039

   Could you provide the screenshots that write data into DSQL success? For example, the job end with finished status, and DSQL had data to query.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "cloud456 (via GitHub)" <gi...@apache.org>.
cloud456 commented on PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#issuecomment-3223576097

   Glad to hear it.Do you have any schedule for this? Just to mention, it's not only about implementing refreshPassword in JdbcConnectionProvider, but also redesigning JdbcConnectionConfig. DSQL doesn't require a username and password; instead, it creates a password using ak/sk or profile combined with region and cluster endpoint. Therefore, its parameter requirements for JdbcConnectionConfig are different, potentially changing the original parameter requirements, such as making username and password mandatory in the original design


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on code in PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#discussion_r2426151929


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dsql/DsqlJdbcConnectionProvider.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.dsql;
+
+import org.apache.seatunnel.common.utils.JdbcUrlUtil;
+import org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcConnectionConfig;
+import org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorErrorCode;
+import org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException;
+import org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.SimpleJdbcConnectionProvider;
+
+import lombok.NonNull;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.dsql.DsqlUtilities;
+import software.amazon.awssdk.services.dsql.model.GenerateAuthTokenRequest;
+
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public class DsqlJdbcConnectionProvider extends SimpleJdbcConnectionProvider {
+
+    private AwsCredentialsProvider provider;
+    private DsqlUtilities dsqlUtilities;
+
+    public DsqlJdbcConnectionProvider(@NonNull JdbcConnectionConfig jdbcConfig) {
+        super(jdbcConfig);
+        this.provider =
+                new AwsCredentialsProvider() {
+                    @Override
+                    public AwsCredentials resolveCredentials() {
+                        return AwsBasicCredentials.create(
+                                jdbcConfig.getAccessKeyId(), jdbcConfig.getSecretAccessKey());
+                    }
+                };
+        this.dsqlUtilities =
+                DsqlUtilities.builder()
+                        .region(Region.of(jdbcConfig.getRegion()))
+                        .credentialsProvider(provider)
+                        .build();
+    }
+
+    @Override
+    public Connection getOrEstablishConnection() throws SQLException, ClassNotFoundException {
+        if (isConnectionValid()) {
+            return connection;
+        }
+        Driver driver = getLoadedDriver();
+        Properties info = new Properties();
+        if (jdbcConfig.getUsername().isPresent()) {
+            info.setProperty("user", jdbcConfig.getUsername().get());
+        }
+        String url = jdbcConfig.getUrl();
+        JdbcUrlUtil.UrlInfo urlInfo = JdbcUrlUtil.getUrlInfo(url);
+        info.setProperty("password", generateAuthToken(urlInfo.getHost()));
+
+        info.putAll(jdbcConfig.getProperties());
+
+        connection = driver.connect(url, info);
+        if (connection == null) {
+            // Throw same exception as DriverManager.getConnection when no driver found to match
+            // caller expectation.
+            throw new JdbcConnectorException(
+                    JdbcConnectorErrorCode.NO_SUITABLE_DRIVER,
+                    "No suitable driver found for " + url);
+        }
+
+        connection.setAutoCommit(jdbcConfig.isAutoCommit());
+
+        return connection;
+    }
+
+    private String generateAuthToken(String clusterEndpoint) {
+        JdbcConnectionConfig jdbcConfig = super.getJdbcConfig();
+        GenerateAuthTokenRequest tokenGenerator =
+                GenerateAuthTokenRequest.builder()
+                        .hostname(clusterEndpoint)
+                        .region(Region.of(jdbcConfig.getRegion()))
+                        .credentialsProvider(this.provider)
+                        .build();
+
+        if ("admin".equals(jdbcConfig.getUsername())) {
+            return dsqlUtilities.generateDbConnectAdminAuthToken(tokenGenerator);

Review Comment:
   It can't work fine because jdbcConfig.getUsername() return type `Optional<String>`



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support sink connector for AWS DSQL #9726 [seatunnel]

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #9739:
URL: https://github.com/apache/seatunnel/pull/9739#discussion_r2313975423


##########
seatunnel-connectors-v2/connector-dsql/README.md:
##########
@@ -0,0 +1,255 @@
+# AWS DSQL Sink Connector

Review Comment:
   We don't need README. We need docs in https://github.com/apache/seatunnel/tree/dev/docs/en/connector-v2/sink



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org