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

[client-v2] Added support of reading new JSON as string #1909

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chernser
Copy link
Contributor

@chernser chernser commented Nov 5, 2024

Summary

This PR allows reading values from columns of new experimental JSON data type.

  • If text base format - then user has to parse a string value to a JSON object. It is available today.
  • If Binary format - then user should call getString(columnNameOrIndex) to get string representation of an JSON object and then parse it. This PR just enables reading from JSON typed columns.

It is important to set 2 server settings:

  • .serverSetting("allow_experimental_json_type", "1") - to just allow using the new Data Type.
  • .serverSetting("output_format_binary_write_json_as_string", "1") - ask server to return JSON as string when one of binary formats is requested.

Note: current PR is to bring essential capability of using JSON as string to the client.

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@chernser chernser marked this pull request as draft November 5, 2024 22:24
Copy link

sonarcloud bot commented Nov 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
55.2% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant