In the below sections, I'll elaborate on the tests fixed.
Fixes FROM Mistyping Cases
In the following cases the expression in the FROM clause item has the wrong type. Under the type checking option, all of these cases raise an error and the query fails. Under the permissive option, the cases proceed as follows:
Iteration over a scalar value: Consider the query:
FROM s AS v AT p
or the query:
FROM s AS v
where s is a scalar value. Then s coerces into the bag << s >>, i.e., the bag that has a single element, the s. The
rest of the semantics is identical to what happens when the lhs of the FROM item is a bag.
In the following cases the expression in the FROM UNPIVOT clause item has the “wrong” type, i.e., it is not a tuple. Under the type checking option, all of these cases raise an error and the query fails. Under the permissive option, the cases proceed as follows:
...
Similarly, for a given 𝑞 at compile (i.e. planning) time, a database type environment... and variables type environment ... are defined. The type environment is a binding tuple ... where each 𝑥𝑖 is a name that is unique and binds to the PartiQL type𝜏𝑖. For schema-less values, 𝜏 can be considered the union of any possible type (for which all operations are potentially applicable).
Description
In the below sections, I'll elaborate on the tests fixed.
Fixes FROM Mistyping Cases
Fixes UNPIVOT Mistyping Cases
Fixes undefined variable tests
Fixes Join Null Output Cases
For example, LEFT JOIN should make the RHS null if the LHS is not matched.
Fixes Outer Union Mistyping Cases
See https://github.com/partiql/partiql-lang/issues/76
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.