-
Notifications
You must be signed in to change notification settings - Fork 432
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
GH-459: Add Variant logical type annotation #460
base: master
Are you sure you want to change the base?
Conversation
LogicalTypes.md
Outdated
|
||
* The top level must be a group annotated with `VARIANT` that contains a | ||
`binary` field named `metadata`, and a `binary` field named `value`. | ||
* Additional fields which start with `_` (underscore) can be ignored. |
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.
Why is this needed? None of the other types allow writing columns that should be ignored.
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.
This was desired in case there were some additional (but redundant) metadata or values we might store, and still allow it to be a valid Variant value (group).
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.
I don't think that we want to add ignored columns. If we need to update the spec because something is missing, we should just do that directly instead of working around it with unspecified columns that only work in certain proprietary cases.
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.
I see. I was worried that future evolution could break existing stored Variants, but simply adding a new field with optional or redundant semantics achieves the same compatibility story. This is removed.
/** | ||
* Embedded Variant logical type annotation | ||
*/ | ||
struct VariantType { |
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.
Looks good to me.
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.
@rdblue Thanks! I updated the PR.
LogicalTypes.md
Outdated
|
||
* The top level must be a group annotated with `VARIANT` that contains a | ||
`binary` field named `metadata`, and a `binary` field named `value`. | ||
* Additional fields which start with `_` (underscore) can be ignored. |
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.
This was desired in case there were some additional (but redundant) metadata or values we might store, and still allow it to be a valid Variant value (group).
This looks close to me. I think we just need to fix two things:
|
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.
@rdblue Thanks! I updated the PR.
LogicalTypes.md
Outdated
|
||
* The top level must be a group annotated with `VARIANT` that contains a | ||
`binary` field named `metadata`, and a `binary` field named `value`. | ||
* Additional fields which start with `_` (underscore) can be ignored. |
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.
I see. I was worried that future evolution could break existing stored Variants, but simply adding a new field with optional or redundant semantics achieves the same compatibility story. This is removed.
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.
Thanks for the updates! This look good to me.
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.
+1
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.
LGTM.
Rationale for this change
Add a variant logical type.
What changes are included in this PR?
Additions to the types thrift definition, and the description of the logical type. The actual Variant spec documents are unchanged, and will be addressed later in a separate PR.
Closes #459