-
Notifications
You must be signed in to change notification settings - Fork 569
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 Dynamic Type #1454
Add Dynamic Type #1454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API is pretty much the same as for Variant. Looks good, but might have the same concerns for type access functions as for Variant. How do you want to proceed with these PRs?
…to dynamic_type
Included fixes/nits from the Variant PR, including adding tests for std sql. Also added a minimum server version check for the examples since that was causing test failures. I still expect some server side changes to the Dynamic format in the future, but this should be ready to review/merge as is |
Note: There are some server-side bugs that need to be fixed/merged, including a protocol update. However, this PR can still be reviewed as-is.
Summary
Implement
Dynamic
column type. Partially resolves #1430.Usage
As for usage, this is the same as
clickhouse.Variant
, with the addition of an alias type calledclickhouse.Dynamic
. See Variant PR for more details on how these types work (#1453).Since the Dynamic type starts as a blank Variant, it is best to append using
clickhouse.NewDynamicWithType(value, "ClickHouseTypeName")
so the underlying column can be created correctly. If a type isn't specified, a type inference function is used, but this may not always work as intended.Examples are included in examples folder.
Checklist
Delete items not relevant to your PR: