-
Notifications
You must be signed in to change notification settings - Fork 166
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
docs: clarify language around user-defined types #604
Conversation
```yaml | ||
name: u32 | ||
structure: "FIXEDBINARY<4>" | ||
``` |
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.
Based on my understanding, if the intent of the structure
field is to provide a way for systems that do not support the user-define type to create and transfer values of it, this won't work very well because the systems in questions won't have enough information to create a binary version of that type.
That being said, implicitly if there is no structure and a system without support for a type is given a value of that type, the only thing that system can do is pass the value around as a binary blob.
Context: https://substrait.slack.com/archives/C02D7CTQXHD/p1707328717290129 Inlining for posterity
|
bf21fd6
to
bd5956d
Compare
buf is complaining about
I ran a couple of quick checks on this. First, decoding a binary encoded version of the message against the old and new protobufs:
The decoded message is the same across both version. Checking the JSON, both the old and new protobufs generate the same JSON {
"userDefined": {
"typeReference": 0,
"value": {
"@type": "type.googleapis.com/google.protobuf.Int64Value",
"value": "42"
},
"typeParameters": []
},
"nullable": false,
"typeVariationReference": 0
} The rule it is triggering is FIELD_SAME_ONEOF.
In this case, following the link shows that we have something similar to one of the exception cases:
Effectively the issue that they are guarding against is moving a field into a oneof, and then if that field is set it will clear other messages in the oneof. In this case, as there is only 1 existing field ( IMO we can ignore this for this PR. |
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.
Yep, this should be safe (even the buf guidance says it can be but it is just doing the easy check instead).
No description provided.