-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[opt](jdbc catalog) Compatible with higher ClickHouse JDBC Driver versions #46026
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
TPC-H: Total hot run time: 32422 ms
|
TPC-DS: Total hot run time: 190176 ms
|
ClickBench: Total hot run time: 31.42 s
|
This pull request introduces significant enhancements to the Enhancements to
|
private boolean determineDatabaseTerm() { | ||
try (Connection conn = getConnection()) { | ||
String jdbcUrl = conn.getMetaData().getURL(); | ||
// 获取驱动版本是否大于等于 0.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English
* true will be returned. | ||
* 2. If it is an old version driver (<0.5.0), always returns false. | ||
*/ | ||
private boolean isDatabaseTermCatalog() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to check and fill the databaseTermIsCatalog
when creating the catalog.
(for old version, user can call refresh
to fill this field, added to the document).
So that we don't need to use this synchronized
things, which make the code hard to maintain.
run buildall |
TPC-H: Total hot run time: 32848 ms
|
TPC-DS: Total hot run time: 189085 ms
|
ClickBench: Total hot run time: 31.12 s
|
@@ -379,10 +378,11 @@ private void testJdbcConnection() throws DdlException { | |||
|
|||
private void testFeToJdbcConnection() throws DdlException { | |||
try { | |||
initLocalObjectsImpl(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move this method to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing the client in the method that tests FE's external connection is more convenient for process control, rather than outside this method
String[] versionParts = driverVersion.split("\\."); | ||
int majorVersion = Integer.parseInt(versionParts[0]); | ||
int minorVersion = Integer.parseInt(versionParts[1]); | ||
// 判断是否大于等于 0.5.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English.
And we should add UT for this method
613e095
to
9ab4125
Compare
9ab4125
to
2e8831c
Compare
run buildall |
TPC-H: Total hot run time: 32438 ms
|
TPC-DS: Total hot run time: 194020 ms
|
ClickBench: Total hot run time: 31.34 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…sions (apache#46026) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: 1. Since clickhouse changes the database level in jdbc metadata from schema to catalog in JDBC Driver 0.5.0 and later, we need to be compatible with this change 2. Since clickhouse JDBC Driver supports getting metadata from prepared statements only in Driver version 0.6.2 and later, if you use query tvf to query clickhouse catalog, you need to use a driver later than this version 3. Delete some tests and add them again later
…sions (apache#46026) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: 1. Since clickhouse changes the database level in jdbc metadata from schema to catalog in JDBC Driver 0.5.0 and later, we need to be compatible with this change 2. Since clickhouse JDBC Driver supports getting metadata from prepared statements only in Driver version 0.6.2 and later, if you use query tvf to query clickhouse catalog, you need to use a driver later than this version 3. Delete some tests and add them again later
…sions (#46026) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: 1. Since clickhouse changes the database level in jdbc metadata from schema to catalog in JDBC Driver 0.5.0 and later, we need to be compatible with this change 2. Since clickhouse JDBC Driver supports getting metadata from prepared statements only in Driver version 0.6.2 and later, if you use query tvf to query clickhouse catalog, you need to use a driver later than this version 3. Delete some tests and add them again later
…sions (apache#46026) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: 1. Since clickhouse changes the database level in jdbc metadata from schema to catalog in JDBC Driver 0.5.0 and later, we need to be compatible with this change 2. Since clickhouse JDBC Driver supports getting metadata from prepared statements only in Driver version 0.6.2 and later, if you use query tvf to query clickhouse catalog, you need to use a driver later than this version 3. Delete some tests and add them again later
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)