Skip to content

Conversation

@corgy-w
Copy link
Contributor

@corgy-w corgy-w commented Feb 25, 2025

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@corgy-w corgy-w requested a review from Hisoka-X March 18, 2025 06:55
@hailin0
Copy link
Member

hailin0 commented Apr 1, 2025

waiting ci passed

@hailin0 hailin0 requested a review from Copilot April 1, 2025 14:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes JDBC dialect selection by introducing a dedicated dialect configuration that takes precedence over URL inspection. Key changes include:

  • Adding a new method (dialectFactoryName) across various dialect factory classes.
  • Enhancing JdbcDialectLoader to select the appropriate dialect based on an explicit configuration.
  • Updating configuration classes and documentation to support the new dialect option.

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

File Description
connector-jdbc/internal/dialect/* Adds the dialectFactoryName() method to all dialect factories, returning the corresponding identifier from DatabaseIdentifier.
JdbcDialectLoader.java Overloads and adjusts the load() method to allow explicit selection via a new dialect parameter.
JdbcOptions.java, JdbcConnectionConfig.java Introduces a new configuration option ("dialect") to support explicit dialect selection.
docs/* Updates documentation to reflect the new dialect configuration option.
Comments suppressed due to low confidence (1)

seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialectLoader.java:65

  • Consider enhancing the check for 'dialect' to also verify that it is not an empty or blank string. For example: 'if (dialect != null && !dialect.trim().isEmpty()) {'.
if (dialect != null) {

| password | String | No | - | password |
| query | String | No | - | Query statement |
| compatible_mode | String | No | - | The compatible mode of database, required when the database supports multiple compatible modes.<br/> For example, when using OceanBase database, you need to set it to 'mysql' or 'oracle'. <br/> when using starrocks, you need set it to `starrocks` |
| dialect | String | No | - | The appointed dialect, if it does not exist, is still obtained according to the url, and the priority is higher than the url. <br/> For example,when using starrocks, you need set it to `starrocks` |
Copy link

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] There is a missing space after the comma in 'For example,when using starrocks,'.

Suggested change
| dialect | String | No | - | The appointed dialect, if it does not exist, is still obtained according to the url, and the priority is higher than the url. <br/> For example,when using starrocks, you need set it to `starrocks` |
| dialect | String | No | - | The appointed dialect, if it does not exist, is still obtained according to the url, and the priority is higher than the url. <br/> For example, when using starrocks, you need set it to `starrocks` |

Copilot uses AI. Check for mistakes.
@hailin0 hailin0 merged commit 92c62c5 into apache:dev Apr 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants