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 non-struct type class structure #328

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

jvanstraten
Copy link
Contributor

This implements and documents the things discussed in https://substrait.slack.com/archives/C02D7CTQXHD/p1662542471566549.

jacques-n
jacques-n previously approved these changes Sep 22, 2022
Copy link
Contributor

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

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

Lgtm. Thanks for formalizing this @jvanstraten

```

This declares a new type (namespaced to the associated YAML file) called "point". This type is composed of two `i32` values named longitude and latitude. Once a type has been declared, it can be used in function declarations. [TBD: should field references be allowed to dereference the components of a user defined type?]
The structure field of a type is only intended to inform systems that don't have built-in support for the type how they can transfer the data type from one point to another without unnecessarily serialization/deserialization *and* without loss of type safety. Note that it is currently not possible to "unpack" a user-defined type class into its structure type or components thereof without also defining a function to do that packing/unpacking.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The structure field of a type is only intended to inform systems that don't have built-in support for the type how they can transfer the data type from one point to another without unnecessarily serialization/deserialization *and* without loss of type safety. Note that it is currently not possible to "unpack" a user-defined type class into its structure type or components thereof without also defining a function to do that packing/unpacking.
The structure field of a type is only intended to inform systems that don't have built-in support for the type how they can transfer the data type from one point to another without unnecessary serialization/deserialization *and* without loss of type safety. Note that it is currently not possible to "unpack" a user-defined type class into its structure type or components thereof without also defining a function to do that packing/unpacking.

Small typo but also, I don't really understand this last sentence. Can you expand on what you mean here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed typo and reworded sentence in ad75c2a. Does it make more sense when written that way? The point is to get rid of the TBD w.r.t. whether FieldRefs can index into non-opaque user-defined types.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, thank you. The new wording is clear.

@jvanstraten jvanstraten merged commit dd7f9f0 into substrait-io:main Sep 27, 2022
@jvanstraten jvanstraten deleted the type-class-structure branch September 27, 2022 14:15
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