[fix](fe) Detect Doris JDBC targets with stable server identity - #68321
Open
suxiaogang223 wants to merge 3 commits into
Open
suxiaogang223 wants to merge 3 commits into
suxiaogang223 wants to merge 3 commits into
Conversation
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: JDBC Catalog can misidentify an enterprise Doris endpoint as MySQL when its version comment omits optional product markers. This skips Doris-specific type mapping and can expose incorrect schemas. Recognize the stable enterprise version prefix in both JDBC client implementations while retaining the existing compatibility rules.
### Release note
Fix JDBC Catalog type mapping for enterprise Doris endpoints whose version comment omits optional product markers.
### Check List (For Author)
- Test: Unit Test
- Legacy and connector JDBC endpoint detection tests
- Behavior changed: Yes, recognized enterprise endpoints use Doris-specific type mapping
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: JDBC Catalog infers whether a MySQL-compatible endpoint is Doris from version_comment. Product branding and packaging can change that display string and cause Doris-specific types to be mapped as MySQL types. Expose a stable read-only session variable, prefer it in both JDBC client implementations, and retain version_comment as a fallback for older endpoints.
### Release note
Use a stable server identity when detecting Doris JDBC endpoints.
### Check List (For Author)
- Test: Unit Test
- Legacy and connector JDBC endpoint identity and compatibility detection tests
- Behavior changed: Yes, JDBC Catalog prefers doris_server_identity and falls back to version_comment for older endpoints
- Does this need documentation: No
suxiaogang223
requested review from
924060929,
CalvinKirs and
morrySnow
as code owners
September 21, 2026 07:34
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 27218 ms |
Contributor
TPC-DS: Total hot run time: 152387 ms |
Contributor
ClickBench: Total hot run time: 23.76 s |
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Use the generic read-only session variable name `server_identity` for stable JDBC server identification and update both JDBC client implementations to query it.
### Release note
Rename the read-only JDBC server identity variable to `server_identity`.
### Check List (For Author)
- Test: Unit Test
- JdbcMySQLClientTest
- JdbcMySQLConnectorClientTest
- Behavior changed: Yes. The read-only identity variable is exposed as `server_identity`.
- Does this need documentation: No
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 27523 ms |
Contributor
TPC-DS: Total hot run time: 151711 ms |
Contributor
ClickBench: Total hot run time: 24.21 s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
JDBC Catalog currently decides whether a MySQL-compatible endpoint is Doris by parsing
version_comment. That value is display text and may change with product branding or packaging. When the expected marker is absent, the endpoint is treated as MySQL and Doris-specific types can be mapped incorrectly.This change exposes a stable, read-only
doris_server_identitysession variable with the valueapache_doris. Both JDBC client implementations probe this variable first and use exact identity matching. If the remote endpoint does not expose the variable, they fall back to the existingversion_commentdetection so older endpoints remain compatible.The compatibility adjustment for existing enterprise version comments remains a separate commit, allowing it to be reviewed or applied independently.
Release note
Use a stable server identity when detecting Doris JDBC endpoints, with backward-compatible fallback for older endpoints.
Check List (For Author)
./run-fe-ut.sh --run org.apache.doris.datasource.jdbc.client.JdbcMySQLClientTest,org.apache.doris.connector.jdbc.client.JdbcMySQLConnectorClientTest