From 3dba584495606c6b7fe0f3bb3fa11b1a6c8595fe Mon Sep 17 00:00:00 2001 From: John Ed Quinn Date: Wed, 17 Apr 2024 12:17:50 -0700 Subject: [PATCH] Fixes even more tests --- partiql-tests-data/eval/misc.ion | 30 +- .../eval/query/group-by/group-by.ion | 2015 +++++++++-------- .../eval/query/select/projection.ion | 26 +- .../eval/query/select/select.ion | 30 +- .../eval/query/select/sql-aggregate.ion | 252 ++- .../query/undefined-variable-behavior.ion | 26 +- partiql-tests-data/eval/spec-tests.ion | 130 +- 7 files changed, 1369 insertions(+), 1140 deletions(-) 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/query/group-by/group-by.ion b/partiql-tests-data/eval/query/group-by/group-by.ion index 166022d..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 - } - ] - } + 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, - 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 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,23 +5751,206 @@ { 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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", + statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -5739,15 +5959,21 @@ ], output:$bag::[ { - the_count:10, - the_agg:15.0 + categoryId:20, + the_count:4, + the_agg:3 + }, + { + categoryId:21, + the_count:6, + the_agg:2 } ] } }, { - 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", + name:"SELECT categoryId, COUNT(1) AS the_count, SUM( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, SUM( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -5756,15 +5982,21 @@ ], output:$bag::[ { - the_count:10, - the_agg:1.0 + categoryId:20, + the_count:4, + the_agg:6.0 + }, + { + categoryId:21, + the_count:6, + the_agg:9.0 } ] } }, { - 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", + name:"SELECT categoryId, COUNT(1) AS the_count, MIN( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MIN( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -5773,15 +6005,21 @@ ], output:$bag::[ { - the_count:10, - the_agg:5.0 + categoryId:20, + the_count:4, + the_agg:1.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.0 } ] } }, { - 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", + name:"SELECT categoryId, COUNT(1) AS the_count, MAX( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, MAX( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -5790,15 +6028,21 @@ ], output:$bag::[ { - the_count:10, + categoryId:20, + the_count:4, the_agg:3.0 + }, + { + categoryId:21, + the_count:6, + the_agg:5.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", + name:"SELECT categoryId, COUNT(1) AS the_count, AVG( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", + statement:"SELECT categoryId, COUNT(1) AS the_count, AVG( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -5807,191 +6051,14 @@ ], output:$bag::[ { - the_count:10, - the_agg:5 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - name:"SELECT categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, COUNT( 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( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, SUM( 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( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MIN( 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( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, MAX( 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( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY categoryId", - statement:"SELECT categoryId, COUNT(1) AS the_count, AVG( 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 + categoryId:20, + the_count:4, + the_agg:2.0 + }, + { + categoryId:21, + the_count:6, + the_agg:4.5 } ] } @@ -6374,75 +6441,266 @@ { 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, - 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_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, - 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_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, - 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_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, + 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, + 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, + 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, + 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", + statement:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6453,19 +6711,19 @@ { categoryId:20, the_count:4, - the_agg:3.0 + the_agg:3 }, { categoryId:21, the_count:6, - the_agg:5.0 + the_agg:2 } ] } }, { - 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 p.categoryId, COUNT(1) AS the_count, SUM( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", + statement:"SELECT p.categoryId, COUNT(1) AS the_count, SUM( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6476,19 +6734,19 @@ { categoryId:20, the_count:4, - the_agg:2.0 + the_agg:6.0 }, { categoryId:21, the_count:6, - the_agg:4.5 + the_agg:9.0 } ] } }, { - 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", + name:"SELECT p.categoryId, COUNT(1) AS the_count, MIN( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", + statement:"SELECT p.categoryId, COUNT(1) AS the_count, MIN( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6499,19 +6757,19 @@ { categoryId:20, the_count:4, - the_agg:3 + the_agg:1.0 }, { categoryId:21, the_count:6, - the_agg:2 + the_agg:4.0 } ] } }, { - 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", + name:"SELECT p.categoryId, COUNT(1) AS the_count, MAX( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", + statement:"SELECT p.categoryId, COUNT(1) AS the_count, MAX( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", assert:{ result:EvaluationSuccess, evalMode:[ @@ -6522,168 +6780,7 @@ { 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 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - 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 - } - ] - } - }, - { - name:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - statement:"SELECT p.categoryId, COUNT(1) AS the_count, COUNT( price_nulls) 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 - } - ] - } - }, - { - name:"SELECT p.categoryId, COUNT(1) AS the_count, SUM( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - statement:"SELECT p.categoryId, COUNT(1) AS the_count, SUM( price_nulls) 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 - } - ] - } - }, - { - name:"SELECT p.categoryId, COUNT(1) AS the_count, MIN( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - statement:"SELECT p.categoryId, COUNT(1) AS the_count, MIN( price_nulls) 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 - } - ] - } - }, - { - name:"SELECT p.categoryId, COUNT(1) AS the_count, MAX( price_nulls) AS the_agg FROM products_sparse AS p GROUP BY p.categoryId", - statement:"SELECT p.categoryId, COUNT(1) AS the_count, MAX( price_nulls) 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 + the_agg:3.0 }, { categoryId:21, @@ -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 + }, + ] }, ] 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 e578ea2..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 + }, + ] } ] 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 2c9acaa..dc6bfc3 100644 --- a/partiql-tests-data/eval/spec-tests.ion +++ b/partiql-tests-data/eval/spec-tests.ion @@ -329,38 +329,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", @@ -412,11 +436,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", @@ -721,15 +751,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", @@ -749,16 +785,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",