Skip to content
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

[Feature] Support clickhouse jdbc datasource(#40894) #42930

Merged

Conversation

DataScientistSamChan
Copy link
Contributor

@DataScientistSamChan DataScientistSamChan commented Mar 21, 2024

Why I'm doing:

Enhance current clickhouse JDBC datasource support.

What I'm doing:

Support more fine-grained clickhouse JDBC datasource with partition information detection and more fine grained data types.

Fixes #issue
#40894

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@CLAassistant
Copy link

CLAassistant commented Mar 21, 2024

CLA assistant check
All committers have signed the CLA.

}

}
}
Copy link

Choose a reason for hiding this comment

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

How can I help you today?

Copy link
Contributor

@zombee0 zombee0 left a comment

Choose a reason for hiding this comment

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

clang-format

if (type != TYPE_DATE) {
return Status::NotSupported(
fmt::format("Type mismatches on column[{}], JDBC result type is Date, please set the type to date",
slot_desc->col_name()));
}
return TYPE_VARCHAR;
return TYPE_DATE;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be TYPE_VARCHAR, fixed.

}
}

public static void main(String[] args) {
Copy link
Contributor

Choose a reason for hiding this comment

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

testing code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, I am kind of using the git for synchronizing the code between local mac and my dev server, hence, the main for test. It's all cleaned up in the latest commit. With unittest added, and function working just fine in my environment.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 28, 2024
@wanpengfei-git wanpengfei-git requested a review from a team March 28, 2024 03:37
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Apr 8, 2024
@wanpengfei-git wanpengfei-git removed the request for review from a team April 8, 2024 06:36
wangsimo0
wangsimo0 previously approved these changes Apr 8, 2024
@@ -97,7 +97,7 @@ jobs:
feature-review:
needs: info
runs-on: [ self-hosted, normal ]
if: github.event_name == 'pull_request_review' && contains(needs.info.outputs.LABELS, 'feature') && !contains(needs.info.outputs.LABELS, 'sync') && !startsWith(needs.info.outputs.HEAD_REF, 'mergify/')
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this?

Youngwb
Youngwb previously approved these changes Apr 11, 2024
dirtysalt
dirtysalt previously approved these changes Apr 12, 2024
wangsimo0
wangsimo0 previously approved these changes Apr 12, 2024
@DataScientistSamChan DataScientistSamChan force-pushed the feature/support_jdbc_clickhouse branch 9 times, most recently from 0f9f70a to 4014e46 Compare April 18, 2024 01:35
Copy link

sonarcloud bot commented Apr 18, 2024

Copy link

[FE Incremental Coverage Report]

pass : 53 / 66 (80.30%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/connector/jdbc/ClickhouseSchemaResolver.java 49 62 79.03% [56, 57, 66, 67, 68, 70, 73, 74, 75, 76, 79, 136, 144]
🔵 com/starrocks/catalog/JDBCTable.java 2 2 100.00% []
🔵 com/starrocks/connector/jdbc/JDBCMetadata.java 2 2 100.00% []

Copy link

[BE Incremental Coverage Report]

fail : 6 / 34 (17.65%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exec/jdbc_scanner.cpp 6 34 17.65% [199, 201, 202, 204, 206, 207, 209, 211, 212, 215, 217, 227, 228, 231, 233, 250, 251, 253, 255, 271, 272, 274, 276, 327, 328, 329, 331, 333]

@imay imay merged commit 36501fe into StarRocks:main Apr 18, 2024
47 of 49 checks passed
@zombee0
Copy link
Contributor

zombee0 commented Apr 19, 2024

https://github.com/Mergifyio backport branch-3.3

Copy link
Contributor

mergify bot commented Apr 19, 2024

backport branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 19, 2024
Why I'm doing:
Enhance current clickhouse JDBC datasource support.

What I'm doing:
Support more fine-grained clickhouse JDBC datasource with partition information detection and more fine grained data types.

Fixes #issue
#40894

Signed-off-by: samcchen <[email protected]>
(cherry picked from commit 36501fe)
leiyang0324 pushed a commit to leiyang0324/starrocks that referenced this pull request Apr 19, 2024
…cks#42930)

Why I'm doing:
Enhance current clickhouse JDBC datasource support.

What I'm doing:
Support more fine-grained clickhouse JDBC datasource with partition information detection and more fine grained data types.

Fixes #issue
StarRocks#40894

Signed-off-by: samcchen <[email protected]>
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.

9 participants