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 map_string_as_varchar session property in ClickHouse #10601

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jan 14, 2022

Relates to #7102

Docs will be handled in #7099

@cla-bot cla-bot bot added the cla-signed label Jan 14, 2022
@ebyhr
Copy link
Member Author

ebyhr commented Jan 14, 2022

CI hit #10363

@ebyhr ebyhr requested review from hashhar and findepi January 14, 2022 04:28
.addRoundTrip("Nullable(FixedString(10))", "NULL", VARCHAR, "CAST(NULL AS varchar)")
.addRoundTrip("Nullable(FixedString(10))", "'c12345678b'", VARCHAR, "CAST('c12345678b' AS varchar)")
.addRoundTrip("Nullable(FixedString(10))", "'c123'", VARCHAR, "CAST('c123\0\0\0\0\0\0' AS varchar)")
.execute(getQueryRunner(), mapStringAsVarcharSession(), clickhouseCreateAndInsert("tpch.test_fixed_string"));
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to have a test when we insert without mapStringAsVarcharSession and read with it, and vice versa?

@ebyhr ebyhr force-pushed the ebi/clickhouse-map-string-as-varchar-session-properties branch from 5a0c630 to 4e41546 Compare January 14, 2022 09:54
@ebyhr ebyhr merged commit 1f3653a into trinodb:master Jan 14, 2022
@ebyhr ebyhr deleted the ebi/clickhouse-map-string-as-varchar-session-properties branch January 14, 2022 12:26
@ebyhr ebyhr mentioned this pull request Jan 14, 2022
@hashhar
Copy link
Member

hashhar commented Jan 14, 2022

Question : Could the same effect be achieved via jdbc-types-mapped-to-varchar?

@ebyhr
Copy link
Member Author

ebyhr commented Jan 14, 2022

Yes if users specify the name including the length.

  • map-string-as-varchar map all FixedString to varchar regardless of the length.
  • jdbc-types-mapped-to-varchar expects the entire type name. e.g. FixedString(5)

@github-actions github-actions bot added this to the 369 milestone Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants