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

Add support for Bool type for ClickHouse connector #25337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codeDing18
Copy link

Description

fix #25130

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

Copy link

cla-bot bot commented Mar 18, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the clickhouse ClickHouse connector label Mar 18, 2025
Copy link

cla-bot bot commented Mar 18, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@codeDing18
Copy link
Author

@cla-bot check

Copy link

cla-bot bot commented Mar 18, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Mar 18, 2025

The cla-bot has been summoned, and re-checked this pull request!

@@ -638,6 +639,8 @@ public Optional<ColumnMapping> toColumnMapping(ConnectorSession session, Connect
ClickHouseColumn column = ClickHouseColumn.of("", jdbcTypeName);
ClickHouseDataType columnDataType = column.getDataType();
switch (columnDataType) {
case Bool:
return Optional.of(booleanColumnMapping());
Copy link
Member

Choose a reason for hiding this comment

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

Please update the following comment in toWriteMapping method:

// ClickHouse is no separate type for boolean values. Use UInt8 type, restricted to the values 0 or 1.

Copy link
Member

Choose a reason for hiding this comment

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

Which ClickHouse version introduced Bool type?

Copy link
Author

Choose a reason for hiding this comment

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

Which ClickHouse version introduced Bool type?

Support for Bool data type after v21.12. https://clickhouse.com/docs/whats-new/changelog/2021#clickhouse-release-212

Copy link
Author

@codeDing18 codeDing18 Mar 19, 2025

Choose a reason for hiding this comment

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

Please update the following comment in toWriteMapping method:

// ClickHouse is no separate type for boolean values. Use UInt8 type, restricted to the values 0 or 1.

ok. I have revised the comment.

// Type bool is internally stored as UInt8. Possible values are true (1), false (0).

Copy link
Member

Choose a reason for hiding this comment

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

Also, what is the oldest supported version of ClickHouse? I'm asking this question because we also want to change the write mapping if all supported versions support boolean type.

Copy link
Author

Choose a reason for hiding this comment

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

The oldest supported version of ClickHouse is v21.12. This version was released on 2021-12-15

Copy link

cla-bot bot commented Mar 19, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the docs label Mar 19, 2025
@ebyhr
Copy link
Member

ebyhr commented Mar 20, 2025

@codeDing18 Did you submit CLA?

@codeDing18
Copy link
Author

@cla-bot check

Copy link

cla-bot bot commented Mar 20, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Mar 20, 2025

The cla-bot has been summoned, and re-checked this pull request!

@ebyhr
Copy link
Member

ebyhr commented Mar 20, 2025

@codeDing18 check command doesn't work unless your CLA is registered.

@codeDing18
Copy link
Author

@codeDing18 check command doesn't work unless your CLA is registered.

I sent the CLA email 7 days ago. email is csding18@qq.com.

@ebyhr
Copy link
Member

ebyhr commented Mar 20, 2025

@codeDing18 Note that CLA is processed every 2 weeks.

@codeDing18
Copy link
Author

@codeDing18 Note that CLA is processed every 2 weeks.

If the email is processed, will I receive a message notification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clickhouse ClickHouse connector docs
Development

Successfully merging this pull request may close these issues.

Add support for Bool type for ClickHouse connector
2 participants