diff --git a/partiql-tests-data/eval/misc.ion b/partiql-tests-data/eval/misc.ion index a302ce1..75c516e 100644 --- a/partiql-tests-data/eval/misc.ion +++ b/partiql-tests-data/eval/misc.ion @@ -110,18 +110,24 @@ uncategorized::[ { name:"selectValueStructConstructorWithMissing", statement:"SELECT VALUE {'x': a.x, 'y': a.y} FROM `[{x:5}, {y:6}]` AS a", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - x:5 - }, - { - y:6 - } - ] - } + assert: [ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + { + x:5 + }, + { + y:6 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"selectIndexStruct", diff --git a/partiql-tests-data/eval/primitives/operators/bag-operators.ion b/partiql-tests-data/eval/primitives/operators/bag-operators.ion index ef5e3e5..29fad6c 100644 --- a/partiql-tests-data/eval/primitives/operators/bag-operators.ion +++ b/partiql-tests-data/eval/primitives/operators/bag-operators.ion @@ -126,7 +126,6 @@ bagOperators::[ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, output:$bag::[ - 1, 2 ] } diff --git a/partiql-tests-data/eval/query/group-by/group-by.ion b/partiql-tests-data/eval/query/group-by/group-by.ion index c7431db..b5a4232 100644 --- a/partiql-tests-data/eval/query/group-by/group-by.ion +++ b/partiql-tests-data/eval/query/group-by/group-by.ion @@ -1666,134 +1666,153 @@ { name:"SELECT supplierId_missings FROM products_sparse p GROUP BY p.supplierId_missings", statement:"SELECT supplierId_missings FROM products_sparse p GROUP BY p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_missings:10 - }, - { - supplierId_missings:11 - }, - { - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + supplierId_missings:10 + }, + { + supplierId_missings:11 + }, + { + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.supplierId_missings FROM products_sparse p GROUP BY p.supplierId_missings", statement:"SELECT p.supplierId_missings FROM products_sparse p GROUP BY p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_missings:10 - }, - { - supplierId_missings:11 - }, - { - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + supplierId_missings:10 + }, + { + supplierId_missings:11 + }, + { + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT VALUE { 'supplierId_missings' : p.supplierId_missings } FROM products_sparse p GROUP BY p.supplierId_missings", statement:"SELECT VALUE { 'supplierId_missings' : p.supplierId_missings } FROM products_sparse p GROUP BY p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_missings:10 - }, - { - supplierId_missings:11 - }, - { - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + supplierId_missings:10 + }, + { + supplierId_missings:11 + }, + { + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT supplierId_mixed FROM products_sparse p GROUP BY p.supplierId_mixed", statement:"SELECT supplierId_mixed FROM products_sparse p GROUP BY p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_mixed:10 - }, - { - supplierId_mixed:11 - }, - { - supplierId_mixed:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + supplierId_mixed:10 + }, + { + supplierId_mixed:11 + }, + { + supplierId_mixed:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.supplierId_mixed FROM products_sparse p GROUP BY p.supplierId_mixed", statement:"SELECT p.supplierId_mixed FROM products_sparse p GROUP BY p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_mixed:10 - }, - { - supplierId_mixed:11 - }, - { - supplierId_mixed:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + supplierId_mixed:10 + }, + { + supplierId_mixed:11 + }, + { + supplierId_mixed:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT VALUE { 'supplierId_mixed' : p.supplierId_mixed } FROM products_sparse p GROUP BY p.supplierId_mixed", statement:"SELECT VALUE { 'supplierId_mixed' : p.supplierId_mixed } FROM products_sparse p GROUP BY p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - supplierId_mixed:10 - }, - { - supplierId_mixed:11 - }, - { - supplierId_mixed:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + supplierId_mixed:10 + }, + { + supplierId_mixed:11 + }, + { + supplierId_mixed:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT regionId, supplierId_nulls FROM products_sparse p GROUP BY p.regionId, p.supplierId_nulls", @@ -1872,224 +1891,242 @@ { name:"SELECT regionId, supplierId_missings FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", statement:"SELECT regionId, supplierId_missings FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_missings:10 - }, - { - regionId:100, - supplierId_missings:11 - }, - { - regionId:100, - supplierId_missings:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_missings:10 - }, - { - regionId:200, - supplierId_missings:11 - }, - { - regionId:200, - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_missings:10 + }, + { + regionId:100, + supplierId_missings:11 + }, + { + regionId:100, + supplierId_missings:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_missings:10 + }, + { + regionId:200, + supplierId_missings:11 + }, + { + regionId:200, + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.regionId, p.supplierId_missings FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", statement:"SELECT p.regionId, p.supplierId_missings FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_missings:10 - }, - { - regionId:100, - supplierId_missings:11 - }, - { - regionId:100, - supplierId_missings:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_missings:10 - }, - { - regionId:200, - supplierId_missings:11 - }, - { - regionId:200, - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_missings:10 + }, + { + regionId:100, + supplierId_missings:11 + }, + { + regionId:100, + supplierId_missings:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_missings:10 + }, + { + regionId:200, + supplierId_missings:11 + }, + { + regionId:200, + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT VALUE { 'regionId': p.regionId, 'supplierId_missings': p.supplierId_missings } FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", statement:"SELECT VALUE { 'regionId': p.regionId, 'supplierId_missings': p.supplierId_missings } FROM products_sparse p GROUP BY p.regionId, p.supplierId_missings", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_missings:10 - }, - { - regionId:100, - supplierId_missings:11 - }, - { - regionId:100, - supplierId_missings:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_missings:10 - }, - { - regionId:200, - supplierId_missings:11 - }, - { - regionId:200, - supplierId_missings:null // missing coerced to null as per 11.1.1 - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_missings:10 + }, + { + regionId:100, + supplierId_missings:11 + }, + { + regionId:100, + supplierId_missings:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_missings:10 + }, + { + regionId:200, + supplierId_missings:11 + }, + { + regionId:200, + supplierId_missings:null // missing coerced to null as per 11.1.1 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT regionId, supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", statement:"SELECT regionId, supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_mixed:10 - }, - { - regionId:100, - supplierId_mixed:11 - }, - { - regionId:100, - supplierId_mixed:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_mixed:10 - }, - { - regionId:200, - supplierId_mixed:11 - }, - { - regionId:200, - supplierId_mixed:null - } - ] - } - }, - { - name:"SELECT regionId, p.supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", - statement:"SELECT regionId, p.supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_mixed:10 - }, - { - regionId:100, - supplierId_mixed:11 - }, - { - regionId:100, - supplierId_mixed:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_mixed:10 - }, - { - regionId:200, - supplierId_mixed:11 - }, - { - regionId:200, - supplierId_mixed:null - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_mixed:10 + }, + { + regionId:100, + supplierId_mixed:11 + }, + { + regionId:100, + supplierId_mixed:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_mixed:10 + }, + { + regionId:200, + supplierId_mixed:11 + }, + { + regionId:200, + supplierId_mixed:null + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT regionId, p.supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", + statement:"SELECT regionId, p.supplierId_mixed FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_mixed:10 + }, + { + regionId:100, + supplierId_mixed:11 + }, + { + regionId:100, + supplierId_mixed:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_mixed:10 + }, + { + regionId:200, + supplierId_mixed:11 + }, + { + regionId:200, + supplierId_mixed:null + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT VALUE { 'regionId': p.regionId, 'supplierId_mixed': p.supplierId_mixed } FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", statement:"SELECT VALUE { 'regionId': p.regionId, 'supplierId_mixed': p.supplierId_mixed } FROM products_sparse p GROUP BY p.regionId, p.supplierId_mixed", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - regionId:100, - supplierId_mixed:10 - }, - { - regionId:100, - supplierId_mixed:11 - }, - { - regionId:100, - supplierId_mixed:null // missing coerced to null as per 11.1.1 - }, - { - regionId:200, - supplierId_mixed:10 - }, - { - regionId:200, - supplierId_mixed:11 - }, - { - regionId:200, - supplierId_mixed:null - } - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + regionId:100, + supplierId_mixed:10 + }, + { + regionId:100, + supplierId_mixed:11 + }, + { + regionId:100, + supplierId_mixed:null // missing coerced to null as per 11.1.1 + }, + { + regionId:200, + supplierId_mixed:10 + }, + { + regionId:200, + supplierId_mixed:11 + }, + { + regionId:200, + supplierId_mixed:null + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, ] @@ -5714,172 +5751,202 @@ { name:"SELECT COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:5 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:15.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:15.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:1.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:1.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:5.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:3.0 - } - ] - } - }, - { - name:"SELECT COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p", - statement:"SELECT COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:5 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:3.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p", + statement:"SELECT COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p", + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:15.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:15.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:1.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:1.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:5.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p", statement:"SELECT COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - the_count:10, - the_agg:3.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + the_count:10, + the_agg:3.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", @@ -6247,133 +6314,18 @@ categoryId:21, the_count:6, the_agg:4.5 - } - ] - }, - { - result:EvaluationFail, - evalMode: EvalModeError, - }, - ] - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3 - }, - { - categoryId:21, - the_count:6, - the_agg:2 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:6.0 - }, - { - categoryId:21, - the_count:6, - the_agg:9.0 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:1.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.0 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3.0 - }, - { - categoryId:21, - the_count:6, - the_agg:5.0 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:2.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.5 - } - ] - } + } + ] + }, + { + result:EvaluationFail, + evalMode: EvalModeError, + }, + ] }, { - name:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + name:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6395,8 +6347,8 @@ } }, { - name:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + name:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6418,8 +6370,8 @@ } }, { - name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6441,8 +6393,8 @@ } }, { - name:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + name:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6464,8 +6416,8 @@ } }, { - name:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + name:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6486,120 +6438,265 @@ ] } }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3 + }, + { + categoryId:21, + the_count:6, + the_agg:2 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:6.0 + }, + { + categoryId:21, + the_count:6, + the_agg:9.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:1.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3.0 + }, + { + categoryId:21, + the_count:6, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:2.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, { name:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3 - }, - { - categoryId:21, - the_count:6, - the_agg:2 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3 + }, + { + categoryId:21, + the_count:6, + the_agg:2 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", statement:"SELECT categoryId, COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:6.0 - }, - { - categoryId:21, - the_count:6, - the_agg:9.0 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:1.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:6.0 + }, + { + categoryId:21, + the_count:6, + the_agg:9.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] + }, + { + name:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:1.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", statement:"SELECT categoryId, COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3.0 - }, - { - categoryId:21, - the_count:6, - the_agg:5.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3.0 + }, + { + categoryId:21, + the_count:6, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", statement:"SELECT categoryId, COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:2.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.5 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:2.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", @@ -7094,232 +7191,262 @@ { name:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3 - }, - { - categoryId:21, - the_count:6, - the_agg:2 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3 + }, + { + categoryId:21, + the_count:6, + the_agg:2 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, SUM(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:6.0 - }, - { - categoryId:21, - the_count:6, - the_agg:9.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:6.0 + }, + { + categoryId:21, + the_count:6, + the_agg:9.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, MIN(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:1.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:1.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, MAX(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3.0 - }, - { - categoryId:21, - the_count:6, - the_agg:5.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3.0 + }, + { + categoryId:21, + the_count:6, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, AVG(p.price_missings) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:2.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.5 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:2.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3 - }, - { - categoryId:21, - the_count:6, - the_agg:2 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3 + }, + { + categoryId:21, + the_count:6, + the_agg:2 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, SUM(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:6.0 - }, - { - categoryId:21, - the_count:6, - the_agg:9.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:6.0 + }, + { + categoryId:21, + the_count:6, + the_agg:9.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, MIN(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:1.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:1.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, MAX(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:3.0 - }, - { - categoryId:21, - the_count:6, - the_agg:5.0 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:3.0 + }, + { + categoryId:21, + the_count:6, + the_agg:5.0 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SELECT p.categoryId, COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", statement:"SELECT p.categoryId, COUNT(1) AS the_count, AVG(p.price_mixed) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$bag::[ - { - categoryId:20, - the_count:4, - the_agg:2.0 - }, - { - categoryId:21, - the_count:6, - the_agg:4.5 - } - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode: EvalModeCoerce, + output:$bag::[ + { + categoryId:20, + the_count:4, + the_agg:2.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.5 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, ] @@ -7375,8 +7502,8 @@ } }, { - name:"Expression with multiple subqueriees containing aggregates : CAST((SELECT COUNT(1) FROM products) AS LIST)[0]._1 / CAST((SELECT COUNT(1) FROM suppliers) AS LIST)[0]._1", - statement:"CAST((SELECT COUNT(1) FROM products) AS LIST)[0]._1 / CAST((SELECT COUNT(1) FROM suppliers) AS LIST)[0]._1", + name:"Expression with multiple subqueries containing aggregates : (SELECT COUNT(1) FROM products) / (SELECT COUNT(1) FROM suppliers)", + statement:"(SELECT COUNT(1) FROM products) / (SELECT COUNT(1) FROM suppliers)", assert:{ result:EvaluationSuccess, evalMode:[ @@ -7387,8 +7514,8 @@ } }, { - name:"Aggregates with subquery containing another aggregate : SELECT COUNT(1) + CAST((SELECT SUM(numInStock) FROM products) AS LIST)[0]._1 as a_number FROM products", - statement:"SELECT COUNT(1) + CAST((SELECT SUM(numInStock) FROM products) AS LIST)[0]._1 as a_number FROM products", + name:"Aggregates with subquery containing another aggregate : SELECT COUNT(1) + (SELECT SUM(numInStock) FROM products) as a_number FROM products", + statement:"SELECT COUNT(1) + (SELECT SUM(numInStock) FROM products) as a_number FROM products", assert:{ result:EvaluationSuccess, evalMode:[ @@ -7449,18 +7576,7 @@ EvalModeCoerce, EvalModeError ], - output:$bag::[ - $bag::[ - { - the_sum:1 - } - ], - $bag::[ - { - the_sum:1 - } - ] - ] + output:$bag::[1, 1] } }, { diff --git a/partiql-tests-data/eval/query/select/from-clause.ion b/partiql-tests-data/eval/query/select/from-clause.ion index 728cbff..5b7865d 100644 --- a/partiql-tests-data/eval/query/select/from-clause.ion +++ b/partiql-tests-data/eval/query/select/from-clause.ion @@ -198,26 +198,32 @@ envs::{ { name:"ordinalAccessWithNegativeIndex", statement:"SELECT temp[-2] FROM <<[1,2,3,4]>> AS temp", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - } - ] - } + assert:[ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ {} ] + }, + { + evalMode: EvalModeError, + result: EvaluationFail, + }, + ] }, { name:"ordinalAccessWithNegativeIndexAndBindings", statement:"SELECT temp[-2] FROM [[1,2,3,4]] AS temp", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - } - ] - } + assert:[ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ {} ] + }, + { + evalMode: EvalModeError, + result: EvaluationFail, + }, + ] } ] @@ -254,11 +260,9 @@ envs::{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, output:$bag::[ - ( - a - b - c - ) + a, + b, + c ] } }, @@ -361,45 +365,57 @@ envs::{ { name:"rangeOverBagWithAt", statement:"SELECT VALUE [i, v] FROM <<1, 2, 3>> AS v AT i", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - [ - $missing::null, - 1 - ], - [ - $missing::null, - 2 - ], - [ - $missing::null, - 3 + assert: [ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + [ + $missing::null, + 1 + ], + [ + $missing::null, + 2 + ], + [ + $missing::null, + 3 + ] ] - ] - } + }, + { + evalMode: EvalModeError, + result: EvaluationFail, + }, + ] }, { name:"rangeOverNestedWithAt", statement:"SELECT VALUE [i, v] FROM (SELECT VALUE v FROM `[1, 2, 3]` AS v) AS v AT i", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - [ - $missing::null, - 1 - ], - [ - $missing::null, - 2 - ], - [ - $missing::null, - 3 + assert: [ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + [ + $missing::null, + 1 + ], + [ + $missing::null, + 2 + ], + [ + $missing::null, + 3 + ] ] - ] - } + }, + { + evalMode: EvalModeError, + result: EvaluationFail, + }, + ] } ] diff --git a/partiql-tests-data/eval/query/select/projection.ion b/partiql-tests-data/eval/query/select/projection.ion index cc26bd9..91c6bc9 100644 --- a/partiql-tests-data/eval/query/select/projection.ion +++ b/partiql-tests-data/eval/query/select/projection.ion @@ -4,16 +4,22 @@ { name:"undefinedUnqualifiedVariable_inSelect_withProjectionOption", statement:"SELECT s.a, s.undefined_variable, s.b FROM `[{a:100, b:200}]` s", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - a:100, - b:200 - } - ] - } + assert: [ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + { + a:100, + b:200 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"projectionIterationBehaviorUnfiltered_select_list", diff --git a/partiql-tests-data/eval/query/select/select.ion b/partiql-tests-data/eval/query/select/select.ion index 21e4ef8..283694f 100644 --- a/partiql-tests-data/eval/query/select/select.ion +++ b/partiql-tests-data/eval/query/select/select.ion @@ -239,18 +239,24 @@ envs::{ { name:"selectListWithMissing", statement:"SELECT a.x AS x, a.y AS y FROM `[{x:5}, {y:6}]` AS a", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - x:5 - }, - { - y:6 - } - ] - } + assert: [ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + { + x:5 + }, + { + y:6 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] } ] diff --git a/partiql-tests-data/eval/query/select/sql-aggregate.ion b/partiql-tests-data/eval/query/select/sql-aggregate.ion index 9c2c65b..bb28bca 100644 --- a/partiql-tests-data/eval/query/select/sql-aggregate.ion +++ b/partiql-tests-data/eval/query/select/sql-aggregate.ion @@ -653,24 +653,30 @@ sql_any::[ FROM << {'a': 1, 'b': 10}, {'a': 1, 'b': 17}, {'a': 2, 'b': 20}, {'a': 3} >> AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"ANY DISTINCT with GROUP BY", @@ -679,24 +685,30 @@ sql_any::[ FROM [ {'a': 1, 'b': 10}, {'a': 1, 'b': 17}, {'a': 2, 'b': 20}, {'a': 3} ] AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] } ] @@ -708,24 +720,30 @@ sql_some::[ FROM << {'a': 1, 'b': 10}, {'a': 1, 'b': 17}, {'a': 2, 'b': 20}, {'a': 3} >> AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"SOME DISTINCT with GROUP BY", @@ -734,24 +752,30 @@ sql_some::[ FROM [ {'a': 1, 'b': 10}, {'a': 1, 'b': 17}, {'a': 2, 'b': 20}, {'a': 3} ] AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert:[ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] } ] @@ -763,24 +787,30 @@ sql_every::[ FROM << {'a': 1, 'b': 10}, {'a': 1, 'b': 11}, {'a': 2, 'b': 20}, {'a': 3} >> AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name:"EVERY DISTINCT with GROUP BY", @@ -789,24 +819,30 @@ sql_every::[ FROM [ {'a': 1, 'b': 10}, {'a': 1, 'b': 11}, {'a': 2, 'b': 20}, {'a': 3} ] AS x GROUP BY x.a ''', - assert:{ - result:EvaluationSuccess, - evalMode:[EvalModeCoerce, EvalModeError], - output:$bag::[ - { - a: 1, - e: true - }, - { - a: 2, - e: false - }, - { - a: 3, - e: null - }, - ] - } + assert: [ + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$bag::[ + { + a: 1, + e: true + }, + { + a: 2, + e: false + }, + { + a: 3, + e: null + }, + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] } ] @@ -832,31 +868,11 @@ multiple_sql_aggregates::[ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, output:$bag::[ - $bag::[ - { - result:27. - } - ], - $bag::[ - { - result:29.0 - } - ], - $bag::[ - { - result:31. - } - ], - $bag::[ - { - result:33. - } - ], - $bag::[ - { - result:35. - } - ] + 27., + 29.0, + 31., + 33., + 35. ] } }, diff --git a/partiql-tests-data/eval/query/undefined-variable-behavior.ion b/partiql-tests-data/eval/query/undefined-variable-behavior.ion index 440ab76..7ea66cb 100644 --- a/partiql-tests-data/eval/query/undefined-variable-behavior.ion +++ b/partiql-tests-data/eval/query/undefined-variable-behavior.ion @@ -51,15 +51,21 @@ undefined_variable_behavior::[ { name:"undefinedUnqualifiedVariableInSelectWithUndefinedVariableBehaviorMissing", statement:"SELECT s.a, s.undefined_variable, s.b FROM `[{a:100, b:200}]` s", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - a:100, - b:200 - } - ] - } + assert:[ + { + evalMode:EvalModeCoerce, + result:EvaluationSuccess, + output:$bag::[ + { + a:100, + b:200 + } + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] } ] diff --git a/partiql-tests-data/eval/spec-tests.ion b/partiql-tests-data/eval/spec-tests.ion index 90f6ef7..6d138fc 100644 --- a/partiql-tests-data/eval/spec-tests.ion +++ b/partiql-tests-data/eval/spec-tests.ion @@ -305,38 +305,62 @@ { name: "attribute value evaluates to MISSING", statement: "SELECT VALUE {'a':v.a, 'b':v.b} FROM [{'a':1, 'b':1}, {'a':2}] AS v", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[{a:1, b:1}, {a:2}] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[{a:1, b:1}, {a:2}] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "array element evaluates to MISSING", statement: "SELECT VALUE [v.a, v.b] FROM [{'a':1, 'b':1}, {'a':2}] AS v", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[[1, 1], [2, $missing::null]] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[[1, 1], [2, $missing::null]] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "bag element evaluates to MISSING", statement: "SELECT VALUE v.b FROM [{'a':1, 'b':1}, {'a':2}] AS v", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[1, $missing::null] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[1, $missing::null] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "bag element evaluates to MISSING in bag constructor", statement: "SELECT VALUE <> FROM [{'a':1, 'b':1}, {'a':2}] AS v", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[$bag::[1, 1], $bag::[2, $missing::null]] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[$bag::[1, 1], $bag::[2, $missing::null]] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "pivot into a tuple", @@ -388,11 +412,17 @@ { name: "cast and operations with missing argument", statement: "SELECT VALUE {'a':3*v.a, 'b':3*(CAST(v.b AS INTEGER))} FROM [{'a':1, 'b':'1'}, {'a':2}] v", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[{a:3, b:3}, {a:6}] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[{a:3, b:3}, {a:6}] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "missing value in arithmetic expression", @@ -583,11 +613,17 @@ { name: "WHERE clause eliminating absent values", statement: "SELECT VALUE v.a FROM [{'a':1, 'b':true}, {'a':2, 'b':null}, {'a':3}] v WHERE v.b", - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[1] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[1] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "null is missing", @@ -697,15 +733,21 @@ {co:0.5} ] }, - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[ - {sensor:1, readings:$bag::[0.4, 0.2]}, - {sensor:2, readings:$bag::[0.3]}, - {sensor:null, readings:$bag::[0.1, 0.5]} - ] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[ + {sensor:1, readings:$bag::[0.4, 0.2]}, + {sensor:2, readings:$bag::[0.3]}, + {sensor:null, readings:$bag::[0.1, 0.5]} + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "group by with differenciated absent values", @@ -725,16 +767,22 @@ {co:0.5} ] }, - assert: { - evalMode: [EvalModeCoerce, EvalModeError], - result: EvaluationSuccess, - output: $bag::[ - {sensor:1, readings:$bag::[0.4, 0.2]}, - {sensor:2, readings:$bag::[0.3]}, - {sensor:null, readings:$bag::[0.1]}, - {readings:$bag::[0.5]} - ] - } + assert: [ + { + evalMode: EvalModeCoerce, + result: EvaluationSuccess, + output: $bag::[ + {sensor:1, readings:$bag::[0.4, 0.2]}, + {sensor:2, readings:$bag::[0.3]}, + {sensor:null, readings:$bag::[0.1]}, + {readings:$bag::[0.5]} + ] + }, + { + evalMode:EvalModeError, + result:EvaluationFail + }, + ] }, { name: "windowing simplified with grouping",