-
Notifications
You must be signed in to change notification settings - Fork 459
Spec: Clarify variant shredding spec #512
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
Conversation
b1ad692 to
28e8dc2
Compare
| The element's `value` field stores the element as Variant-encoded `binary` when the `typed_value` is not present or cannot represent it. | ||
| The `typed_value` field may be omitted when not shredding elements as a specific type. | ||
| When `typed_value` is omitted, `value` must be `required`. | ||
| The `value` field may be omitted when shredding elements as a specific type. |
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.
It is fine to say that one of the fields must be present and that value can be omitted (though it is not necessary).
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.
Should we also clarify whether they can/should be optional vs required or either?
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 reviewing. In line 68, we have the statement
Both
valueandtyped_valueare optional fields used together to encode a single value.
to serve the overall value shredding. I think we don't need to mention in different places.
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.
That means the test cases which test with the fields being required should also get notes that they are invalid based on the spec?
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 we have such case in the tests. The case we have is: the group should be required but it's passed in as optional. For example:
required group event_type {
optional binary value;
optional binary typed_value (STRING);
}
|
Thanks for the review, @zeroshade! I'll merge this. |
Rationale for this change
From the test in apache/arrow-go#455 which validates the cross-language variant implementation, we may need to update a few wording in the spec to make it clear
What changes are included in this PR?
valueandtyped_valuefields can be omitted but not both in array elements.Do these changes have PoC implementations?