Skip to content

Commit

Permalink
Per PR feedback, removes FROM and UNPIVOT mistyping cases
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed May 21, 2024
1 parent 1da4e8b commit b3bf59f
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 165 deletions.
32 changes: 13 additions & 19 deletions partiql-tests-data/eval/primitives/date-time.ion
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@ regression::[
{
name:"dateTimePartsAsVariableNames",
statement:"SELECT VALUE [year, month, day, hour, minute, second] FROM 1968 AS year, 4 AS month, 3 as day, 12 as hour, 31 as minute, 59 as second",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
[
1968,
4,
3,
12,
31,
59
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
[
1968,
4,
3,
12,
31,
59
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
]
}
},
{
name:"dateTimePartsAsStructFieldNames",
Expand Down
170 changes: 68 additions & 102 deletions partiql-tests-data/eval/query/select/from-clause.ion
Original file line number Diff line number Diff line change
Expand Up @@ -86,82 +86,64 @@ envs::{
{
name:"selectFromScalarAndAtUnpivotWildCardOverScalar",
statement:"SELECT VALUE [n, v] FROM (100).* AS v AT n",
assert: [
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
[
$missing::null,
100
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
[
"_1",
100
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
]
}
},
{
name:"selectFromListAndAtUnpivotWildCardOverScalar",
statement:"SELECT VALUE [n, (SELECT VALUE [i, x] FROM @v AS x AT i)] FROM [100, 200].*.*.* AS v AT n",
assert: [
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
[
$missing::null,
$bag::[
[
0,
100
],
[
1,
200
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
[
"_1",
$bag::[
[
0,
100
],
[
1,
200
]
]
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
]
}
},
{
name:"selectFromBagAndAtUnpivotWildCardOverScalar",
statement:"SELECT VALUE [n, (SELECT VALUE [i IS MISSING, i, x] FROM @v AS x AT i)] FROM <<100, 200>>.* AS v AT n",
assert: [
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
[
$missing::null,
$bag::[
[
true,
$missing::null,
100
],
[
true,
$missing::null,
200
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
[
"_1",
$bag::[
[
true,
$missing::null,
100
],
[
true,
$missing::null,
200
]
]
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
]
}
},
{
name:"selectPathUnpivotWildCardOverStructMultiple",
Expand Down Expand Up @@ -249,37 +231,27 @@ envs::{
{
name:"rangeOverScalar",
statement:"SELECT VALUE v FROM 1 AS v",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[ 1 ]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
1
]
}
},
{
name:"rangeTwiceOverScalar",
statement:"SELECT VALUE [v1, v2] FROM 1 AS v1, @v1 AS v2",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
[
1,
1
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
[
1,
1
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
]
}
},
{
name:"rangeOverSexp",
Expand All @@ -297,21 +269,15 @@ envs::{
{
name:"rangeOverStruct",
statement:"SELECT VALUE v FROM `{a:5}` AS v",
assert: [
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
{
a:5
}
]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
{
a:5
}
]
}
},
{
name:"rangeOverList",
Expand Down
64 changes: 20 additions & 44 deletions partiql-tests-data/eval/spec-tests.ion
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,11 @@
{
name: "single source FROM with scalar",
statement: "SELECT x FROM someOrderedTable[0].a AS x",
assert: [
{
evalMode: EvalModeCoerce,
result: EvaluationSuccess,
output: $bag::[{x: 0}]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
}
]
assert: {
evalMode: [EvalModeCoerce, EvalModeError],
result: EvaluationSuccess,
output: $bag::[{x: 0}]
}
},
{
name: "single source FROM with scalar and AT clause",
Expand All @@ -175,17 +169,11 @@
{
name: "single source FROM with tuple",
statement: "SELECT x FROM {'someKey': 'someValue' } AS x",
assert: [
{
evalMode: EvalModeCoerce,
result: EvaluationSuccess,
output: $bag::[{x: {someKey: "someValue"}}]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
}
]
assert: {
evalMode: [EvalModeCoerce, EvalModeError],
result: EvaluationSuccess,
output: $bag::[{x: {someKey: "someValue"}}]
}
},
{
name: "single source FROM with tuple and AT clause",
Expand All @@ -205,17 +193,11 @@
{
name: "single source FROM with absent value null",
statement: "SELECT x FROM NULL AS x",
assert: [
{
evalMode: EvalModeCoerce,
result: EvaluationSuccess,
output: $bag::[{x: null}]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
}
]
assert: {
evalMode: [EvalModeCoerce, EvalModeError],
result: EvaluationSuccess,
output: $bag::[{x: null}]
}
},
{
name: "single source FROM with absent value null and AT clause",
Expand All @@ -235,17 +217,11 @@
{
name: "single source FROM with absent value missing",
statement: "SELECT x FROM MISSING AS x",
assert: [
{
evalMode: EvalModeCoerce,
result: EvaluationSuccess,
output: $bag::[{}]
},
{
evalMode: EvalModeError,
result: EvaluationFail,
},
]
assert: {
evalMode: [EvalModeCoerce, EvalModeError],
result: EvaluationSuccess,
output: $bag::[{}]
}
},
{
name: "single source FROM with absent value missing and AT clause",
Expand Down

0 comments on commit b3bf59f

Please sign in to comment.