You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 --
. After planning, that error node will be converted into an 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.
The text was updated successfully, but these errors were encountered:
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 aRexError
node --partiql-lang-kotlin/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt
Lines 757 to 759 in b651415
ExprMissing
node.To Reproduce
Run the following query in strict mode
^ 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:
^ will error:
Expected Behavior
'foo' || 123
to give an error in strict modePError.FUNCTION_TYPE_MISMATCH
) an error by default so the standard error listener will give an error at plan-timeAdditional Context
The text was updated successfully, but these errors were encountered: