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

Support for Variant/Dynamic/JSON types #939

Open
arnaudbriche opened this issue Dec 20, 2024 · 4 comments
Open

Support for Variant/Dynamic/JSON types #939

arnaudbriche opened this issue Dec 20, 2024 · 4 comments

Comments

@arnaudbriche
Copy link
Contributor

Hi,

I'm just wondering if you are planning on supporting the new set of semi-structured data types.

@SpencerTorres
Copy link
Member

This is how they are supported in clickhouse-go:

I would like to add some support for them, but we would need to make sure it fits the performance goals of ch-go. There's some overhead for working with these types, and we need to find a user-friendly way to read/write this type of data.

@tanner-bruce
Copy link

Is it possible to write to a JSON type column via ch-go? We do not need to to query it through ch-go.

@SpencerTorres
Copy link
Member

You may be able to use String, I think the server can automatically cast it. I haven't checked in a while though.

Adding Variant and Dynamic would need some discussion given their complexity, but JSON has support for string encoding. Perhaps we can add a JSONString type pretty easily since it's just String with a u64 prefix. You would need to handle marshal/unmarshal yourself though

@SpencerTorres
Copy link
Member

Just in case String doesn't directly insert into JSON (and for easily reading JSON directly), I have added ColJSONStr in #1034. Check the PR description for some notes on usage.

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

No branches or pull requests

3 participants