From 85a01fb0b8b1460415f835cdef83616fca9c9f41 Mon Sep 17 00:00:00 2001 From: Josh Pschorr Date: Wed, 4 Dec 2024 12:41:57 -0800 Subject: [PATCH] Move tests that include ion data into locations under an `ion` subpath (#129) --- .../eval/ion/primitives/cast.ion | 134 +++++ .../eval/ion/primitives/functions/abs.ion | 146 +++++ .../eval/ion/primitives/functions/exists.ion | 146 +++++ .../eval/ion/primitives/functions/extract.ion | 198 +++++++ .../eval/ion/primitives/null.ion | 530 ++++++++++++++++++ .../eval/ion/primitives/operators/concat.ion | 38 ++ .../primitives/operators/nary-operators.ion | 53 ++ .../eval/ion/primitives/path.ion | 20 + .../eval/ion/primitives/symbol.ion | 21 + .../eval/ion/query/group-by/group-by.ion | 177 ++++++ .../eval/ion/query/order-by.ion | 102 ++++ .../eval/ion/query/select/from-clause.ion | 15 + .../eval/ion/query/select/projection.ion | 18 + partiql-tests-data/eval/misc.ion | 4 +- partiql-tests-data/eval/primitives/cast.ion | 129 ----- .../eval/primitives/functions/abs.ion | 144 ----- .../eval/primitives/functions/cardinality.ion | 56 +- .../eval/primitives/functions/exists.ion | 88 +-- .../eval/primitives/functions/extract.ion | 196 ------- partiql-tests-data/eval/primitives/null.ion | 528 ----------------- .../eval/primitives/operators/concat.ion | 36 -- .../eval/primitives/operators/in-operator.ion | 8 +- .../eval/primitives/operators/like.ion | 178 +++--- .../primitives/operators/nary-operators.ion | 80 +-- partiql-tests-data/eval/primitives/path.ion | 4 +- partiql-tests-data/eval/primitives/symbol.ion | 2 +- .../eval/query/group-by/group-by.ion | 8 +- partiql-tests-data/eval/query/order-by.ion | 76 +-- partiql-tests-data/eval/query/pivot.ion | 2 +- .../eval/query/select/from-clause.ion | 23 +- .../eval/query/select/projection.ion | 18 +- .../eval/query/select/select.ion | 26 +- .../query/undefined-variable-behavior.ion | 2 +- .../primitives/functions/exists.ion | 4 +- .../primitives/functions/extract.ion | 26 +- .../primitives/functions/substring.ion | 4 +- .../primitives/operator/is-operator.ion | 4 +- .../primitives/operator/like-operator.ion | 6 +- .../ion/primitives/date-constructor.ion | 9 + .../ion/primitives/time-constructor.ion | 9 + .../syntax/primitives/date-constructor.ion | 8 - .../syntax/primitives/path-expression.ion | 2 +- .../syntax/primitives/time-constructor.ion | 8 - 43 files changed, 1824 insertions(+), 1462 deletions(-) create mode 100644 partiql-tests-data/eval/ion/primitives/cast.ion create mode 100644 partiql-tests-data/eval/ion/primitives/functions/abs.ion create mode 100644 partiql-tests-data/eval/ion/primitives/functions/exists.ion create mode 100644 partiql-tests-data/eval/ion/primitives/functions/extract.ion create mode 100644 partiql-tests-data/eval/ion/primitives/null.ion create mode 100644 partiql-tests-data/eval/ion/primitives/operators/concat.ion create mode 100644 partiql-tests-data/eval/ion/primitives/operators/nary-operators.ion create mode 100644 partiql-tests-data/eval/ion/primitives/path.ion create mode 100644 partiql-tests-data/eval/ion/primitives/symbol.ion create mode 100644 partiql-tests-data/eval/ion/query/group-by/group-by.ion create mode 100644 partiql-tests-data/eval/ion/query/order-by.ion create mode 100644 partiql-tests-data/eval/ion/query/select/from-clause.ion create mode 100644 partiql-tests-data/eval/ion/query/select/projection.ion create mode 100644 partiql-tests-data/fail/syntax/ion/primitives/date-constructor.ion create mode 100644 partiql-tests-data/fail/syntax/ion/primitives/time-constructor.ion diff --git a/partiql-tests-data/eval/ion/primitives/cast.ion b/partiql-tests-data/eval/ion/primitives/cast.ion new file mode 100644 index 0000000..7fefa9c --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/cast.ion @@ -0,0 +1,134 @@ +'cast-to-int'::[ + { + name:"cast to int valid cases{value:\"`-9223372036854775808e0`\",result:-9223372036854775808}", + statement:"cast(`-9223372036854775808e0` as BIGINT)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:-9223372036854775808 + } + }, + { + name:"cast to int valid cases{value:\" `\\\"100\\\"` \",result:100}", + statement:"cast( `\"100\"` as INT)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:100 + } + }, +] + +cast_invalid::[ + { + name:"cast to int invalid target type{value:\"`2017T`\",target:\"TIMESTAMP\"}", + statement:"cast(`2017T` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\" `{{\\\"\\\"}}` \",target:\"CLOB\"}", + statement:"cast( `{{\"\"}}` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\" `{{\\\"1\\\"}}` \",target:\"CLOB\"}", + statement:"cast( `{{\"1\"}}` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\"`{{}}`\",target:\"BLOB\"}", + statement:"cast(`{{}}` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\"`(1 2)`\",target:\"SEXP\"}", + statement:"cast(`(1 2)` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\"`(1)`\",target:\"SEXP\"}", + statement:"cast(`(1)` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, + { + name:"cast to int invalid target type{value:\"`()`\",target:\"SEXP\"}", + statement:"cast(`()` as INT)", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationSuccess, + evalMode:EvalModeCoerce, + output:$missing::null + } + ], + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/functions/abs.ion b/partiql-tests-data/eval/ion/primitives/functions/abs.ion new file mode 100644 index 0000000..ba04c0c --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/functions/abs.ion @@ -0,0 +1,146 @@ +abs::[ + { + name:"ABS(`1d0`) Ion DECIMAL", + statement:"ABS(`1d0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:1d0 + } + }, + { + name:"ABS(`1e0`) Ion FLOAT", + statement:"ABS(`1e0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:1e0 + } + }, + { + name:"ABS(`-1d0`)", + statement:"ABS(`-1d0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:1d0 + } + }, + { + name:"ABS(`-1e0`)", + statement:"ABS(`-1e0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:1e0 + } + }, + { + name:"ABS(`-0.`)", + statement:"ABS(`-0.`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:0d0 + } + }, + { + name:"ABS(`-0d0`)", + statement:"ABS(`-0d0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:0d0 + } + }, + { + name:"ABS(`-0d-0`)", + statement:"ABS(`-0d-0`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:0d0 + } + }, + { + name:"ABS(`-0.0d1`)", + statement:"ABS(`-0.0d1`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:0d0 + } + }, + { + name:"ABS(`-0.0000`) preserve scale", + statement:"ABS(`-0.0000`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:0d-4 + } + }, + { + name:"ABS(`-inf`) special value", + statement:"ABS(`-inf`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:+inf + } + }, + { + name:"ABS(`+inf`) special value", + statement:"ABS(`+inf`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:+inf + } + }, + { + name:"ABS(`nan`) special value", + statement:"ABS(`nan`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:nan + } + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/functions/exists.ion b/partiql-tests-data/eval/ion/primitives/functions/exists.ion new file mode 100644 index 0000000..e0c5f94 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/functions/exists.ion @@ -0,0 +1,146 @@ +exists::[ + { + name:"exists valid cases{param:\"`[]`\",result:false}", + statement:"exists(`[]`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:false + } + }, + { + name:"exists valid cases{param:\"`()`\",result:false}", + statement:"exists(`()`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:false + } + }, + { + name:"exists valid cases{param:\"`{}`\",result:false}", + statement:"exists(`{}`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:false + } + }, + { + name:"exists valid cases{param:\"`[1]`\",result:true}", + statement:"exists(`[1]`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`(1)`\",result:true}", + statement:"exists(`(1)`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`{a: 1}`\",result:true}", + statement:"exists(`{a: 1}`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`[null]`\",result:true}", + statement:"exists(`[null]`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`[missing]`\",result:true}", + statement:"exists(`[missing]`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`(null)`\",result:true}", + statement:"exists(`(null)`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`(missing)`\",result:true}", + statement:"exists(`(missing)`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`{a: null}`\",result:true}", + statement:"exists(`{a: null}`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"exists valid cases{param:\"`{a: missing}`\",result:true}", + statement:"exists(`{a: missing}`)", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/functions/extract.ion b/partiql-tests-data/eval/ion/primitives/functions/extract.ion new file mode 100644 index 0000000..eabe002 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/functions/extract.ion @@ -0,0 +1,198 @@ +extract::[ + extract_timestamp::[ + { + name:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67Z`) = 2000", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67Z`) = 1", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67Z`) = 2", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67Z`) = 3", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67Z`) = 4", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67Z`)", + statement:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67Z`) = 5.67", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + ], + extract_timestamp_offset::[ + { + name:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67+08:09`) = 2000", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67+08:09`) = 1", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67+08:09`) = 2", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67+08:09`) = 3", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67+08:09`) = 4", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67+08:09`) = 5.67", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67+08:09`) = 8", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67+08:09`)", + statement:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67+08:09`) = 9", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67-08:09`)", + statement:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67-08:09`) = -8", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67-08:09`)", + statement:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67-08:09`) = -9", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + ] +] diff --git a/partiql-tests-data/eval/ion/primitives/null.ion b/partiql-tests-data/eval/ion/primitives/null.ion new file mode 100644 index 0000000..e26d1b3 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/null.ion @@ -0,0 +1,530 @@ +'null'::[ + { + name:"null pass through{sql:\"`null.null`\",result:null}", + statement:"`null.null`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null pass through{sql:\"`null.bool`\",result:null.bool}", + statement:"`null.bool`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.bool + } + }, + { + name:"null pass through{sql:\"`null.int`\",result:null.int}", + statement:"`null.int`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.int + } + }, + { + name:"null pass through{sql:\"`null.decimal`\",result:null.decimal}", + statement:"`null.decimal`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.decimal + } + }, + { + name:"null pass through{sql:\"`null.string`\",result:null.string}", + statement:"`null.string`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.string + } + }, + { + name:"null pass through{sql:\"`null.symbol`\",result:null.symbol}", + statement:"`null.symbol`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.symbol + } + }, + { + name:"null pass through{sql:\"`null.clob`\",result:null.clob}", + statement:"`null.clob`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.clob + } + }, + { + name:"null pass through{sql:\"`null.blob`\",result:null.blob}", + statement:"`null.blob`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.blob + } + }, + { + name:"null pass through{sql:\"`null.list`\",result:null.list}", + statement:"`null.list`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.list + } + }, + { + name:"null pass through{sql:\"`null.struct`\",result:null.struct}", + statement:"`null.struct`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.struct + } + }, + { + name:"null pass through{sql:\"`null.sexp`\",result:null.sexp}", + statement:"`null.sexp`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null.sexp + } + }, + { + name:"null comparison{sql:\"`null.null` IS NULL\",result:true}", + statement:"`null.null` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.bool` IS NULL\",result:true}", + statement:"`null.bool` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.int` IS NULL\",result:true}", + statement:"`null.int` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.decimal` IS NULL\",result:true}", + statement:"`null.decimal` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.string` IS NULL\",result:true}", + statement:"`null.string` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.symbol` IS NULL\",result:true}", + statement:"`null.symbol` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.clob` IS NULL\",result:true}", + statement:"`null.clob` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.blob` IS NULL\",result:true}", + statement:"`null.blob` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.list` IS NULL\",result:true}", + statement:"`null.list` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.struct` IS NULL\",result:true}", + statement:"`null.struct` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.sexp` IS NULL\",result:true}", + statement:"`null.sexp` IS NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:true + } + }, + { + name:"null comparison{sql:\"`null.null` = NULL\",result:null}", + statement:"`null.null` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.bool` = NULL\",result:null}", + statement:"`null.bool` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.int` = NULL\",result:null}", + statement:"`null.int` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.decimal` = NULL\",result:null}", + statement:"`null.decimal` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.string` = NULL\",result:null}", + statement:"`null.string` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.symbol` = NULL\",result:null}", + statement:"`null.symbol` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.clob` = NULL\",result:null}", + statement:"`null.clob` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.blob` = NULL\",result:null}", + statement:"`null.blob` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.list` = NULL\",result:null}", + statement:"`null.list` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.struct` = NULL\",result:null}", + statement:"`null.struct` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.sexp` = NULL\",result:null}", + statement:"`null.sexp` = NULL", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:null + } + }, + { + name:"null comparison{sql:\"`null.null` = MISSING\",result:missing::null}", + statement:"`null.null` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.bool` = MISSING\",result:missing::null}", + statement:"`null.bool` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.int` = MISSING\",result:missing::null}", + statement:"`null.int` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.decimal` = MISSING\",result:missing::null}", + statement:"`null.decimal` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.string` = MISSING\",result:missing::null}", + statement:"`null.string` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.symbol` = MISSING\",result:missing::null}", + statement:"`null.symbol` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.clob` = MISSING\",result:missing::null}", + statement:"`null.clob` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.blob` = MISSING\",result:missing::null}", + statement:"`null.blob` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.list` = MISSING\",result:missing::null}", + statement:"`null.list` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.struct` = MISSING\",result:missing::null}", + statement:"`null.struct` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + }, + { + name:"null comparison{sql:\"`null.sexp` = MISSING\",result:missing::null}", + statement:"`null.sexp` = MISSING", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$missing::null + } + } +] diff --git a/partiql-tests-data/eval/ion/primitives/operators/concat.ion b/partiql-tests-data/eval/ion/primitives/operators/concat.ion new file mode 100644 index 0000000..cfcefbc --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/operators/concat.ion @@ -0,0 +1,38 @@ +concat::[ + { + name:"|| valid cases{lparam:\"`'a'`\",rparam:\"`'b'`\",result:\"ab\"}", + statement:"`'a'` || `'b'`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:"ab" + } + }, + { + name:"|| valid cases{lparam:\"`'a'`\",rparam:\"'b'\",result:\"ab\"}", + statement:"`'a'` || 'b'", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:"ab" + } + }, + { + name:"|| valid cases{lparam:\"'a'\",rparam:\"`'b'`\",result:\"ab\"}", + statement:"'a' || `'b'`", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:"ab" + } + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/operators/nary-operators.ion b/partiql-tests-data/eval/ion/primitives/operators/nary-operators.ion new file mode 100644 index 0000000..7a2d686 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/operators/nary-operators.ion @@ -0,0 +1,53 @@ +envs::{ + d:3., + f:2e0, + i:1, +} + +nary::[ + { + name:"equalListDifferentTypesTrue", + statement:"[1, 2e0, 'hello'] = [1.0, 2, `hello`]", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:true + } + }, + { + name:"listDifferentTypesDifferentOrderFalse", + statement:"[1, 2e0, 'hello'] = [`hello`, 2, 1.0]", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:false + } + }, + { + name:"equalBagDifferentTypesDifferentOrderTrue", + statement:"<<1, 2e0, 'hello'>> = <<`hello`, 2, 1.0>>", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:true + } + }, + { + name:"equalBagDifferentTypesWithNullMissingDifferentOrderTrue", + statement:"<<1, 2e0, 'hello', NULL, MISSING>> = <>", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:true + } + }, + { + name:"equalListDifferentLengthsShortFirst", + statement:"[1.0, 2] = [1.0, 2, `hello`]", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:false + } + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/path.ion b/partiql-tests-data/eval/ion/primitives/path.ion new file mode 100644 index 0000000..daaa322 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/path.ion @@ -0,0 +1,20 @@ +'repeated-field-on-struct'::[ + // Following tests are implementation-dependent for COERCE eval mode when tuples are unordered per section 4 of the + // spec + { + name: "repeated field on struct is ambiguous{identifier:\"REPEATED\",cn:9,bn:\"REPEATED\"}", + statement: "SELECT REPEATED FROM `[{repeated:1, repeated:2}]`", + assert: { + evalMode: EvalModeError, + result: EvaluationFail + }, + }, + { + name: "repeated field on struct is ambiguous{identifier:\" \\\"repeated\\\" \",cn:10,bn:\"repeated\"}", + statement: "SELECT \"repeated\" FROM `[{repeated:1, repeated:2}]`", + assert: { + evalMode: EvalModeError, + result: EvaluationFail + }, + }, +] diff --git a/partiql-tests-data/eval/ion/primitives/symbol.ion b/partiql-tests-data/eval/ion/primitives/symbol.ion new file mode 100644 index 0000000..3954253 --- /dev/null +++ b/partiql-tests-data/eval/ion/primitives/symbol.ion @@ -0,0 +1,21 @@ +'empty-symbol'::[ + { + name:"Empty Symbol in table", + statement:"SELECT \"\" FROM `{'': 1}`", + assert: [ + { + result: EvaluationSuccess, + evalMode: EvalModeCoerce, + output: $bag::[ + { + '': 1 + } + ] + }, + { + evalMode: EvalModeError, + result: EvaluationFail + } + ] + }, +] diff --git a/partiql-tests-data/eval/ion/query/group-by/group-by.ion b/partiql-tests-data/eval/ion/query/group-by/group-by.ion new file mode 100644 index 0000000..688218d --- /dev/null +++ b/partiql-tests-data/eval/ion/query/group-by/group-by.ion @@ -0,0 +1,177 @@ +'simple-group-by'::[ + envs::{ + sales_report:[ + { + fiscal_year:2000T, + rep:"Bob", + total_sales:1.0 + }, + { + fiscal_year:2000T, + rep:"Jon", + total_sales:2.0 + }, + { + fiscal_year:2000T, + rep:"Meg", + total_sales:3.0 + }, + { + fiscal_year:2001T, + rep:"Bob", + total_sales:10.0 + }, + { + fiscal_year:2001T, + rep:"Jon", + total_sales:20.0 + }, + { + fiscal_year:2001T, + rep:"Meg", + total_sales:30.0 + }, + { + fiscal_year:2002T, + rep:"Bob", + total_sales:100.0 + }, + { + fiscal_year:2002T, + rep:"Jon", + total_sales:200.0 + }, + { + fiscal_year:2002T, + rep:"Meg", + total_sales:300.0 + } + ], + }, + { + name:"group by with where", + statement:"SELECT rep, SUM(total_sales) as total FROM sales_report WHERE fiscal_year >= `2001T` GROUP BY rep", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$bag::[ + { + rep:"Bob", + total:110.0 + }, + { + rep:"Jon", + total:220.0 + }, + { + rep:"Meg", + total:330.0 + } + ] + } + }, + { + name:"group by with group as and where", + statement:"SELECT rep, g FROM sales_report WHERE fiscal_year >= `2001T` GROUP BY rep GROUP AS g", + assert:{ + result:EvaluationSuccess, + evalMode:[ + EvalModeCoerce, + EvalModeError + ], + output:$bag::[ + { + rep:"Bob", + g:$bag::[ + { + sales_report:{ + fiscal_year:2001T, + rep:"Bob", + total_sales:10.0 + } + }, + { + sales_report:{ + fiscal_year:2002T, + rep:"Bob", + total_sales:100.0 + } + } + ] + }, + { + rep:"Jon", + g:$bag::[ + { + sales_report:{ + fiscal_year:2001T, + rep:"Jon", + total_sales:20.0 + } + }, + { + sales_report:{ + fiscal_year:2002T, + rep:"Jon", + total_sales:200.0 + } + } + ] + }, + { + rep:"Meg", + g:$bag::[ + { + sales_report:{ + fiscal_year:2001T, + rep:"Meg", + total_sales:30.0 + } + }, + { + sales_report:{ + fiscal_year:2002T, + rep:"Meg", + total_sales:300.0 + } + } + ] + } + ] + } + }, +] + +'simple-group-by-fail'::[ + { + name:"GROUP BY binding referenced in FROM clause", + statement:"SELECT gb_binding FROM sales_report, gb_binding WHERE fiscal_year >= `2001T` GROUP BY rep AS gb_binding", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationFail, + evalMode:EvalModeCoerce, + } + ] + }, + { + name:"GROUP AS binding referenced in FROM clause", + statement:"SELECT rep, gba_binding FROM sales_report, gba_binding WHERE fiscal_year >= `2001T` GROUP BY rep GROUP AS gba_binding", + assert:[ + { + evalMode:EvalModeError, + result:EvaluationFail + }, + { + result:EvaluationFail, + evalMode:EvalModeCoerce, + } + ] + }, +] diff --git a/partiql-tests-data/eval/ion/query/order-by.ion b/partiql-tests-data/eval/ion/query/order-by.ion new file mode 100644 index 0000000..e952b2e --- /dev/null +++ b/partiql-tests-data/eval/ion/query/order-by.ion @@ -0,0 +1,102 @@ +edge_cases::[ + // nan before -inf, then numeric values then +inf (ASC) + { + name:"nan before -inf, then numeric values then +inf (ASC)", + statement:"SELECT * FROM [{ 'a': 5 }, { 'a': -5e-1 }, { 'a': `-inf` }, { 'a': `nan` }, { 'a': 7 }, { 'a': `+inf` }, { 'a': 9 }] ORDER BY a", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': nan}, {'a': -inf}, {'a': -0.5}, {'a': 5}, {'a': 7}, {'a': 9}, {'a': +inf}] + } + }, + // +inf before numeric values then -inf then nan (DESC) + { + name:"+inf before numeric values then -inf then nan (DESC)", + statement:"SELECT * FROM [{ 'a': 5 }, { 'a': -5e-1 }, { 'a': `-inf` }, { 'a': `nan` }, { 'a': 7 }, { 'a': `+inf` }, { 'a': 9 }] ORDER BY a DESC", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': +inf}, {'a': 9}, {'a': 7}, {'a': 5}, {'a': -0.5}, {'a': -inf}, {'a': nan}] + } + }, + // text types compared by lexicographical ordering of Unicode scalar (ASC) + { + name:"text types compared by lexicographical ordering of Unicode scalar (ASC)", + statement:'''SELECT * FROM [{ 'a': `'\uD83D\uDCA9'`}, { 'a': 'Z'}, { 'a': '9' }, { 'a': 'A'}, { 'a': `"\U0001F4A9"`}, { 'a': 'a'}, { 'a': 'z'}, { 'a': '0' }] ORDER BY a''', + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': '0'}, {'a': '9'}, {'a': 'A'}, {'a': 'Z'}, {'a': 'a'}, {'a': 'z'}, {'a': '\uD83D\uDCA9'}, {'a': "\U0001F4A9"}] + } + }, + // text types compared by lexicographical ordering of Unicode scalar (DESC) + { + name:"text types compared by lexicographical ordering of Unicode scalar (DESC)", + statement:'''SELECT * FROM [{ 'a': `'\uD83D\uDCA9'`}, { 'a': 'Z'}, { 'a': '9' }, { 'a': 'A'}, { 'a': `"\U0001F4A9"`}, { 'a': 'a'}, { 'a': 'z'}, { 'a': '0' }] ORDER BY a DESC''', + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': '\uD83D\uDCA9'}, {'a': "\U0001F4A9"}, {'a': 'z'}, {'a': 'a'}, {'a': 'Z'}, {'a': 'A'}, {'a': '9'}, {'a': '0'}] + } + }, + // LOB types follow their lexicographical ordering by octet (ASC) + { + name:"LOB types follow their lexicographical ordering by octet (ASC)", + statement:'''SELECT * FROM [{'a': `{{"Z"}}`}, {'a': `{{"a"}}`}, {'a': `{{"A"}}`}, {'a': `{{"z"}}`}] ORDER BY a''', + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': {{"A"}}}, {'a': {{"Z"}}}, {'a': {{"a"}}}, {'a': {{"z"}}}] + } + }, + // LOB types should ordered (DESC) + { + name:"LOB types should ordered (DESC)", + statement:'''SELECT * FROM [{'a': `{{"Z"}}`}, {'a': `{{"a"}}`}, {'a': `{{"A"}}`}, {'a': `{{"z"}}`}] ORDER BY a DESC''', + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': {{"z"}}}, {'a': {{"a"}}}, {'a': {{"Z"}}}, {'a': {{"A"}}}] + } + }, + // lists items should be ordered by data types (ASC) (nulls last as default for asc) + { + name:"lists items should be ordered by data types (ASC) (nulls last as default for asc)", + statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [`{{}}`]}, {'a': [[]]} ] ORDER BY a", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': [true]}, {'a': [1]}, {'a': ["a"]}, {'a': [{{}}]}, {'a': [[]]}, {'a': [{}]}, {'a': [$bag::[]]}, {'a': [null]}] + } + }, + // lists items should be ordered by data types (DESC) (nulls first as default for desc) + { + name:"lists items should be ordered by data types (DESC) (nulls first as default for desc)", + statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [`{{}}`]}, {'a': [[]]} ] ORDER BY a DESC", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': [null]}, {'a': [$bag::[]]}, {'a': [{}]}, {'a': [[]]}, {'a': [{{}}]}, {'a': ["a"]}, {'a': [1]}, {'a': [true]}] + } + }, + // structs should be ordered by data types (ASC) (nulls last as default for asc) + { + name:"structs should be ordered by data types (ASC) (nulls last as default for asc)", + statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': `{{}}`}}, {'a': {'a': null}}] ORDER BY a", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': {'a': true}}, {'a': {'a': 5}}, {'a': {'a': "b"}}, {'a': {'a': {{}}}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': $bag::[]}}, {'a': {'a': null}}] + } + }, + // structs should be ordered by data types (DESC) (nulls first as default for desc) + { + name:"structs should be ordered by data types (DESC) (nulls first as default for desc)", + statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': `{{}}`}}, {'a': {'a': null}}] ORDER BY a DESC", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:[{'a': {'a': null}}, {'a': {'a': $bag::[]}}, {'a': {'a': {}}}, {'a': {'a': []}}, {'a': {'a': {{}}}}, {'a': {'a': "b"}}, {'a': {'a': 5}}, {'a': {'a': true}}] + } + }, +] diff --git a/partiql-tests-data/eval/ion/query/select/from-clause.ion b/partiql-tests-data/eval/ion/query/select/from-clause.ion new file mode 100644 index 0000000..1a7e7bd --- /dev/null +++ b/partiql-tests-data/eval/ion/query/select/from-clause.ion @@ -0,0 +1,15 @@ +'various types in from clause'::[ + { + name:"rangeOverSexp", + statement:"SELECT VALUE v FROM `(a b c)` AS v", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:$bag::[ + a, + b, + c + ] + } + }, +] diff --git a/partiql-tests-data/eval/ion/query/select/projection.ion b/partiql-tests-data/eval/ion/query/select/projection.ion new file mode 100644 index 0000000..33b35c3 --- /dev/null +++ b/partiql-tests-data/eval/ion/query/select/projection.ion @@ -0,0 +1,18 @@ +'project various container types'::[ + { + name:"projectOfSexp", + statement:"SELECT * FROM `(1 2)` as foo", + assert:{ + evalMode:[EvalModeCoerce, EvalModeError], + result:EvaluationSuccess, + output:$bag::[ + { + _1:( + 1 + 2 + ) + } + ] + } + }, +] diff --git a/partiql-tests-data/eval/misc.ion b/partiql-tests-data/eval/misc.ion index 6dd0baf..9920a69 100644 --- a/partiql-tests-data/eval/misc.ion +++ b/partiql-tests-data/eval/misc.ion @@ -115,7 +115,7 @@ uncategorized::[ }, { name:"selectValueStructConstructorWithMissing", - statement:"SELECT VALUE {'x': a.x, 'y': a.y} FROM `[{x:5}, {y:6}]` AS a", + statement:"SELECT VALUE {'x': a.x, 'y': a.y} FROM [{'x':5}, {'y':6}] AS a", assert: [ { evalMode:EvalModeCoerce, @@ -223,7 +223,7 @@ uncategorized::[ }, { name:"emptySymbol", - statement:"SELECT \"\" FROM `{'': 1}`", + statement:"SELECT \"\" FROM {'': 1}", assert:[ { evalMode:EvalModeCoerce, diff --git a/partiql-tests-data/eval/primitives/cast.ion b/partiql-tests-data/eval/primitives/cast.ion index 272740d..936fb7f 100644 --- a/partiql-tests-data/eval/primitives/cast.ion +++ b/partiql-tests-data/eval/primitives/cast.ion @@ -108,18 +108,6 @@ output:-9223372036854775808 } }, - { - name:"cast to int valid cases{value:\"`-9223372036854775808e0`\",result:-9223372036854775808}", - statement:"cast(`-9223372036854775808e0` as BIGINT)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:-9223372036854775808 - } - }, { name:"cast to int valid cases{value:\"9223372036854775807.0\",result:9223372036854775807}", statement:"cast(9223372036854775807.0 as BIGINT)", @@ -456,18 +444,6 @@ output:-10 } }, - { - name:"cast to int valid cases{value:\" `\\\"100\\\"` \",result:100}", - statement:"cast( `\"100\"` as INT)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:100 - } - }, ] 'cast-to-null'::[ @@ -571,66 +547,6 @@ cast_invalid::[ } ], }, - { - name:"cast to int invalid target type{value:\"`2017T`\",target:\"TIMESTAMP\"}", - statement:"cast(`2017T` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, - { - name:"cast to int invalid target type{value:\" `{{\\\"\\\"}}` \",target:\"CLOB\"}", - statement:"cast( `{{\"\"}}` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, - { - name:"cast to int invalid target type{value:\" `{{\\\"1\\\"}}` \",target:\"CLOB\"}", - statement:"cast( `{{\"1\"}}` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, - { - name:"cast to int invalid target type{value:\"`{{}}`\",target:\"BLOB\"}", - statement:"cast(`{{}}` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, { name:"cast to int invalid target type{value:\"[1, 2]\",target:\"LIST\"}", statement:"cast([1, 2] as INT)", @@ -676,51 +592,6 @@ cast_invalid::[ } ], }, - { - name:"cast to int invalid target type{value:\"`(1 2)`\",target:\"SEXP\"}", - statement:"cast(`(1 2)` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, - { - name:"cast to int invalid target type{value:\"`(1)`\",target:\"SEXP\"}", - statement:"cast(`(1)` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, - { - name:"cast to int invalid target type{value:\"`()`\",target:\"SEXP\"}", - statement:"cast(`()` as INT)", - assert:[ - { - evalMode:EvalModeError, - result:EvaluationFail - }, - { - result:EvaluationSuccess, - evalMode:EvalModeCoerce, - output:$missing::null - } - ], - }, { name:"cast to int invalid target type{value:\"{'a': 1}\",target:\"STRUCT\"}", statement:"cast({'a': 1} as INT)", diff --git a/partiql-tests-data/eval/primitives/functions/abs.ion b/partiql-tests-data/eval/primitives/functions/abs.ion index 81e6ced..cdcbff1 100644 --- a/partiql-tests-data/eval/primitives/functions/abs.ion +++ b/partiql-tests-data/eval/primitives/functions/abs.ion @@ -23,30 +23,6 @@ abs::[ output:10d-1 } }, - { - name:"ABS(`1d0`) Ion DECIMAL", - statement:"ABS(`1d0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:1d0 - } - }, - { - name:"ABS(`1e0`) Ion FLOAT", - statement:"ABS(`1e0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:1e0 - } - }, { name:"ABS(1.9999999999999999999900)", statement:"ABS(1.9999999999999999999900)", @@ -83,30 +59,6 @@ abs::[ output:10d-1 } }, - { - name:"ABS(`-1d0`)", - statement:"ABS(`-1d0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:1d0 - } - }, - { - name:"ABS(`-1e0`)", - statement:"ABS(`-1e0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:1e0 - } - }, { name:"ABS(-1.9999999999999999999900)", statement:"ABS(-1.9999999999999999999900)", @@ -119,102 +71,6 @@ abs::[ output:19999999999999999999900d-22 } }, - { - name:"ABS(`-0.`)", - statement:"ABS(`-0.`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:0d0 - } - }, - { - name:"ABS(`-0d0`)", - statement:"ABS(`-0d0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:0d0 - } - }, - { - name:"ABS(`-0d-0`)", - statement:"ABS(`-0d-0`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:0d0 - } - }, - { - name:"ABS(`-0.0d1`)", - statement:"ABS(`-0.0d1`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:0d0 - } - }, - { - name:"ABS(`-0.0000`) preserve scale", - statement:"ABS(`-0.0000`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:0d-4 - } - }, - { - name:"ABS(`-inf`) special value", - statement:"ABS(`-inf`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:+inf - } - }, - { - name:"ABS(`+inf`) special value", - statement:"ABS(`+inf`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:+inf - } - }, - { - name:"ABS(`nan`) special value", - statement:"ABS(`nan`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:nan - } - }, { name:"ABS(MISSING) null propogation", statement:"ABS(MISSING)", diff --git a/partiql-tests-data/eval/primitives/functions/cardinality.ion b/partiql-tests-data/eval/primitives/functions/cardinality.ion index c56cbf6..d8e2a45 100644 --- a/partiql-tests-data/eval/primitives/functions/cardinality.ion +++ b/partiql-tests-data/eval/primitives/functions/cardinality.ion @@ -1,7 +1,7 @@ cardinality::[ { - name:"cardinality valid cases{param:\"`[]`\",result:0}", - statement:"cardinality(`[]`)", + name:"cardinality valid cases{param:\"[]\",result:0}", + statement:"cardinality([])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -24,8 +24,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`{}`\",result:0}", - statement:"cardinality(`{}`)", + name:"cardinality valid cases{param:\"{}\",result:0}", + statement:"cardinality({})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -36,8 +36,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`[1]`\",result:1}", - statement:"cardinality(`[1]`)", + name:"cardinality valid cases{param:\"[1]\",result:1}", + statement:"cardinality([1])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -60,8 +60,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`{a: 1}`\",result:1}", - statement:"cardinality(`{a: 1}`)", + name:"cardinality valid cases{param:\"{'a': 1}\",result:1}", + statement:"cardinality({'a': 1})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -72,8 +72,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`[1, 1.0]`\",result:2}", - statement:"cardinality(`[1, 1.0]`)", + name:"cardinality valid cases{param:\"[1, 1.0]\",result:2}", + statement:"cardinality([1, 1.0])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -96,8 +96,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`{a: 1, b: foo}`\",result:2}", - statement:"cardinality(`{a: 1, b: foo}`)", + name:"cardinality valid cases{param:\"{'a': 1, 'b': 'foo'}\",result:2}", + statement:"cardinality({'a': 1, 'b': 'foo'})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -108,8 +108,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`[[], [1,2,3,4,[5,6], ()], ({a: 1, b: 2})]`\",result:3}", - statement:"cardinality(`[[], [1,2,3,4,[5,6], ()], ({a: 1, b: 2})]`)", + name:"cardinality valid cases{param:\"[[], [1,2,3,4,[5,6], ()], ({'a': 1, 'b': 2})]\",result:3}", + statement:"cardinality([[], [1,2,3,4,[5,6], ()], ({'a': 1, 'b': 2})])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -120,8 +120,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`{a: 1, a: 2}`\",result:2}", - statement:"cardinality(`{a: 1, a: 2}`)", + name:"cardinality valid cases{param:\"{'a': 1, 'a': 2}\",result:2}", + statement:"cardinality({'a': 1, 'a': 2})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -132,8 +132,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`[null]`\",result:1}", - statement:"cardinality(`[null]`)", + name:"cardinality valid cases{param:\"[null]\",result:1}", + statement:"cardinality([null])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -156,8 +156,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`{a: null}`\",result:1}", - statement:"cardinality(`{a: null}`)", + name:"cardinality valid cases{param:\"{'a': null}\",result:1}", + statement:"cardinality({'a': null})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -168,8 +168,8 @@ cardinality::[ } }, { - name:"cardinality valid cases{param:\"`[missing]`\",result:1}", - statement:"cardinality(`[missing]`)", + name:"cardinality valid cases{param:\"[missing]\",result:1}", + statement:"cardinality([missing])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -191,18 +191,6 @@ cardinality::[ output:1 } }, - { - name:"cardinality valid cases{param:\"`{a: missing}`\",result:1}", - statement:"cardinality(`{a: missing}`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:1 - } - }, { name:"cardinality null and missing propagation{param:\"null\"}", statement:"cardinality(null)", diff --git a/partiql-tests-data/eval/primitives/functions/exists.ion b/partiql-tests-data/eval/primitives/functions/exists.ion index 1faba0b..fcb160d 100644 --- a/partiql-tests-data/eval/primitives/functions/exists.ion +++ b/partiql-tests-data/eval/primitives/functions/exists.ion @@ -1,7 +1,7 @@ exists::[ { - name:"exists valid cases{param:\"`[]`\",result:false}", - statement:"exists(`[]`)", + name:"exists valid cases{param:\"[]\",result:false}", + statement:"exists([])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -12,20 +12,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`()`\",result:false}", - statement:"exists(`()`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:false - } - }, - { - name:"exists valid cases{param:\"`{}`\",result:false}", - statement:"exists(`{}`)", + name:"exists valid cases{param:\"{}\",result:false}", + statement:"exists({})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -48,8 +36,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`[1]`\",result:true}", - statement:"exists(`[1]`)", + name:"exists valid cases{param:\"[1]\",result:true}", + statement:"exists([1])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -60,20 +48,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`(1)`\",result:true}", - statement:"exists(`(1)`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"exists valid cases{param:\"`{a: 1}`\",result:true}", - statement:"exists(`{a: 1}`)", + name:"exists valid cases{param:\"{a: 1}\",result:true}", + statement:"exists({a: 1})", assert:{ result:EvaluationSuccess, evalMode:[ @@ -96,44 +72,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`[null]`\",result:true}", - statement:"exists(`[null]`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"exists valid cases{param:\"`[missing]`\",result:true}", - statement:"exists(`[missing]`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"exists valid cases{param:\"`(null)`\",result:true}", - statement:"exists(`(null)`)", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"exists valid cases{param:\"`(missing)`\",result:true}", - statement:"exists(`(missing)`)", + name:"exists valid cases{param:\"[null]\",result:true}", + statement:"exists([NULL])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -144,8 +84,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`{a: null}`\",result:true}", - statement:"exists(`{a: null}`)", + name:"exists valid cases{param:\"[missing]\",result:true}", + statement:"exists([MISSING])", assert:{ result:EvaluationSuccess, evalMode:[ @@ -156,8 +96,8 @@ exists::[ } }, { - name:"exists valid cases{param:\"`{a: missing}`\",result:true}", - statement:"exists(`{a: missing}`)", + name:"exists valid cases{param:\"{a: null}\",result:true}", + statement:"exists({a: null})", assert:{ result:EvaluationSuccess, evalMode:[ diff --git a/partiql-tests-data/eval/primitives/functions/extract.ion b/partiql-tests-data/eval/primitives/functions/extract.ion index 7767c9d..23f5c09 100644 --- a/partiql-tests-data/eval/primitives/functions/extract.ion +++ b/partiql-tests-data/eval/primitives/functions/extract.ion @@ -433,202 +433,6 @@ extract::[ } }, ], - extract_timestamp::[ - { - name:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67Z`) = 2000", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67Z`) = 1", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67Z`) = 2", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67Z`) = 3", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67Z`) = 4", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67Z`)", - statement:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67Z`) = 5.67", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - ], - extract_timestamp_offset::[ - { - name:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(YEAR FROM `2000-01-02T03:04:05.67+08:09`) = 2000", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(MONTH FROM `2000-01-02T03:04:05.67+08:09`) = 1", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(DAY FROM `2000-01-02T03:04:05.67+08:09`) = 2", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(HOUR FROM `2000-01-02T03:04:05.67+08:09`) = 3", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(MINUTE FROM `2000-01-02T03:04:05.67+08:09`) = 4", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(SECOND FROM `2000-01-02T03:04:05.67+08:09`) = 5.67", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67+08:09`) = 8", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67+08:09`)", - statement:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67+08:09`) = 9", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67-08:09`)", - statement:"EXTRACT(TIMEZONE_HOUR FROM `2000-01-02T03:04:05.67-08:09`) = -8", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67-08:09`)", - statement:"EXTRACT(TIMEZONE_MINUTE FROM `2000-01-02T03:04:05.67-08:09`) = -9", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - ] ] extract_invalid::[ diff --git a/partiql-tests-data/eval/primitives/null.ion b/partiql-tests-data/eval/primitives/null.ion index a90fa1e..f20534a 100644 --- a/partiql-tests-data/eval/primitives/null.ion +++ b/partiql-tests-data/eval/primitives/null.ion @@ -1,136 +1,4 @@ 'null'::[ - { - name:"null pass through{sql:\"`null.null`\",result:null}", - statement:"`null.null`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null pass through{sql:\"`null.bool`\",result:null.bool}", - statement:"`null.bool`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.bool - } - }, - { - name:"null pass through{sql:\"`null.int`\",result:null.int}", - statement:"`null.int`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.int - } - }, - { - name:"null pass through{sql:\"`null.decimal`\",result:null.decimal}", - statement:"`null.decimal`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.decimal - } - }, - { - name:"null pass through{sql:\"`null.string`\",result:null.string}", - statement:"`null.string`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.string - } - }, - { - name:"null pass through{sql:\"`null.symbol`\",result:null.symbol}", - statement:"`null.symbol`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.symbol - } - }, - { - name:"null pass through{sql:\"`null.clob`\",result:null.clob}", - statement:"`null.clob`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.clob - } - }, - { - name:"null pass through{sql:\"`null.blob`\",result:null.blob}", - statement:"`null.blob`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.blob - } - }, - { - name:"null pass through{sql:\"`null.list`\",result:null.list}", - statement:"`null.list`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.list - } - }, - { - name:"null pass through{sql:\"`null.struct`\",result:null.struct}", - statement:"`null.struct`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.struct - } - }, - { - name:"null pass through{sql:\"`null.sexp`\",result:null.sexp}", - statement:"`null.sexp`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null.sexp - } - }, { name:"null comparison{sql:\"NULL\",result:null}", statement:"NULL", @@ -203,138 +71,6 @@ output:true } }, - { - name:"null comparison{sql:\"`null.null` IS NULL\",result:true}", - statement:"`null.null` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.bool` IS NULL\",result:true}", - statement:"`null.bool` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.int` IS NULL\",result:true}", - statement:"`null.int` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.decimal` IS NULL\",result:true}", - statement:"`null.decimal` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.string` IS NULL\",result:true}", - statement:"`null.string` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.symbol` IS NULL\",result:true}", - statement:"`null.symbol` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.clob` IS NULL\",result:true}", - statement:"`null.clob` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.blob` IS NULL\",result:true}", - statement:"`null.blob` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.list` IS NULL\",result:true}", - statement:"`null.list` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.struct` IS NULL\",result:true}", - statement:"`null.struct` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, - { - name:"null comparison{sql:\"`null.sexp` IS NULL\",result:true}", - statement:"`null.sexp` IS NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:true - } - }, { name:"null comparison{sql:\"NULL = NULL\",result:null}", statement:"NULL = NULL", @@ -371,268 +107,4 @@ output:$missing::null } }, - { - name:"null comparison{sql:\"`null.null` = NULL\",result:null}", - statement:"`null.null` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.bool` = NULL\",result:null}", - statement:"`null.bool` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.int` = NULL\",result:null}", - statement:"`null.int` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.decimal` = NULL\",result:null}", - statement:"`null.decimal` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.string` = NULL\",result:null}", - statement:"`null.string` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.symbol` = NULL\",result:null}", - statement:"`null.symbol` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.clob` = NULL\",result:null}", - statement:"`null.clob` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.blob` = NULL\",result:null}", - statement:"`null.blob` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.list` = NULL\",result:null}", - statement:"`null.list` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.struct` = NULL\",result:null}", - statement:"`null.struct` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.sexp` = NULL\",result:null}", - statement:"`null.sexp` = NULL", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:null - } - }, - { - name:"null comparison{sql:\"`null.null` = MISSING\",result:missing::null}", - statement:"`null.null` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.bool` = MISSING\",result:missing::null}", - statement:"`null.bool` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.int` = MISSING\",result:missing::null}", - statement:"`null.int` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.decimal` = MISSING\",result:missing::null}", - statement:"`null.decimal` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.string` = MISSING\",result:missing::null}", - statement:"`null.string` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.symbol` = MISSING\",result:missing::null}", - statement:"`null.symbol` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.clob` = MISSING\",result:missing::null}", - statement:"`null.clob` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.blob` = MISSING\",result:missing::null}", - statement:"`null.blob` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.list` = MISSING\",result:missing::null}", - statement:"`null.list` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.struct` = MISSING\",result:missing::null}", - statement:"`null.struct` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - }, - { - name:"null comparison{sql:\"`null.sexp` = MISSING\",result:missing::null}", - statement:"`null.sexp` = MISSING", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:$missing::null - } - } ] diff --git a/partiql-tests-data/eval/primitives/operators/concat.ion b/partiql-tests-data/eval/primitives/operators/concat.ion index ad40678..bf50aea 100644 --- a/partiql-tests-data/eval/primitives/operators/concat.ion +++ b/partiql-tests-data/eval/primitives/operators/concat.ion @@ -11,42 +11,6 @@ concat::[ output:"ab" } }, - { - name:"|| valid cases{lparam:\"`'a'`\",rparam:\"`'b'`\",result:\"ab\"}", - statement:"`'a'` || `'b'`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:"ab" - } - }, - { - name:"|| valid cases{lparam:\"`'a'`\",rparam:\"'b'\",result:\"ab\"}", - statement:"`'a'` || 'b'", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:"ab" - } - }, - { - name:"|| valid cases{lparam:\"'a'\",rparam:\"`'b'`\",result:\"ab\"}", - statement:"'a' || `'b'`", - assert:{ - result:EvaluationSuccess, - evalMode:[ - EvalModeCoerce, - EvalModeError - ], - output:"ab" - } - }, { name:"|| valid cases{lparam:\"null\",rparam:\"'b'\",result:null}", statement:"null || 'b'", diff --git a/partiql-tests-data/eval/primitives/operators/in-operator.ion b/partiql-tests-data/eval/primitives/operators/in-operator.ion index b9be210..5f076e0 100644 --- a/partiql-tests-data/eval/primitives/operators/in-operator.ion +++ b/partiql-tests-data/eval/primitives/operators/in-operator.ion @@ -79,7 +79,7 @@ envs::{ in::[ { name:"inPredicate", - statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE b.price IN (5, `2e0`)", + statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE b.price IN (5, 2e0)", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -150,7 +150,7 @@ in::[ }, { name:"notInPredicate", - statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE b.price NOT IN (5, `2e0`)", + statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE b.price NOT IN (5, 2e0)", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -241,7 +241,7 @@ in::[ }, { name:"inPredicateWithTableConstructor", - statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE (b.title, b.price) IN (VALUES ('A', `5e0`), ('B', 3.0), ('X', 9.0))", + statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE (b.title, b.price) IN (VALUES ('A', 5e0), ('B', 3.0), ('X', 9.0))", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -253,7 +253,7 @@ in::[ }, { name:"notInPredicateWithTableConstructor", - statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE (b.title, b.price) NOT IN (VALUES ('A', `5e0`), ('B', 3.0), ('X', 9.0))", + statement:"SELECT VALUE b.title FROM stores[*].books[*] AS b WHERE (b.title, b.price) NOT IN (VALUES ('A', 5e0), ('B', 3.0), ('X', 9.0))", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, diff --git a/partiql-tests-data/eval/primitives/operators/like.ion b/partiql-tests-data/eval/primitives/operators/like.ion index 66e5dd6..d035638 100644 --- a/partiql-tests-data/eval/primitives/operators/like.ion +++ b/partiql-tests-data/eval/primitives/operators/like.ion @@ -250,7 +250,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '_' \",pattern:\" '_' \"}", - statement:"SELECT * FROM `[true]` WHERE '_' LIKE '_'", + statement:"SELECT * FROM [TRUE] WHERE '_' LIKE '_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -266,7 +266,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '_' \",pattern:\" '%' \"}", - statement:"SELECT * FROM `[true]` WHERE '_' LIKE '%'", + statement:"SELECT * FROM [TRUE] WHERE '_' LIKE '%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -282,7 +282,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '%' \",pattern:\" '_' \"}", - statement:"SELECT * FROM `[true]` WHERE '%' LIKE '_'", + statement:"SELECT * FROM [TRUE] WHERE '%' LIKE '_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -298,7 +298,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '%' \",pattern:\" '%' \"}", - statement:"SELECT * FROM `[true]` WHERE '%' LIKE '%'", + statement:"SELECT * FROM [TRUE] WHERE '%' LIKE '%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -314,7 +314,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'A' \",pattern:\" 'A' \"}", - statement:"SELECT * FROM `[true]` WHERE 'A' LIKE 'A'", + statement:"SELECT * FROM [TRUE] WHERE 'A' LIKE 'A'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -330,7 +330,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '\\\\' \",pattern:\" '\\\\' \"}", - statement:"SELECT * FROM `[true]` WHERE '\\' LIKE '\\'", + statement:"SELECT * FROM [TRUE] WHERE '\\' LIKE '\\'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -346,7 +346,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" '' \",pattern:\" '' \"}", - statement:"SELECT * FROM `[true]` WHERE '$$' LIKE '$$'", + statement:"SELECT * FROM [TRUE] WHERE '$$' LIKE '$$'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -362,7 +362,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '_BC' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_BC'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_BC'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -378,7 +378,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'A_C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A_C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A_C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -394,7 +394,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'AB_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'AB_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'AB_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -410,7 +410,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '___' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '___'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '___'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -426,7 +426,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'A__' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A__'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A__'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -442,7 +442,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '__C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '__C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '__C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -458,7 +458,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -474,7 +474,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%%%%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%%%%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%%%%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -490,7 +490,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%ABC' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%ABC'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%ABC'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -506,7 +506,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%BC' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%BC'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%BC'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -522,7 +522,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -538,7 +538,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'ABC%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'ABC%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'ABC%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -554,7 +554,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'AB%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'AB%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'AB%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -570,7 +570,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'A%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -586,7 +586,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'A%%%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A%%%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A%%%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -602,7 +602,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" 'A%C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A%C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A%C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -618,7 +618,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -634,7 +634,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -650,7 +650,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%B%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%B%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%B%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -666,7 +666,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%B%%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%B%%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%B%%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -682,7 +682,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%A%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%A%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%A%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -698,7 +698,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%%A%%%%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%%A%%%%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%%A%%%%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -714,7 +714,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%Aa%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%Aa%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%Aa%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -730,7 +730,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -746,7 +746,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" '%B%C%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE '%B%C%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE '%B%C%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -762,7 +762,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" '%B%C%%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE '%B%C%%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE '%B%C%%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -778,7 +778,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" '%bC%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE '%bC%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE '%bC%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -794,7 +794,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" '%b%C%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE '%b%C%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE '%b%C%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -810,7 +810,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%_%_%_%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%_%_%_%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%_%_%_%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -826,7 +826,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '_%_%_%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_%_%_%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_%_%_%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -842,7 +842,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '%_%_%_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%_%_%_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%_%_%_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -858,7 +858,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '_%_%_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_%_%_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_%_%_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -874,7 +874,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '_%%_%%%_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_%%_%%%_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_%%_%%%_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -890,7 +890,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'ABC' \",pattern:\" '_%%B%%%_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_%%B%%%_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_%%B%%%_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -906,7 +906,7 @@ like::[ }, { name:"non-empty strings for text and pattern that match{text:\" 'AAaBBbCCc' \",pattern:\" '%__b%C_%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE '%__b%C_%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE '%__b%C_%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -922,7 +922,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'A' \",pattern:\" 'a' \"}", - statement:"SELECT * FROM `[true]` WHERE 'A' LIKE 'a'", + statement:"SELECT * FROM [TRUE] WHERE 'A' LIKE 'a'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -935,7 +935,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" '\\\\' \",pattern:\" '/' \"}", - statement:"SELECT * FROM `[true]` WHERE '\\' LIKE '/'", + statement:"SELECT * FROM [TRUE] WHERE '\\' LIKE '/'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -948,7 +948,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" '' \",pattern:\" '^' \"}", - statement:"SELECT * FROM `[true]` WHERE '$$' LIKE '^$$'", + statement:"SELECT * FROM [TRUE] WHERE '$$' LIKE '^$$'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -961,7 +961,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '_AC' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_AC'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_AC'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -974,7 +974,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" 'A_B' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'A_B'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'A_B'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -987,7 +987,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" 'AB_C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'AB_C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'AB_C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1000,7 +1000,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '_ABC' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '_ABC'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '_ABC'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1013,7 +1013,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" 'ABC_' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'ABC_'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'ABC_'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1026,7 +1026,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '__' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '__'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '__'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1039,7 +1039,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '____' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '____'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '____'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1052,7 +1052,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" 'B%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'B%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'B%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1065,7 +1065,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '%B' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%B'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%B'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1078,7 +1078,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '%BCD' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%BCD'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%BCD'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1091,7 +1091,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" 'B%C' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE 'B%C'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE 'B%C'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1104,7 +1104,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%Xc' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%Xc'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%Xc'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1117,7 +1117,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'AX%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'AX%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'AX%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1130,7 +1130,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%X%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%X%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%X%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1143,7 +1143,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%X%%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%X%%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%X%%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1156,7 +1156,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%%%X%%%%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%%%X%%%%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%%%X%%%%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1169,7 +1169,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'A%Aba%c' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'A%Aba%c'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'A%Aba%c'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1182,7 +1182,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'AAaBBbCCc' \",pattern:\" 'X%%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'AAaBBbCCc' LIKE 'X%%'", + statement:"SELECT * FROM [TRUE] WHERE 'AAaBBbCCc' LIKE 'X%%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1195,7 +1195,7 @@ like::[ }, { name:"non-empty strings for text and pattern that DO NOT match{text:\" 'ABC' \",pattern:\" '%_%_%_%_%' \"}", - statement:"SELECT * FROM `[true]` WHERE 'ABC' LIKE '%_%_%_%_%'", + statement:"SELECT * FROM [TRUE] WHERE 'ABC' LIKE '%_%_%_%_%'", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1208,7 +1208,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '_' \",pattern:\" '[_' \"}", - statement:"SELECT * FROM `[true]` WHERE '_' LIKE '[_' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '_' LIKE '[_' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1224,7 +1224,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '%' \",pattern:\" '[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '%' LIKE '[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '%' LIKE '[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1240,7 +1240,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '100%' \",pattern:\" '100[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '100[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '100[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1256,7 +1256,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '100%' \",pattern:\" '%[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '%[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '%[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1272,7 +1272,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '100%' \",pattern:\" '1__[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1__[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1__[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1288,7 +1288,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '100%' \",pattern:\" '1%[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1%[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1%[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1304,7 +1304,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '11%22%33%' \",pattern:\" '1%[%2%[%3%[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '11%22%33%' LIKE '1%[%2%[%3%[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '11%22%33%' LIKE '1%[%2%[%3%[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1320,7 +1320,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '11%22%33%' \",pattern:\" '1_[%2%[%3_[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '11%22%33%' LIKE '1_[%2%[%3_[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '11%22%33%' LIKE '1_[%2%[%3_[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1336,7 +1336,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '11%22%33%' \",pattern:\" '%[%%[%%[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '11%22%33%' LIKE '%[%%[%%[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '11%22%33%' LIKE '%[%%[%%[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1352,7 +1352,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '11%22%33%' \",pattern:\" '__[%__[%__[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '11%22%33%' LIKE '__[%__[%__[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '11%22%33%' LIKE '__[%__[%__[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1368,7 +1368,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '1[_000[_000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '1[_000[_000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '1[_000[_000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1384,7 +1384,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '_[_000[_000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '_[_000[_000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '_[_000[_000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1400,7 +1400,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '%[_000[_000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '%[_000[_000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '%[_000[_000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1416,7 +1416,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '%[_0_0[_000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '%[_0_0[_000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '%[_0_0[_000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1432,7 +1432,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '%[_0%0[_000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '%[_0%0[_000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '%[_0%0[_000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1448,7 +1448,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '1_000_000%' \",pattern:\" '%[_0%0[__%_[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '1_000_000%' LIKE '%[_0%0[__%_[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '1_000_000%' LIKE '%[_0%0[__%_[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1464,7 +1464,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that match{text:\" '100%' \",pattern:\" '1_%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1_%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1_%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1480,7 +1480,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '_' \",pattern:\" '[_[_' \"}", - statement:"SELECT * FROM `[true]` WHERE '_' LIKE '[_[_' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '_' LIKE '[_[_' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1493,7 +1493,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '_' \",pattern:\" '_[_' \"}", - statement:"SELECT * FROM `[true]` WHERE '_' LIKE '_[_' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '_' LIKE '_[_' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1506,7 +1506,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '%' \",pattern:\" '[%[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '%' LIKE '[%[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '%' LIKE '[%[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1519,7 +1519,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '100%' \",pattern:\" '1000[%' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1000[%' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1000[%' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1532,7 +1532,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '100%' \",pattern:\" '[%100' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '[%100' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '[%100' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1545,7 +1545,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '100%' \",pattern:\" '1_[%_' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1_[%_' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1_[%_' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1558,7 +1558,7 @@ like::[ }, { name:"like-expression with ESCAPE specified that DO NOT match{text:\" '100%' \",pattern:\" '1%_[%1' \"}", - statement:"SELECT * FROM `[true]` WHERE '100%' LIKE '1%_[%1' ESCAPE '['", + statement:"SELECT * FROM [TRUE] WHERE '100%' LIKE '1%_[%1' ESCAPE '['", assert:{ result:EvaluationSuccess, evalMode:[ @@ -1640,7 +1640,7 @@ like::[ }, { name:"More than one character given for ESCAPE", - statement:"SELECT * FROM `[true]` WHERE 'a' LIKE 'a' ESCAPE 'aa'", + statement:"SELECT * FROM [TRUE] WHERE 'a' LIKE 'a' ESCAPE 'aa'", assert:{ evalMode:[ EvalModeError, diff --git a/partiql-tests-data/eval/primitives/operators/nary-operators.ion b/partiql-tests-data/eval/primitives/operators/nary-operators.ion index 24a657e..c85d767 100644 --- a/partiql-tests-data/eval/primitives/operators/nary-operators.ion +++ b/partiql-tests-data/eval/primitives/operators/nary-operators.ion @@ -151,7 +151,7 @@ nary::[ }, { name:"notEqualIntFloat", - statement:"1 != `2e0`", + statement:"1 != 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -160,25 +160,16 @@ nary::[ }, { name:"notEqualIntFloatFalse", - statement:"1 != `1e0`", + statement:"1 != 1e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, output:false } }, - { - name:"equalListDifferentTypesTrue", - statement:"[1, `2e0`, 'hello'] = [1.0, 2, `hello`]", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:true - } - }, { name:"equalListDifferentTypesWithNullMissingTrue", - statement:"[1, `2e0`, 'hello', NULL, MISSING] = [1.0, 2, `hello`, NULL, MISSING]", + statement:"[1, 2e0, NULL, MISSING] = [1.0, 2, NULL, MISSING]", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -186,53 +177,18 @@ nary::[ } }, { + // TODO [joshps]: revisit this test. I cannot find support in the spec or elsewhere that `[NULL] = [MISSING]` name:"equalListDifferentTypesWithNullMissingEquivalenceTrue", - statement:"[1, `2e0`, 'hello', NULL] = [1.0, 2, `hello`, MISSING]", + statement:"[1, 2e0, NULL] = [1.0, 2, MISSING]", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, output:true } }, - { - name:"listDifferentTypesDifferentOrderFalse", - statement:"[1, `2e0`, 'hello'] = [`hello`, 2, 1.0]", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:false - } - }, - { - name:"equalBagDifferentTypesDifferentOrderTrue", - statement:"<<1, `2e0`, 'hello'>> = <<`hello`, 2, 1.0>>", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:true - } - }, - { - name:"equalBagDifferentTypesWithNullMissingDifferentOrderTrue", - statement:"<<1, `2e0`, 'hello', NULL, MISSING>> = <>", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:true - } - }, - { - name:"equalListDifferentLengthsShortFirst", - statement:"[1.0, 2] = [1.0, 2, `hello`]", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:false - } - }, { name:"equalListDifferentLengthsLongFirst", - statement:"[1, `2e0`, 'hello'] = [1, `2e0`]", + statement:"[1, 2e0, 'hello'] = [1, 2e0]", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -241,7 +197,7 @@ nary::[ }, { name:"equalTuplesDifferentTypesTrue", - statement:"{'a': 1, 'a': 10.0, 'b': `2e0`} = {'a': 1.0, 'a': 10, 'b': 2}", + statement:"{'a': 1, 'a': 10.0, 'b': 2e0} = {'a': 1.0, 'a': 10, 'b': 2}", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -250,7 +206,7 @@ nary::[ }, { name:"equalTuplesDifferentTypesDifferentOrderTrue", - statement:"{'a': 1, 'a': 10.0, 'b': `2e0`} = {'b': 2, 'a': 10, 'a': 1.0}", + statement:"{'a': 1, 'a': 10.0, 'b': 2e0} = {'b': 2, 'a': 10, 'a': 1.0}", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -259,7 +215,7 @@ nary::[ }, { name:"equalTuplesDifferentTypesDifferentOrderWithNullMissingTrue", - statement:"{'a': 1, 'a': 10.0, 'b': `2e0`, 'c': NULL, 'd': MISSING} = {'d': MISSING, 'c': NULL, 'b': 2, 'a': 10, 'a': 1.0}", + statement:"{'a': 1, 'a': 10.0, 'b': 2e0, 'c': NULL, 'd': MISSING} = {'d': MISSING, 'c': NULL, 'b': 2, 'a': 10, 'a': 1.0}", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -268,7 +224,7 @@ nary::[ }, { name:"equalTuplesDifferentTypesDifferentOrderWithNullMissingEquivalenceFalse", - statement:"{'a': 1, 'a': 10.0, 'b': `2e0`, 'c': NULL, 'd': NULL} = {'d': MISSING, 'c': MISSING, 'b': 2, 'a': 10, 'a': 1.0}", + statement:"{'a': 1, 'a': 10.0, 'b': 2e0, 'c': NULL, 'd': NULL} = {'d': MISSING, 'c': MISSING, 'b': 2, 'a': 10, 'a': 1.0}", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -295,7 +251,7 @@ nary::[ }, { name:"moreIntFloat", - statement:"3 > `2e0`", + statement:"3 > 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -304,7 +260,7 @@ nary::[ }, { name:"moreIntFloatFalse", - statement:"1 > `2e0`", + statement:"1 > 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -313,7 +269,7 @@ nary::[ }, { name:"lessIntFloat", - statement:"1 < `2e0`", + statement:"1 < 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -322,7 +278,7 @@ nary::[ }, { name:"lessIntFloatFalse", - statement:"3 < `2e0`", + statement:"3 < 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -331,7 +287,7 @@ nary::[ }, { name:"moreEqIntFloat", - statement:"3 >= `2e0`", + statement:"3 >= 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -340,7 +296,7 @@ nary::[ }, { name:"moreEqIntFloatFalse", - statement:"1 >= `2e0`", + statement:"1 >= 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -349,7 +305,7 @@ nary::[ }, { name:"lessEqIntFloat", - statement:"1 <= `2e0`", + statement:"1 <= 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -358,7 +314,7 @@ nary::[ }, { name:"lessEqIntFloatFalse", - statement:"5 <= `2e0`", + statement:"5 <= 2e0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, diff --git a/partiql-tests-data/eval/primitives/path.ion b/partiql-tests-data/eval/primitives/path.ion index bd08f36..ddb4f2d 100644 --- a/partiql-tests-data/eval/primitives/path.ion +++ b/partiql-tests-data/eval/primitives/path.ion @@ -927,7 +927,7 @@ pathUnpivotMissing::[ // spec { name: "repeated field on struct is ambiguous{identifier:\"REPEATED\",cn:9,bn:\"REPEATED\"}", - statement: "SELECT REPEATED FROM `[{repeated:1, repeated:2}]`", + statement: "SELECT REPEATED FROM [{repeated:1, repeated:2}]", assert: { evalMode: EvalModeError, result: EvaluationFail @@ -935,7 +935,7 @@ pathUnpivotMissing::[ }, { name: "repeated field on struct is ambiguous{identifier:\" \\\"repeated\\\" \",cn:10,bn:\"repeated\"}", - statement: "SELECT \"repeated\" FROM `[{repeated:1, repeated:2}]`", + statement: "SELECT \"repeated\" FROM [{repeated:1, repeated:2}]", assert: { evalMode: EvalModeError, result: EvaluationFail diff --git a/partiql-tests-data/eval/primitives/symbol.ion b/partiql-tests-data/eval/primitives/symbol.ion index 5f8e407..497c6e4 100644 --- a/partiql-tests-data/eval/primitives/symbol.ion +++ b/partiql-tests-data/eval/primitives/symbol.ion @@ -1,7 +1,7 @@ 'empty-symbol'::[ { name:"Empty Symbol in table", - statement:"SELECT \"\" FROM `{'': 1}`", + statement:"SELECT \"\" FROM {'': 1}", assert: [ { result: EvaluationSuccess, 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 b59be33..c723578 100644 --- a/partiql-tests-data/eval/query/group-by/group-by.ion +++ b/partiql-tests-data/eval/query/group-by/group-by.ion @@ -699,7 +699,7 @@ }, { name:"group by with where", - statement:"SELECT rep, SUM(total_sales) as total FROM sales_report WHERE fiscal_year >= `2001T` GROUP BY rep", + statement:"SELECT rep, SUM(total_sales) as total FROM sales_report WHERE fiscal_year >= DATE '2001-01-01' GROUP BY rep", assert:{ result:EvaluationSuccess, evalMode:[ @@ -724,7 +724,7 @@ }, { name:"group by with group as and where", - statement:"SELECT rep, g FROM sales_report WHERE fiscal_year >= `2001T` GROUP BY rep GROUP AS g", + statement:"SELECT rep, g FROM sales_report WHERE fiscal_year >= DATE '2001-01-01' GROUP BY rep GROUP AS g", assert:{ result:EvaluationSuccess, evalMode:[ @@ -975,7 +975,7 @@ 'simple-group-by-fail'::[ { name:"GROUP BY binding referenced in FROM clause", - statement:"SELECT gb_binding FROM sales_report, gb_binding WHERE fiscal_year >= `2001T` GROUP BY rep AS gb_binding", + statement:"SELECT gb_binding FROM sales_report, gb_binding WHERE fiscal_year >= DATE '2001-01-01' GROUP BY rep AS gb_binding", assert:[ { evalMode:EvalModeError, @@ -1003,7 +1003,7 @@ }, { name:"GROUP AS binding referenced in FROM clause", - statement:"SELECT rep, gba_binding FROM sales_report, gba_binding WHERE fiscal_year >= `2001T` GROUP BY rep GROUP AS gba_binding", + statement:"SELECT rep, gba_binding FROM sales_report, gba_binding WHERE fiscal_year >= DATE '2001-01-01' GROUP BY rep GROUP AS gba_binding", assert:[ { evalMode:EvalModeError, diff --git a/partiql-tests-data/eval/query/order-by.ion b/partiql-tests-data/eval/query/order-by.ion index b923ddc..9570dd4 100644 --- a/partiql-tests-data/eval/query/order-by.ion +++ b/partiql-tests-data/eval/query/order-by.ion @@ -298,66 +298,6 @@ edge_cases::[ output:[{'a': true}, {'a': true}, {'a': false}, {'a': false}] } }, - // nan before -inf, then numeric values then +inf (ASC) - { - name:"nan before -inf, then numeric values then +inf (ASC)", - statement:"SELECT * FROM [{ 'a': 5 }, { 'a': -5e-1 }, { 'a': `-inf` }, { 'a': `nan` }, { 'a': 7 }, { 'a': `+inf` }, { 'a': 9 }] ORDER BY a", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': nan}, {'a': -inf}, {'a': -0.5}, {'a': 5}, {'a': 7}, {'a': 9}, {'a': +inf}] - } - }, - // +inf before numeric values then -inf then nan (DESC) - { - name:"+inf before numeric values then -inf then nan (DESC)", - statement:"SELECT * FROM [{ 'a': 5 }, { 'a': -5e-1 }, { 'a': `-inf` }, { 'a': `nan` }, { 'a': 7 }, { 'a': `+inf` }, { 'a': 9 }] ORDER BY a DESC", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': +inf}, {'a': 9}, {'a': 7}, {'a': 5}, {'a': -0.5}, {'a': -inf}, {'a': nan}] - } - }, - // text types compared by lexicographical ordering of Unicode scalar (ASC) - { - name:"text types compared by lexicographical ordering of Unicode scalar (ASC)", - statement:'''SELECT * FROM [{ 'a': `'\uD83D\uDCA9'`}, { 'a': 'Z'}, { 'a': '9' }, { 'a': 'A'}, { 'a': `"\U0001F4A9"`}, { 'a': 'a'}, { 'a': 'z'}, { 'a': '0' }] ORDER BY a''', - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': '0'}, {'a': '9'}, {'a': 'A'}, {'a': 'Z'}, {'a': 'a'}, {'a': 'z'}, {'a': '\uD83D\uDCA9'}, {'a': "\U0001F4A9"}] - } - }, - // text types compared by lexicographical ordering of Unicode scalar (DESC) - { - name:"text types compared by lexicographical ordering of Unicode scalar (DESC)", - statement:'''SELECT * FROM [{ 'a': `'\uD83D\uDCA9'`}, { 'a': 'Z'}, { 'a': '9' }, { 'a': 'A'}, { 'a': `"\U0001F4A9"`}, { 'a': 'a'}, { 'a': 'z'}, { 'a': '0' }] ORDER BY a DESC''', - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': '\uD83D\uDCA9'}, {'a': "\U0001F4A9"}, {'a': 'z'}, {'a': 'a'}, {'a': 'Z'}, {'a': 'A'}, {'a': '9'}, {'a': '0'}] - } - }, - // LOB types follow their lexicographical ordering by octet (ASC) - { - name:"LOB types follow their lexicographical ordering by octet (ASC)", - statement:'''SELECT * FROM [{'a': `{{"Z"}}`}, {'a': `{{"a"}}`}, {'a': `{{"A"}}`}, {'a': `{{"z"}}`}] ORDER BY a''', - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': {{"A"}}}, {'a': {{"Z"}}}, {'a': {{"a"}}}, {'a': {{"z"}}}] - } - }, - // LOB types should ordered (DESC) - { - name:"LOB types should ordered (DESC)", - statement:'''SELECT * FROM [{'a': `{{"Z"}}`}, {'a': `{{"a"}}`}, {'a': `{{"A"}}`}, {'a': `{{"z"}}`}] ORDER BY a DESC''', - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:[{'a': {{"z"}}}, {'a': {{"a"}}}, {'a': {{"Z"}}}, {'a': {{"A"}}}] - } - }, // shorter array comes first (ASC) { name:"shorter array comes first (ASC)", @@ -401,21 +341,21 @@ edge_cases::[ // lists items should be ordered by data types (ASC) (nulls last as default for asc) { name:"lists items should be ordered by data types (ASC) (nulls last as default for asc)", - statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [`{{}}`]}, {'a': [[]]} ] ORDER BY a", + statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [[]]} ] ORDER BY a", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, - output:[{'a': [true]}, {'a': [1]}, {'a': ["a"]}, {'a': [{{}}]}, {'a': [[]]}, {'a': [{}]}, {'a': [$bag::[]]}, {'a': [null]}] + output:[{'a': [true]}, {'a': [1]}, {'a': ["a"]}, {'a': [[]]}, {'a': [{}]}, {'a': [$bag::[]]}, {'a': [null]}] } }, // lists items should be ordered by data types (DESC) (nulls first as default for desc) { name:"lists items should be ordered by data types (DESC) (nulls first as default for desc)", - statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [`{{}}`]}, {'a': [[]]} ] ORDER BY a DESC", + statement:"SELECT * FROM [{'a': ['a']}, {'a': [1]}, {'a': [true]}, {'a': [null]}, {'a': [{}]}, {'a': [<<>>]}, {'a': [[]]} ] ORDER BY a DESC", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, - output:[{'a': [null]}, {'a': [$bag::[]]}, {'a': [{}]}, {'a': [[]]}, {'a': [{{}}]}, {'a': ["a"]}, {'a': [1]}, {'a': [true]}] + output:[{'a': [null]}, {'a': [$bag::[]]}, {'a': [{}]}, {'a': [[]]}, {'a': ["a"]}, {'a': [1]}, {'a': [true]}] } }, // structs compared lexicographically first by key then by value (ASC) @@ -441,21 +381,21 @@ edge_cases::[ // structs should be ordered by data types (ASC) (nulls last as default for asc) { name:"structs should be ordered by data types (ASC) (nulls last as default for asc)", - statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': `{{}}`}}, {'a': {'a': null}}] ORDER BY a", + statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': null}}] ORDER BY a", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, - output:[{'a': {'a': true}}, {'a': {'a': 5}}, {'a': {'a': "b"}}, {'a': {'a': {{}}}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': $bag::[]}}, {'a': {'a': null}}] + output:[{'a': {'a': true}}, {'a': {'a': 5}}, {'a': {'a': "b"}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': $bag::[]}}, {'a': {'a': null}}] } }, // structs should be ordered by data types (DESC) (nulls first as default for desc) { name:"structs should be ordered by data types (DESC) (nulls first as default for desc)", - statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': `{{}}`}}, {'a': {'a': null}}] ORDER BY a DESC", + statement:"SELECT * FROM [{'a': {'a': 5}}, {'a': {'a': 'b'}}, {'a': {'a': true}}, {'a': {'a': []}}, {'a': {'a': {}}}, {'a': {'a': <<>>}}, {'a': {'a': null}}] ORDER BY a DESC", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, - output:[{'a': {'a': null}}, {'a': {'a': $bag::[]}}, {'a': {'a': {}}}, {'a': {'a': []}}, {'a': {'a': {{}}}}, {'a': {'a': "b"}}, {'a': {'a': 5}}, {'a': {'a': true}}] + output:[{'a': {'a': null}}, {'a': {'a': $bag::[]}}, {'a': {'a': []}}, {'a': {'a': {{}}}}, {'a': {'a': "b"}}, {'a': {'a': 5}}, {'a': {'a': true}}] } }, // bags compared as sorted lists (ASC) diff --git a/partiql-tests-data/eval/query/pivot.ion b/partiql-tests-data/eval/query/pivot.ion index c6549fc..a9ee1c0 100644 --- a/partiql-tests-data/eval/query/pivot.ion +++ b/partiql-tests-data/eval/query/pivot.ion @@ -59,7 +59,7 @@ pivot::[ }, { name:"pivotUnpivotWithWhereOrderByLimit", - statement:"PIVOT val AT 'new_' || name FROM UNPIVOT `{a:1, b:2, c:3, d:4, e:5, f: 6}` AS val AT name WHERE name <> 'b' AND val <> 3 ORDER BY val LIMIT 3", + statement:"PIVOT val AT 'new_' || name FROM UNPIVOT {'a':1, 'b':2, 'c':3, 'd':4, 'e':5, 'f': 6} AS val AT name WHERE name <> 'b' AND val <> 3 ORDER BY val LIMIT 3", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, diff --git a/partiql-tests-data/eval/query/select/from-clause.ion b/partiql-tests-data/eval/query/select/from-clause.ion index 196645b..adf8d7f 100644 --- a/partiql-tests-data/eval/query/select/from-clause.ion +++ b/partiql-tests-data/eval/query/select/from-clause.ion @@ -285,22 +285,9 @@ envs::{ }, ] }, - { - name:"rangeOverSexp", - statement:"SELECT VALUE v FROM `(a b c)` AS v", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - a, - b, - c - ] - } - }, { name:"rangeOverStruct", - statement:"SELECT VALUE v FROM `{a:5}` AS v", + statement:"SELECT VALUE v FROM {'a':5} AS v", assert: [ { evalMode:EvalModeCoerce, @@ -319,7 +306,7 @@ envs::{ }, { name:"rangeOverList", - statement:"SELECT VALUE v FROM `[1, 2, 3]` AS v", + statement:"SELECT VALUE v FROM [1, 2, 3] AS v", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -332,7 +319,7 @@ envs::{ }, { name:"rangeOverListWithAt", - statement:"SELECT VALUE i FROM `[1, 2, 3]` AT i", + statement:"SELECT VALUE i FROM [1, 2, 3] AT i", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -345,7 +332,7 @@ envs::{ }, { name:"rangeOverListWithAsAndAt", - statement:"SELECT VALUE [i, v] FROM `[1, 2, 3]` AS v AT i", + statement:"SELECT VALUE [i, v] FROM [1, 2, 3] AS v AT i", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -430,7 +417,7 @@ envs::{ }, { name:"rangeOverNestedWithAt", - statement:"SELECT VALUE [i, v] FROM (SELECT VALUE v FROM `[1, 2, 3]` AS v) AS v AT i", + statement:"SELECT VALUE [i, v] FROM (SELECT VALUE v FROM [1, 2, 3] AS v) AS v AT i", assert: [ { evalMode:EvalModeCoerce, diff --git a/partiql-tests-data/eval/query/select/projection.ion b/partiql-tests-data/eval/query/select/projection.ion index 01b37a3..71a819b 100644 --- a/partiql-tests-data/eval/query/select/projection.ion +++ b/partiql-tests-data/eval/query/select/projection.ion @@ -3,7 +3,7 @@ // https://github.com/partiql/partiql-lang-kotlin/blob/main/lang/test/org/partiql/lang/eval/EvaluatorTestSuite.kt#L1059-L1104 { name:"undefinedUnqualifiedVariable_inSelect_withProjectionOption", - statement:"SELECT s.a, s.undefined_variable, s.b FROM `[{a:100, b:200}]` s", + statement:"SELECT s.a, s.undefined_variable, s.b FROM [{'a':100, 'b':200}] s", assert: [ { evalMode:EvalModeCoerce, @@ -112,22 +112,6 @@ ] } }, - { - name:"projectOfSexp", - statement:"SELECT * FROM `(1 2)` as foo", - assert:{ - evalMode:[EvalModeCoerce, EvalModeError], - result:EvaluationSuccess, - output:$bag::[ - { - _1:( - 1 - 2 - ) - } - ] - } - }, { name:"projectOfUnpivotPath", statement:"SELECT * FROM <<{'name': 'Marrowstone Brewing'}, {'name': 'Tesla'}>>.*", diff --git a/partiql-tests-data/eval/query/select/select.ion b/partiql-tests-data/eval/query/select/select.ion index 753801d..00999d7 100644 --- a/partiql-tests-data/eval/query/select/select.ion +++ b/partiql-tests-data/eval/query/select/select.ion @@ -238,7 +238,7 @@ envs::{ }, { name:"selectListWithMissing", - statement:"SELECT a.x AS x, a.y AS y FROM `[{x:5}, {y:6}]` AS a", + statement:"SELECT a.x AS x, a.y AS y FROM [{'x':5}, {'y':6}] AS a", assert: [ { evalMode:EvalModeCoerce, @@ -539,7 +539,7 @@ select_join::[ }, { name:"correlatedJoinWithShadowedAttributes", - statement:"SELECT VALUE v FROM `[{v:5}]` AS item, @item.v AS v", + statement:"SELECT VALUE v FROM [{'v':5}] AS item, @item.v AS v", assert: [ { evalMode:EvalModeCoerce, @@ -556,7 +556,7 @@ select_join::[ }, { name:"correlatedJoinWithoutLexicalScope", - statement:"SELECT VALUE b FROM `[{b:5}]` AS item, item.b AS b", + statement:"SELECT VALUE b FROM [{'b':5}] AS item, item.b AS b", assert: [ { evalMode:EvalModeCoerce, @@ -573,7 +573,7 @@ select_join::[ }, { name:"joinWithShadowedGlobal", // 'a' is a global variable - statement:"SELECT VALUE b FROM `[{b:5}]` AS a, a.b AS b", + statement:"SELECT VALUE b FROM [{'b':5}] AS a, a.b AS b", assert: [ { evalMode:EvalModeCoerce, @@ -660,7 +660,7 @@ select_join::[ 'select distinct'::[ { name:"selectDistinct", - statement:"SELECT DISTINCT t.a FROM `[{a: 1}, {a: 2}, {a: 1}]` t", + statement:"SELECT DISTINCT t.a FROM [{'a': 1}, {'a': 2}, {'a': 1}] t", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -676,7 +676,7 @@ select_join::[ }, { name:"selectDistinctWithAggregate", - statement:"SELECT SUM(DISTINCT t.a) AS a FROM `[{a:10}, {a:1}, {a:10}, {a:3}]` t", + statement:"SELECT SUM(DISTINCT t.a) AS a FROM [{'a':10}, {'a':1}, {'a':10}, {'a':3}] t", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -689,7 +689,7 @@ select_join::[ }, { name:"selectDistinctSubQuery", - statement:"SELECT * FROM (SELECT DISTINCT t.a FROM `[{a: 1}, {a: 2}, {a: 1}]` t)", + statement:"SELECT * FROM (SELECT DISTINCT t.a FROM [{'a': 1}, {'a': 2}, {'a': 1}] t)", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -705,7 +705,7 @@ select_join::[ }, { name:"selectDistinctWithSubQuery", - statement:"SELECT DISTINCT * FROM (SELECT t.a FROM `[{a: 1}, {a: 2}, {a: 1}]` t)", + statement:"SELECT DISTINCT * FROM (SELECT t.a FROM [{'a': 1}, {'a': 2}, {'a': 1}] t)", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -721,7 +721,7 @@ select_join::[ }, { name:"selectDistinctAggregationWithGroupBy", - statement:"SELECT t.a, COUNT(DISTINCT t.b) AS c FROM `[{a:1, b:10}, {a:1, b:10}, {a:1, b:20}, {a:2, b:10}, {a:2, b:10}]` t GROUP by t.a", + statement:"SELECT t.a, COUNT(DISTINCT t.b) AS c FROM [{'a':1, 'b':10}, {'a':1, 'b':10}, {'a':1, 'b':20}, {'a':2, 'b':10}, {'a':2, 'b':10}] t GROUP by t.a", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -739,7 +739,7 @@ select_join::[ }, { name:"selectDistinctWithGroupBy", - statement:"SELECT DISTINCT t.a, COUNT(t.b) AS c FROM `[{a:1, b:10}, {a:1, b:10}, {a:1, b:20}, {a:2, b:10}, {a:2, b:10}]` t GROUP by t.a", + statement:"SELECT DISTINCT t.a, COUNT(t.b) AS c FROM [{'a':1, 'b':10}, {'a':1, 'b':10}, {'a':1, 'b':20}, {'a':2, 'b':10}, {'a':2, 'b':10}] t GROUP by t.a", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -757,7 +757,7 @@ select_join::[ }, { name:"selectDistinctWithJoin", - statement:"SELECT DISTINCT * FROM `[1, 1, 1, 1, 2]` t1, `[2, 2, 2, 2, 1]` t2", + statement:"SELECT DISTINCT * FROM [1, 1, 1, 1, 2] t1, [2, 2, 2, 2, 1] t2", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -953,7 +953,7 @@ select_join::[ }, { name:"selectDistinctExpressionAndWhere", - statement:"SELECT DISTINCT (t.a + t.b) as c FROM `[{a: 1, b: 1}, {a: 2, b: 0}, {a: 0, b: 2}, {a: 2, b: 2}, {a: 0, b: 99}]` t WHERE t.a > 0", + statement:"SELECT DISTINCT (t.a + t.b) as c FROM [{'a': 1, 'b': 1}, {'a': 2, 'b': 0}, {'a': 0, 'b': 2}, {'a': 2, 'b': 2}, {'a': 0, 'b': 99}] t WHERE t.a > 0", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, @@ -969,7 +969,7 @@ select_join::[ }, { name:"selectDistinctExpression", - statement:"SELECT DISTINCT (t.a || t.b) as c FROM `[{a: \"1\", b: \"1\"}, {a: \"11\", b: \"\"}, {a: \"\", b: \"11\"}, {a: \"2\", b: \"2\"}]` t", + statement:"SELECT DISTINCT (t.a || t.b) as c FROM [{'a': \"1\", 'b': \"1\"}, {'a': \"11\", 'b': \"\"}, {'a': \"\", 'b': \"11\"}, {'a': \"2\", 'b': \"2\"}] t", assert:{ evalMode:[EvalModeCoerce, EvalModeError], result:EvaluationSuccess, diff --git a/partiql-tests-data/eval/query/undefined-variable-behavior.ion b/partiql-tests-data/eval/query/undefined-variable-behavior.ion index 834fa52..cc0c748 100644 --- a/partiql-tests-data/eval/query/undefined-variable-behavior.ion +++ b/partiql-tests-data/eval/query/undefined-variable-behavior.ion @@ -47,7 +47,7 @@ undefined_variable_behavior::[ }, { name:"undefinedUnqualifiedVariableInSelectWithUndefinedVariableBehaviorMissing", - statement:"SELECT s.a, s.undefined_variable, s.b FROM `[{a:100, b:200}]` s", + statement:"SELECT s.a, s.undefined_variable, s.b FROM [{'a':100, 'b':200}] s", assert:[ { evalMode:EvalModeCoerce, diff --git a/partiql-tests-data/fail/static-analysis/primitives/functions/exists.ion b/partiql-tests-data/fail/static-analysis/primitives/functions/exists.ion index e4f34a0..fe7daa8 100644 --- a/partiql-tests-data/fail/static-analysis/primitives/functions/exists.ion +++ b/partiql-tests-data/fail/static-analysis/primitives/functions/exists.ion @@ -8,8 +8,8 @@ wrong_num_function_args::[ }, }, { - name:"exists wrong number of arguments{sql:\"exists(`[]`, 1)\"}", - statement:"exists(`[]`, 1)", + name:"exists wrong number of arguments{sql:\"exists([], 1)\"}", + statement:"exists([], 1)", assert: { result: StaticAnalysisFail }, diff --git a/partiql-tests-data/fail/static-analysis/primitives/functions/extract.ion b/partiql-tests-data/fail/static-analysis/primitives/functions/extract.ion index db4e7a8..9dcfdb9 100644 --- a/partiql-tests-data/fail/static-analysis/primitives/functions/extract.ion +++ b/partiql-tests-data/fail/static-analysis/primitives/functions/extract.ion @@ -22,29 +22,29 @@ wrong_num_function_args::[ }, }, { - name:"extract wrong number of arguments{sql:\"extract(`2017T`)\"}", - statement:"extract(`2017T`)", + name:"extract wrong number of arguments{sql:\"extract(DATE '2007-01-01')\"}", + statement:"extract(DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, }, { - name:"extract wrong number of arguments{sql:\"extract(from `2017T`)\"}", - statement:"extract(from `2017T`)", + name:"extract wrong number of arguments{sql:\"extract(from DATE '2007-01-01')\"}", + statement:"extract(from DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, }, { - name:"extract wrong number of arguments{sql:\"extract(year from `2017T`, 1)\"}", - statement:"extract(year from `2017T`, 1)", + name:"extract wrong number of arguments{sql:\"extract(year from DATE '2007-01-01', 1)\"}", + statement:"extract(year from DATE '2007-01-01', 1)", assert: { result: StaticAnalysisFail }, }, { - name:"extract wrong number of arguments{sql:\"extract(year, `2017T`)\"}", - statement:"extract(year, `2017T`)", + name:"extract wrong number of arguments{sql:\"extract(year, DATE '2007-01-01')\"}", + statement:"extract(year, DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, @@ -62,29 +62,29 @@ invalid_function_args::[ }, }, { - name:"extract wrong type of arguments{first:1,second:\"`2017T`\"}", - statement:"extract(1 from `2017T`)", + name:"extract wrong type of arguments{first:1,second:\"DATE '2007-01-01'\"}", + statement:"extract(1 from DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, }, { name:"extract invalid time part{time_part:\"foo\",tt:\"IDENTIFIER\",tv:foo}", - statement:"extract(foo from `2017T`)", + statement:"extract(foo from DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, }, { name:"extract invalid time part{time_part:\"null\",tt:\"NULL\",tv:null}", - statement:"extract(null from `2017T`)", + statement:"extract(null from DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, }, { name:"extract invalid time part{time_part:\"missing\",tt:\"MISSING\",tv:null}", - statement:"extract(missing from `2017T`)", + statement:"extract(missing from DATE '2007-01-01')", assert: { result: StaticAnalysisFail }, diff --git a/partiql-tests-data/fail/static-analysis/primitives/functions/substring.ion b/partiql-tests-data/fail/static-analysis/primitives/functions/substring.ion index 6f5c674..775114f 100644 --- a/partiql-tests-data/fail/static-analysis/primitives/functions/substring.ion +++ b/partiql-tests-data/fail/static-analysis/primitives/functions/substring.ion @@ -27,8 +27,8 @@ wrong_num_function_args::[ invalid_function_args::[ substring::[ { - name:"substring wrong type of arguments{sql:\"substring('', `{}`)\"}", - statement:"substring('', `{}`)", + name:"substring wrong type of arguments{sql:\"substring('', {})\"}", + statement:"substring('', {})", assert: { result: StaticAnalysisFail }, diff --git a/partiql-tests-data/fail/static-analysis/primitives/operator/is-operator.ion b/partiql-tests-data/fail/static-analysis/primitives/operator/is-operator.ion index 7972e52..3aaf9bc 100644 --- a/partiql-tests-data/fail/static-analysis/primitives/operator/is-operator.ion +++ b/partiql-tests-data/fail/static-analysis/primitives/operator/is-operator.ion @@ -1,6 +1,6 @@ { name: "IS operator expects type name", - statement: "NULL IS `null`", + statement: "NULL IS [null][0]", assert: { result: StaticAnalysisFail }, @@ -8,7 +8,7 @@ { name: "IS NOT operator expects type name", - statement: "NULL IS NOT `null`", + statement: "NULL IS NOT [null][0]", assert: { result: StaticAnalysisFail }, diff --git a/partiql-tests-data/fail/static-analysis/primitives/operator/like-operator.ion b/partiql-tests-data/fail/static-analysis/primitives/operator/like-operator.ion index d26c51d..00a8b7a 100644 --- a/partiql-tests-data/fail/static-analysis/primitives/operator/like-operator.ion +++ b/partiql-tests-data/fail/static-analysis/primitives/operator/like-operator.ion @@ -2,21 +2,21 @@ invalid_function_args::[ like::[ { name:"Incorrect type for text", - statement:"SELECT * FROM `[true]` WHERE 1 LIKE '1'", + statement:"SELECT * FROM [TRUE] WHERE 1 LIKE '1'", assert: { result: StaticAnalysisFail }, }, { name:"Incorrect type for pattern", - statement:"SELECT * FROM `[true]` WHERE 'a' LIKE 2", + statement:"SELECT * FROM [TRUE] WHERE 'a' LIKE 2", assert: { result: StaticAnalysisFail }, }, { name:"Incorrect type for Escape", - statement:"SELECT * FROM `[true]` WHERE 'a' LIKE 'a' ESCAPE 3", + statement:"SELECT * FROM [TRUE] WHERE 'a' LIKE 'a' ESCAPE 3", assert: { result: StaticAnalysisFail }, diff --git a/partiql-tests-data/fail/syntax/ion/primitives/date-constructor.ion b/partiql-tests-data/fail/syntax/ion/primitives/date-constructor.ion new file mode 100644 index 0000000..b6a64db --- /dev/null +++ b/partiql-tests-data/fail/syntax/ion/primitives/date-constructor.ion @@ -0,0 +1,9 @@ + +// TODO [joshsp] : In a lazy-document context, this is a data error, not a syntax error +{ + name: "invalid DATE string using Ion literal", + statement: "DATE `2012-08-28`", + assert: { + result: SyntaxFail + }, +} diff --git a/partiql-tests-data/fail/syntax/ion/primitives/time-constructor.ion b/partiql-tests-data/fail/syntax/ion/primitives/time-constructor.ion new file mode 100644 index 0000000..2347fc7 --- /dev/null +++ b/partiql-tests-data/fail/syntax/ion/primitives/time-constructor.ion @@ -0,0 +1,9 @@ + +// TODO [joshsp] : In a lazy-document context, this is a data error, not a syntax error +{ + name: "invalid TIME with Ion literal", + statement: "TIME `2012-12-12`", + assert: { + result: SyntaxFail + }, +} diff --git a/partiql-tests-data/fail/syntax/primitives/date-constructor.ion b/partiql-tests-data/fail/syntax/primitives/date-constructor.ion index 27331a6..fb7b62e 100644 --- a/partiql-tests-data/fail/syntax/primitives/date-constructor.ion +++ b/partiql-tests-data/fail/syntax/primitives/date-constructor.ion @@ -22,14 +22,6 @@ }, } -{ - name: "invalid DATE string using Ion literal", - statement: "DATE `2012-08-28`", - assert: { - result: SyntaxFail - }, -} - { name: "invalid DATE string no starting single quotation", statement: "DATE 2021-03-10'", diff --git a/partiql-tests-data/fail/syntax/primitives/path-expression.ion b/partiql-tests-data/fail/syntax/primitives/path-expression.ion index bf9f448..d82fedb 100644 --- a/partiql-tests-data/fail/syntax/primitives/path-expression.ion +++ b/partiql-tests-data/fail/syntax/primitives/path-expression.ion @@ -8,7 +8,7 @@ { name: "invalid path component keyword in path", - statement: '''SELECT foo.id, foo.table FROM `[{id: 1, table: "foos"}]` AS foo''', + statement: '''SELECT foo.id, foo.table FROM [{'id': 1, 'table': "foos"}] AS foo''', assert: { result: SyntaxFail }, diff --git a/partiql-tests-data/fail/syntax/primitives/time-constructor.ion b/partiql-tests-data/fail/syntax/primitives/time-constructor.ion index 8ad16ec..484af74 100644 --- a/partiql-tests-data/fail/syntax/primitives/time-constructor.ion +++ b/partiql-tests-data/fail/syntax/primitives/time-constructor.ion @@ -22,14 +22,6 @@ }, } -{ - name: "invalid TIME with Ion literal", - statement: "TIME `2012-12-12`", - assert: { - result: SyntaxFail - }, -} - { name: "invalid TIME WITH TIME ZONE missing time string", statement: "TIME WITH TIME ZONE",