-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
In inconsistent parameter context:
Each argument can be any possible concrete type afforded by the bounds
of any parameter defined in the arguments specification.
For example:
urn: "urn:example:extension"
scalar_functions:
- name: "inconsistent_sum"
impls:
- args:
- value: "decimal<P,S>"
variadic:
min: 1
parameterConsistency: INCONSISTENT
return: "decimal<38,S>"
This means that the following are valid:
inconsistent_sum(decimal<10, 2>, decimal<10, 2>, decimal<10, 2>)
inconsistent_sum(decimal<10, 2>, decimal<10, 2>)
inconsistent_sum(decimal<15, 8>, decimal<11, 8>, decimal<119, 8>)
On the other hand, the following are all invalid:
inconsistent_sum(decimal<10, 2>, decimal<10, 3>, decimal<10, 4>)
inconsistent_sum(decimal<10, 2>, i32)
The above example is showing that there is the implicit constraint across the variadic parameters that the scale S must be the same as the output (and thus must all be the same across the variadic parameter). On the other hand, the precision P is free to be anything. But all of the parameters do have to be decimal.
Metadata
Metadata
Assignees
Labels
No labels