My questions:
  - in 1. The plan use the function promote. Is this to ensure the type
is correct for the addition function?
  - in 1b. Why does the type here show anyAtomicType instead of integer?


The add function you use in the query is defined as an operator in the builtin-operators.xml file. Remember that this operator is polymorphic. It can add integers, doubles, duration to dates etc. So the static type of the operator's argument specify that they should be the supertype of all acceptable argument types and that is anyAtomicType in this case.

You are correct in that the promote will ensure that the input data is compliant with the expected argument type of the addition function.

At runtime, the function needs to make sure that the inputs are correct and throw a dynamic error otherwise.

Vinayak

Reply via email to