Skip to content

Commit

Permalink
Add some more bag op coercion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Aug 9, 2024
1 parent e50dc1c commit e08ad01
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions partiql-tests-data/eval/primitives/operators/bag-operators.ion
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ bagOperators::[
]
}
},
// outer union coercion
{
name:"outerUnionCoerceScalar",
statement:"1 OUTER UNION 2",
Expand Down Expand Up @@ -214,6 +215,135 @@ bagOperators::[
]
}
},
// outer intersect coercion
{
name:"outerIntersectCoerceScalar",
statement:"1 OUTER INTERSECT 1",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
1
]
},
{
evalMode:EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerIntersectCoerceStruct",
statement:"{'a': 1} OUTER INTERSECT {'a': 1}",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
{
a:1
}
]
},
{
evalMode:EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerIntersectCoerceNullMissing",
statement:"NULL OUTER INTERSECT MISSING",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
]
},
{
evalMode: EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerIntersectCoerceList",
statement:"[ 1, 1, 1 ] OUTER INTERSECT ALL [ 1, 2 ]",
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
1
]
}
},
// outer except coercion
{
name:"outerExceptCoerceScalar",
statement:"1 OUTER EXCEPT 2",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
1
]
},
{
evalMode:EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerExceptCoerceStruct",
statement:"{'a': 1} OUTER EXCEPT {'b': 2}",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
{
a:1
}
]
},
{
evalMode:EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerExceptCoerceNullMissing",
statement:"NULL OUTER EXCEPT MISSING",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
]
},
{
evalMode: EvalModeError,
result:EvaluationFail
},
]
},
{
name:"outerExceptCoerceList",
statement:"[ 1, 1, 1 ] OUTER EXCEPT ALL [ 1, 2 ]",
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
1,
1
]
}
},
{
name:"OUTER UNION with ORDER BY LIMIT OFFSET on children",
statement:"(SELECT a, tbl FROM t1 ORDER BY a LIMIT 1 OFFSET 1) OUTER UNION ALL (SELECT a, tbl FROM t2 ORDER BY a LIMIT 1 OFFSET 1)",
Expand Down

0 comments on commit e08ad01

Please sign in to comment.