-
Notifications
You must be signed in to change notification settings - Fork 190
feat: default value for parameterConsistency #929
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
base: main
Are you sure you want to change the base?
Conversation
extensions/functions_comparison.yaml
Outdated
| - value: any1 | ||
| variadic: | ||
| min: 2 | ||
| parameterConsistency: CONSISTENT |
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.
I added this to the docs in the note part of scalar_functions.md, but I believe that consistent vs inconsistent doesn't matter here. This is because any1 in the return type pins the argument.
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.
So I actually ended up removing this line. It falsely communicates to the user that parameterConsistency set to CONSISTENT is an important attribute here. In actuality, the any1 value is pinned by the return type, so all of them MUST be fixed, regardless of the parameterConsistency setting.
As part of this PR, I wanted to try and come up with some useful and standard scalar functions to add to the core extension set that demonstrate the use of both values of parameterConsistency, but I couldn't think of any or find any off the internet. This was introduced in 2021. Perhaps we should discuss if this feature is worth supporting?
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.
Okay actually, I found postgresql's JSON_BUILD_OBJECT, which is an example of a function where variadic INCONSISTENT behavior is desirable.
closes #928