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

feat: support nullable and non-default variation user-defined types #217

Merged
merged 4 commits into from
Jun 9, 2022

Conversation

jvanstraten
Copy link
Contributor

As mentioned on slack (and encountered in the validator, though I'd forgotten about it apparently), it's currently impossible to specify nullability for user-defined types. It was also impossible to specify variations, which I see no reason to disallow, but there was no conclusion about that yet. If we do think that should be illegal, I'll also update the type docs in this PR to mention this (and why).

@jacques-n
Copy link
Contributor

I'm good with this but let's leave open for a couple days to see if anyone has a disagreement with it.

@jacques-n
Copy link
Contributor

@cpcloud @westonpace are you good with this change happening?

westonpace
westonpace previously approved these changes Jun 5, 2022
Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

References to user-defined types are normally referred to as just
"type_reference" and "type_anchor", without "user_defined_" prefix.
@jvanstraten
Copy link
Contributor Author

I guess it's bad form to push to a PR that's already under review and more-or-less accepted, but I had some realizations of my own:

  • I named the user-defined type reference field user_defined_type_reference without really thinking about it, while in algebra.proto and extensions.proto the field is juse named type_[reference|anchor]. Better to just keep things as consistent as possible.
  • Updated the type expression and parameterized type protos accordingly, which I didn't think to do until I started looking at them more thoroughly today.

@jacques-n jacques-n merged commit 5851b02 into substrait-io:main Jun 9, 2022
@jvanstraten jvanstraten deleted the nullable-types branch June 29, 2022 18:36
westonpace pushed a commit to apache/arrow that referenced this pull request Jul 5, 2022
Note: I actually upgraded to v0.6.0; it didn't make much sense to me to not just go to the latest release. I guess I'll downgrade if there was a specific reason for going to exactly v0.3.0 that I'm not aware of.

Stuff that broke:
 - `relations.proto` and `expressions.proto` were merged into `algebra.proto` in substrait-io/substrait#136
 - Breaking change in how file formats are specified in read relations: substrait-io/substrait#169
 - Deprecation in specification of function arguments, switched to the new format (supporting the old one as well would be a bit more work, which I'm not sure is worthwhile at this stage): substrait-io/substrait#161
 - Deprecation of `user_defined_type_reference` in `Type`, replacing it with a message that also supports nullability: substrait-io/substrait#217

Authored-by: Jeroen van Straten <[email protected]>
Signed-off-by: Weston Pace <[email protected]>
drin pushed a commit to drin/arrow that referenced this pull request Jul 5, 2022
Note: I actually upgraded to v0.6.0; it didn't make much sense to me to not just go to the latest release. I guess I'll downgrade if there was a specific reason for going to exactly v0.3.0 that I'm not aware of.

Stuff that broke:
 - `relations.proto` and `expressions.proto` were merged into `algebra.proto` in substrait-io/substrait#136
 - Breaking change in how file formats are specified in read relations: substrait-io/substrait#169
 - Deprecation in specification of function arguments, switched to the new format (supporting the old one as well would be a bit more work, which I'm not sure is worthwhile at this stage): substrait-io/substrait#161
 - Deprecation of `user_defined_type_reference` in `Type`, replacing it with a message that also supports nullability: substrait-io/substrait#217

Authored-by: Jeroen van Straten <[email protected]>
Signed-off-by: Weston Pace <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants