substrait-io / substrait

A cross platform way to express data transformation, relational algebra, standardized record expression and plans.
https://substrait.io
Apache License 2.0
1.18k stars 154 forks source link

fix: specify a minimum length for the options of enum args #642

Closed mbrobbel closed 4 months ago

mbrobbel commented 4 months ago

This came up in a discussion on a substrait-rs PR: it doesn't make sense for the options field of enum args to be empty. This PR modifies the schema to state that the options array of enum args should be non-empty.

I recommend reviewers to take a look at the first commit to see what this PR changes, the second commit is applying auto-formatting and moving the variants of oneOf to reference other definitions, and adding a def for enum_options.

This is a breaking change, because extensions with empty options array are no longer considered valid.

westonpace commented 4 months ago

I also don't know if you need to call it a breaking change. I would say any extension function with an empty options array was already invalid, we just weren't checking it for it.