[v1] Function data type mismatches (known at compile-time) return missing in strict mode #1680
Open
Description
Description
Currently, PError.FUNCTION_TYPE_MISMATCH
has a default severity of warning. Because of this, the standard error listener used during planning will not give an error in strict mode when there's a function data type mismatch. The function data type mismatch will create a RexError
node --
ExprMissing
node.
To Reproduce
Run the following query in strict mode
'foo' || 123
^ will output missing
If the type involved in the function/operation is not always a data type mismatch, the query will give the expected error at evaluation time:
SELECT v.a + 2 FROM [{'a':1}, {'a':'foo'}] v
^ will error:
org.partiql.errors.TypeCheckException: Could not find function plus with types: [STRING, INTEGER].
Expected Behavior
- Expect the query
'foo' || 123
to give an error in strict mode - I think we should also make function data type mismatches (
PError.FUNCTION_TYPE_MISMATCH
) an error by default so the standard error listener will give an error at plan-time
Additional Context
- Java version: 11
- PartiQL version: v1 rc.3
- Add any other context about the problem here.