Closed johnedquinn closed 1 month ago
Regardless of any of the above, I believe the following must have the same result in permissive and strict modes:
PartiQL> select value t[2] from <<[1,2,MISSING,4]>> as t
|
==='
<<
MISSING
>>
We should add a test to ensure this.
The crux of the issue here is (as noted above) that the spec talks about 3 sources of 'generated' MISSING
values:
For cases 1 & 2, the spec differentiates strict and permissive mode, saying that:
MISSING
value, and For case 3, the spec says it results in a MISSING
value, but doesn't mention any modes, so it is ambiguous whether that means both permissive and strict.
The @partiql/partiql maintainers and @almann discussed this PR. As a summary:
Each one of these expressions returns MISSING: 5 + MISSING 5 > 'a' NOT {a:1}
If I have missed anything, please feel free to add more comments.
Description
Fixes around 100 missing arguments tests. Previous ones didn't fail in EvalModeError when inputs were the missing value.
Example of one of the tests:
From the PartiQL Specification (Section 7.1: Inputs with wrong types):
An important thing to note is the use of "the permissive option of PartiQL has to define semantics for the case where the inputs of a function are not compatible with the function/predicate arguments." It goes on to describe the missing value as inputs, and it defines the behavior in permissive mode. It doesn't explicitly specify what happens in strict mode, however, we may assume the same behavior seen in all other sections of the Specification. See Section 5.1.1 Mistyping Cases, Section 5.2.1 Mistyping cases, Section 4.1 Tuple path evaluation on wrongly typed data, etc.
Another example of throwing errors comes down to the role of schema in type checking. From Section 4.1.1:
NOTE: You should review using "Ignore whitespace". I used auto-formatting on fixed test files using the IDE since the formatting was poor.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.