-
Notifications
You must be signed in to change notification settings - Fork 161
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
[DISCUSS] Should we allow options to be declared at the top level of a function definition #673
Comments
The argument descriptions feel similarly painful... |
There are some arithmetic functions where the options do not apply to all implementations (fp addition does not specify overflow behavior for example). I don't know if there are any implementations where the arguments differ based on the implementation. What if argument / option descriptions were at the function level but each implementation still listed which options / arguments apply?
We could also leave the option's "values" at the function level (so each function just has an array of option names) The only programmatic tool I know of that would be impacted is the BFT and I think it already reports options / arguments at the function level so there would be some benefit to align the two models. |
I'm a fan of argument/option descriptions at the function level. We have a fun of other functions where all this information is put into the descriptions that's already at the function level, and it seems like it could be organized better. Some of the string functions for example: https://github.com/substrait-io/substrait/blob/main/extensions/functions_string.yaml#L61 |
For the sake of discussion, an alternative would be to allow multiple types in the args'
If multiple args specify lists of types, then all combinations of those would be considered valid. This could be useful especially if the function takes two or more arguments and they don't necessarily need to be of the same type (though maybe then the output type gets complicated). The "logical" types could be e.g. integers (i8 .. i64), numerics (i8 .. i64, fp32, fp64, decimal?), strings (string, varchar, fixedchar). |
I'd rather treat this as a yaml problem and solve with anchors/aliases. for example this works fine for me in python w/o any changes to the code. The new
|
We evaluated this when we originally wrote the format. We found that anchors/aliases are not reliably implemented in many yaml parsers. I wonder if the status is any better today... |
The
rounding
blocks in this file:https://github.com/substrait-io/substrait/blob/main/extensions/functions_rounding.yaml
Make my eyes hurt and destroy my DRY soul. How about we add support for options to be declared at the same level as function name so these patterns aren't this awful...
Thoughts @EpsilonPrime @vbarua @westonpace ?
The text was updated successfully, but these errors were encountered: