diff --git a/test/test_files/tck/expressions/boolean/Boolean1.test b/test/test_files/tck/expressions/boolean/Boolean1.test new file mode 100644 index 00000000000..5f3ba759d07 --- /dev/null +++ b/test/test_files/tck/expressions/boolean/Boolean1.test @@ -0,0 +1,260 @@ +-GROUP TCKBoolean1 +-DATASET CSV tck + +-- + + + +# [1] Conjunction of two truth values +-CASE Scenario1 + + +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT RETURN true AND true AS tt, + true AND false AS tf, + true AND null AS tn, + false AND true AS ft, + false AND false AS ff, + false AND null AS fn, + null AND true AS nt, + null AND false AS nf, + null AND null AS nn; +---- 1 +True|False||False|False|False||False| + + +# [2] Conjunction of three truth values +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true AND true AND true AS ttt, + true AND true AND false AS ttf, + true AND true AND null AS ttn, + true AND false AND true AS tft, + true AND false AND false AS tff, + true AND false AND null AS tfn, + true AND null AND true AS tnt, + true AND null AND false AS tnf, + true AND null AND null AS tnn, + false AND true AND true AS ftt, + false AND true AND false AS ftf, + false AND true AND null AS ftn, + false AND false AND true AS fft, + false AND false AND false AS fff, + false AND false AND null AS ffn, + false AND null AND true AS fnt, + false AND null AND false AS fnf, + false AND null AND null AS fnn, + null AND true AND true AS ntt, + null AND true AND false AS ntf, + null AND true AND null AS ntn, + null AND false AND true AS nft, + null AND false AND false AS nff, + null AND false AND null AS nfn, + null AND null AND true AS nnt, + null AND null AND false AS nnf, + null AND null AND null AS nnn; +## Outcome: the result should be, in any order: +---- 1 +True|False||False|False|False||False||False|False|False|False|False|False|False|False|False||False||False|False|False||False| + + +# [3] Conjunction of many truth values +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true AND true AND true AND true AND true AND true AND true AND true AND true AND true AND true AS t, + true AND true AND true AND false AND true AND true AND true AND true AND true AND true AND true AS tsf, + true AND true AND true AND null AND true AND true AND true AND true AND true AND true AND true AS tsn, + false AND false AND false AND false AND false AND false AND false AND false AND false AND false AND false AS f, + false AND false AND false AND false AND true AND false AND false AND false AND false AND false AND false AS fst, + false AND false AND false AND false AND false AND false AND null AND false AND false AND false AND false AS fsn, + null AND null AND null AND null AND null AND null AND null AND null AND null AND null AND null AS n, + null AND null AND null AND null AND true AND null AND null AND null AND null AND null AND null AS nst, + null AND null AND null AND null AND false AND null AND null AND null AND null AND null AND null AS nsf, + true AND false AND false AND false AND true AND false AND false AND true AND true AND true AND false AS m1, + true AND true AND false AND false AND true AND false AND false AND true AND true AND true AND false AS m2, + true AND true AND false AND false AND true AND null AND false AND true AND true AND null AND false AS m3; +## Outcome: the result should be, in any order: +---- 1 +True|False||False|False|False|||False|False|False|False + +# [4] Conjunction is commutative on non-null +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + RETURN a, b, (a AND b) = (b AND a) AS result; +## Outcome: the result should be, in any order: +---- 4 +False|False|True +False|True|True +True|False|True +True|True|True + +# [5] Conjunction is commutative on null +-CASE Scenario5 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + WITH a, b WHERE a IS NULL OR b IS NULL + RETURN a, b, (a AND b) IS NULL = (b AND a) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 5 +true | null | true +false | null | true +null | true | true +null | false | true +null | null | true + + +# Conjunction is associative on non-null +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a AND (b AND c)) = ((a AND b) AND c) AS result; +## Outcome: the result should be, in any order: +---- 8 +False|False|False|True +False|False|True|True +False|True|False|True +False|True|True|True +True|False|False|True +True|False|True|True +True|True|False|True +True|True|True|True + +# Conjunction is associative on null +-CASE Scenario7 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a AND (b AND c)) IS NULL = ((a AND b) AND c) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +true | true | null | true +true | false | null | true +true | null | true | true +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | true +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# Fail on conjunction of at least one non-booleans +-CASE Scenario8 +-STATEMENT RETURN 123 AND true; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 AND true; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 AND null; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' AND true; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [] AND false; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] AND false; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [null] AND null; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} AND true; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false AND 123; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true AND 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false AND 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null AND 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true AND []; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true AND [false]; +---- error +Binder exception: Expression LIST_CREATION(False) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null AND [null]; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false AND {x: []}; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123 AND 'foo'; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123.4 AND 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' AND {x: []}; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] AND [true]; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} AND [123]; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. diff --git a/test/test_files/tck/expressions/boolean/Boolean2.test b/test/test_files/tck/expressions/boolean/Boolean2.test new file mode 100644 index 00000000000..dc7249d0712 --- /dev/null +++ b/test/test_files/tck/expressions/boolean/Boolean2.test @@ -0,0 +1,258 @@ +-GROUP TCKBoolean2 +-DATASET CSV tck + +-- + + +# Disjunction of two truth values +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true OR true AS tt, + true OR false AS tf, + true OR null AS tn, + false OR true AS ft, + false OR false AS ff, + false OR null AS fn, + null OR true AS nt, + null OR false AS nf, + null OR null AS nn; +## Outcome: the result should be, in any order: +---- 1 +True|True|True|True|False||True|| + +# Disjunction of three truth values +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true OR true OR true AS ttt, + true OR true OR false AS ttf, + true OR true OR null AS ttn, + true OR false OR true AS tft, + true OR false OR false AS tff, + true OR false OR null AS tfn, + true OR null OR true AS tnt, + true OR null OR false AS tnf, + true OR null OR null AS tnn, + false OR true OR true AS ftt, + false OR true OR false AS ftf, + false OR true OR null AS ftn, + false OR false OR true AS fft, + false OR false OR false AS fff, + false OR false OR null AS ffn, + false OR null OR true AS fnt, + false OR null OR false AS fnf, + false OR null OR null AS fnn, + null OR true OR true AS ntt, + null OR true OR false AS ntf, + null OR true OR null AS ntn, + null OR false OR true AS nft, + null OR false OR false AS nff, + null OR false OR null AS nfn, + null OR null OR true AS nnt, + null OR null OR false AS nnf, + null OR null OR null AS nnn; +## Outcome: the result should be, in any order: +---- 1 +True|True|True|True|True|True|True|True|True|True|True|True|True|False||True|||True|True|True|True|||True|| + +# Disjunction of many truth values +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true OR true OR true OR true OR true OR true OR true OR true OR true OR true OR true AS t, + true OR true OR true OR false OR true OR true OR true OR true OR true OR true OR true AS tsf, + true OR true OR true OR null OR true OR true OR true OR true OR true OR true OR true AS tsn, + false OR false OR false OR false OR false OR false OR false OR false OR false OR false OR false AS f, + false OR false OR false OR false OR true OR false OR false OR false OR false OR false OR false AS fst, + false OR false OR false OR false OR false OR false OR null OR false OR false OR false OR false AS fsn, + null OR null OR null OR null OR null OR null OR null OR null OR null OR null OR null AS n, + null OR null OR null OR null OR true OR null OR null OR null OR null OR null OR null AS nst, + null OR null OR null OR null OR false OR null OR null OR null OR null OR null OR null AS nsf, + true OR false OR false OR false OR true OR false OR false OR true OR true OR true OR false AS m1, + true OR true OR false OR false OR true OR false OR false OR true OR true OR true OR false AS m2, + true OR true OR false OR false OR true OR null OR false OR true OR true OR null OR false AS m3; +## Outcome: the result should be, in any order: +---- 1 +True|True|True|False|True|||True||True|True|True + +# Disjunction is commutative on non-null +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + RETURN a, b, (a OR b) = (b OR a) AS result; +## Outcome: the result should be, in any order: +---- 4 +False|False|True +False|True|True +True|False|True +True|True|True + + +# Disjunction is commutative on null +-CASE Scenario5 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + WITH a, b WHERE a IS NULL OR b IS NULL + RETURN a, b, (a OR b) IS NULL = (b OR a) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 5 +true | null | true +false | null | true +null | true | true +null | false | true +null | null | true + +# Disjunction is associative on non-null +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a OR (b OR c)) = ((a OR b) OR c) AS result; +## Outcome: the result should be, in any order: +---- 8 +False|False|False|True +False|False|True|True +False|True|False|True +False|True|True|True +True|False|False|True +True|False|True|True +True|True|False|True +True|True|True|True + +# Disjunction is associative on null +-CASE Scenario7 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a OR (b OR c)) IS NULL = ((a OR b) OR c) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +true | true | null | true +true | false | null | true +true | null | true | true +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | true +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# Fail on disjunction of at least one non-booleans +-CASE Scenario8 +-STATEMENT RETURN 123 OR true; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 OR true; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 OR null; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' OR true; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [] OR false; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] OR false; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [null] OR null; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} OR true; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false OR 123; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true OR 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false OR 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null OR 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true OR []; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true OR [false]; +---- error +Binder exception: Expression LIST_CREATION(False) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null OR [null]; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false OR {x: []}; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123 OR 'foo'; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123.4 OR 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' OR {x: []}; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] OR [true]; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} OR [123]; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. diff --git a/test/test_files/tck/expressions/boolean/Boolean3.test b/test/test_files/tck/expressions/boolean/Boolean3.test new file mode 100644 index 00000000000..7acbcc48357 --- /dev/null +++ b/test/test_files/tck/expressions/boolean/Boolean3.test @@ -0,0 +1,257 @@ +-GROUP TCKBoolean3 +-DATASET CSV tck + +-- + + +# Exclusive disjunction of two truth values +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true XOR true AS tt, + true XOR false AS tf, + true XOR null AS tn, + false XOR true AS ft, + false XOR false AS ff, + false XOR null AS fn, + null XOR true AS nt, + null XOR false AS nf, + null XOR null AS nn; +## Outcome: the result should be, in any order: +---- 1 +False|True||True|False|||| + +# Exclusive disjunction of three truth values +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true XOR true XOR true AS ttt, + true XOR true XOR false AS ttf, + true XOR true XOR null AS ttn, + true XOR false XOR true AS tft, + true XOR false XOR false AS tff, + true XOR false XOR null AS tfn, + true XOR null XOR true AS tnt, + true XOR null XOR false AS tnf, + true XOR null XOR null AS tnn, + false XOR true XOR true AS ftt, + false XOR true XOR false AS ftf, + false XOR true XOR null AS ftn, + false XOR false XOR true AS fft, + false XOR false XOR false AS fff, + false XOR false XOR null AS ffn, + false XOR null XOR true AS fnt, + false XOR null XOR false AS fnf, + false XOR null XOR null AS fnn, + null XOR true XOR true AS ntt, + null XOR true XOR false AS ntf, + null XOR true XOR null AS ntn, + null XOR false XOR true AS nft, + null XOR false XOR false AS nff, + null XOR false XOR null AS nfn, + null XOR null XOR true AS nnt, + null XOR null XOR false AS nnf, + null XOR null XOR null AS nnn; +## Outcome: the result should be, in any order: +---- 1 +True|False||False|True|||||False|True||True|False||||||||||||| + +# Exclusive disjunction of many truth values +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN true XOR true XOR true XOR true XOR true XOR true XOR true XOR true XOR true XOR true XOR true AS t, + true XOR true XOR true XOR false XOR true XOR true XOR true XOR true XOR true XOR true XOR true AS tsf, + true XOR true XOR true XOR null XOR true XOR true XOR true XOR true XOR true XOR true XOR true AS tsn, + false XOR false XOR false XOR false XOR false XOR false XOR false XOR false XOR false XOR false XOR false AS f, + false XOR false XOR false XOR false XOR true XOR false XOR false XOR false XOR false XOR false XOR false AS fst, + false XOR false XOR false XOR false XOR false XOR false XOR null XOR false XOR false XOR false XOR false AS fsn, + null XOR null XOR null XOR null XOR null XOR null XOR null XOR null XOR null XOR null XOR null AS n, + null XOR null XOR null XOR null XOR true XOR null XOR null XOR null XOR null XOR null XOR null AS nst, + null XOR null XOR null XOR null XOR false XOR null XOR null XOR null XOR null XOR null XOR null AS nsf, + true XOR false XOR false XOR false XOR true XOR false XOR false XOR true XOR true XOR true XOR false AS m1, + true XOR true XOR false XOR false XOR true XOR false XOR false XOR true XOR true XOR true XOR false AS m2, + true XOR true XOR false XOR false XOR true XOR null XOR false XOR true XOR true XOR null XOR false AS m3; +## Outcome: the result should be, in any order: +---- 1 +True|False||False|True|||||True|False| + +# Exclusive disjunction is commutative on non-null +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + RETURN a, b, (a XOR b) = (b XOR a) AS result; +## Outcome: the result should be, in any order: +---- 4 +True|True|True +True|False|True +False|True|True +False|False|True + +# Exclusive disjunction is commutative on null +-CASE Scenario5 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + WITH a, b WHERE a IS NULL OR b IS NULL + RETURN a, b, (a XOR b) IS NULL = (b XOR a) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 5 +true | null | true +false | null | true +null | true | true +null | false | true +null | null | true + +# Exclusive disjunction is associative on non-null +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a XOR (b XOR c)) = ((a XOR b) XOR c) AS result; +## Outcome: the result should be, in any order: +---- 8 +True|True|True|True +True|True|False|True +True|False|True|True +True|False|False|True +False|True|True|True +False|True|False|True +False|False|True|True +False|False|False|True + +# Exclusive disjunction is associative on null +-CASE Scenario7 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a XOR (b XOR c)) IS NULL = ((a XOR b) XOR c) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +true | true | null | true +true | false | null | true +true | null | true | true +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | true +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# Fail on exclusive disjunction of at least one non-booleans +-CASE Scenario8 +-STATEMENT RETURN 123 XOR true; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 XOR true; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN 123.4 XOR null; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' XOR true; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [] XOR false; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] XOR false; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [null] XOR null; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} XOR true; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false XOR 123; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true XOR 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false XOR 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null XOR 'foo'; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true XOR []; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN true XOR [false]; +---- error +Binder exception: Expression LIST_CREATION(False) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN null XOR [null]; +---- error +Binder exception: Expression LIST_CREATION() has data type STRING[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN false XOR {x: []}; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123 XOR 'foo'; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 123.4 XOR 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN 'foo' XOR {x: []}; +---- error +Binder exception: Expression foo has data type STRING but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN [true] XOR [true]; +---- error +Binder exception: Expression LIST_CREATION(True) has data type BOOL[] but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN {x: []} XOR [123]; +---- error +Binder exception: Expression STRUCT_PACK(x) has data type STRUCT(x:STRING[]) but expected BOOL. Implicit cast is not supported. diff --git a/test/test_files/tck/expressions/boolean/Boolean4.test b/test/test_files/tck/expressions/boolean/Boolean4.test new file mode 100644 index 00000000000..4b2005ac8e4 --- /dev/null +++ b/test/test_files/tck/expressions/boolean/Boolean4.test @@ -0,0 +1,66 @@ +-GROUP TCKBoolean4 +-DATASET CSV tck + +-- + + +# Logical negation of truth values +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN NOT true AS nt, NOT false AS nf, NOT null AS nn; +## Outcome: the result should be, in any order: +---- 1 +False|True| + +# Double logical negation of truth values +-CASE Scenario2 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN NOT NOT true AS nnt, NOT NOT false AS nnf, NOT NOT null AS nnn; +## Outcome: the result should be, in any order: +---- 1 +true | false | null + +# NOT and false +-CASE Scenario3 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (A:{name: 'a'}); +-STATEMENT MATCH (n) + WHERE NOT(n.name = 'apa' AND false) + RETURN n; +## Outcome: the result should be, in any order: +---- 1 +{name: 'a'} + +# Fail when using NOT on a non-boolean literal +-CASE Scenario4 +-STATEMENT RETURN NOT 0; +---- error +Binder exception: Expression 0 has data type INT64 but expected BOOL. Implicit cast is not supported. +-STATEMENT RETURN NOT 1; +---- error +Binder exception: Expression 1 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN NOT 123; +---- error +Binder exception: Expression 123 has data type INT64 but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN NOT 123.4; +---- error +Binder exception: Expression 123.400000 has data type DOUBLE but expected BOOL. Implicit cast is not supported. + +-STATEMENT RETURN NOT ''; +## Outcome: a SyntaxError should be raised at compile time: InvalidArgumentType +---- error +Binder exception: Expression has data type STRING but expected BOOL. Implicit cast is not supported. + + diff --git a/test/test_files/tck/expressions/boolean/Boolean5.test b/test/test_files/tck/expressions/boolean/Boolean5.test new file mode 100644 index 00000000000..2184a84a1a6 --- /dev/null +++ b/test/test_files/tck/expressions/boolean/Boolean5.test @@ -0,0 +1,203 @@ +-GROUP TCKBoolean5 +-DATASET CSV tck + +-- + + +# Disjunction is distributive over conjunction on non-null +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a OR (b AND c)) = ((a OR b) AND (a OR c)) AS result; +## Outcome: the result should be, in any order: +---- 8 +False|False|False|True +False|False|True|True +False|True|False|True +False|True|True|True +True|False|False|True +True|False|True|True +True|True|False|True +True|True|True|True + +# Disjunction is distributive over conjunction on null +-CASE Scenario2 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a OR (b AND c)) IS NULL = ((a OR b) AND (a OR c)) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +true | true | null | true +true | false | null | true +true | null | true | true +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | true +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# Conjunction is distributive over disjunction on non-null +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a AND (b OR c)) = ((a AND b) OR (a AND c)) AS result; +## Outcome: the result should be, in any order: +---- 8 +False|False|False|True +False|False|True|True +False|True|False|True +False|True|True|True +True|False|False|True +True|False|True|True +True|True|False|True +True|True|True|True + +# Conjunction is distributive over disjunction on null +-CASE Scenario4 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a AND (b OR c)) IS NULL = ((a AND b) OR (a AND c)) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +true | true | null | true +true | false | null | true +true | null | true | true +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | true +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# Conjunction is distributive over exclusive disjunction on non-null +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + UNWIND [true, false] AS c + RETURN a, b, c, (a AND (b XOR c)) = ((a AND b) XOR (a AND c)) AS result; +## Outcome: the result should be, in any order: +---- 8 +True|True|True|True +True|True|False|True +True|False|True|True +True|False|False|True +False|True|True|True +False|True|False|True +False|False|True|True +False|False|False|True + +# Conjunction is not distributive over exclusive disjunction on null +-CASE Scenario6 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false, null] AS a + UNWIND [true, false, null] AS b + UNWIND [true, false, null] AS c + WITH a, b, c WHERE a IS NULL OR b IS NULL OR c IS NULL + RETURN a, b, c, (a AND (b XOR c)) IS NULL = ((a AND b) XOR (a AND c)) IS NULL AS result; +## Outcome: the result should be, in any order: +---- 19 +True|True||True +True|False||True +True||True|True +true | null | false | true +true | null | null | true +false | true | null | true +false | false | null | true +false | null | true | true +false | null | false | true +false | null | null | true +null | true | true | false +null | true | false | true +null | true | null | true +null | false | true | true +null | false | false | true +null | false | null | true +null | null | true | true +null | null | false | true +null | null | null | true + +# De Morgan's law on non-null: the negation of a disjunction is the conjunction of the negations +-CASE Scenario7 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + RETURN a, b, NOT (a OR b) = (NOT (a) AND NOT (b)) AS result; +## Outcome: the result should be, in any order: +---- 4 +False|False|False +False|True|True +True|False|True +True|True|True + +# De Morgan's law on non-null: the negation of a conjunction is the disjunction of the negations +-CASE Scenario8 +-SKIP +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT UNWIND [true, false] AS a + UNWIND [true, false] AS b + RETURN a, b, NOT (a AND b) = (NOT (a) OR NOT (b)) AS result; +## Outcome: the result should be, in any order: +---- 4 +True|True|True +True|False|True +False|True|True +False|False|True diff --git a/test/test_files/tck/expressions/temporal/temporal1.test b/test/test_files/tck/expressions/temporal/temporal1.test new file mode 100644 index 00000000000..bd4d02de83a --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal1.test @@ -0,0 +1,452 @@ +-GROUP TCKTemporal1 +-DATASET CSV tck + +-- + + +# Should construct week date +-CASE Scenario1 +-STATEMENT RETURN date({year: 1816, week: 1}) AS d; +---- 1 +'1816-01-01' +-STATEMENT RETURN date({year: 1816, week: 52}) AS d; +---- 1 +'1816-12-23' +-STATEMENT RETURN date({year: 1817, week: 1}) AS d; +---- 1 +'1816-12-30' +-STATEMENT RETURN date({year: 1817, week: 10}) AS d; +---- 1 +'1817-03-03' +-STATEMENT RETURN date({year: 1817, week: 30}) AS d; +---- 1 +'1817-07-21' +-STATEMENT RETURN date({year: 1817, week: 52}) AS d; +---- 1 +'1817-12-22' +-STATEMENT RETURN date({year: 1818, week: 1}) AS d; +---- 1 +'1817-12-29' +-STATEMENT RETURN date({year: 1818, week: 52}) AS d; +---- 1 +'1818-12-21' +-STATEMENT RETURN date({year: 1818, week: 53}) AS d; +---- 1 +'1818-12-28' +-STATEMENT RETURN date({year: 1819, week: 1}) AS d; +---- 1 +'1819-01-04' +-STATEMENT RETURN date({year: 1819, week: 52}) AS d; +---- 1 +'1819-12-27' +-STATEMENT RETURN date({dayOfWeek: 2, year: 1817, week: 1}) AS d; +---- 1 +'1816-12-31' +-STATEMENT RETURN date({date: date('1816-12-30'), week: 2, dayOfWeek: 3}) AS d; +---- 1 +'1817-01-08' +-STATEMENT RETURN date({date: date('1816-12-31'), week: 2}) AS d; +---- 1 +'1817-01-07' +-STATEMENT RETURN date({date: date('1816-12-31'), year: 1817, week: 2}) AS d; +---- 1 +'1817-01-07' + + +# Should construct week localdatetime +-CASE Scenario2 +-STATEMENT RETURN localdatetime({year: 1816, week: 1}) AS d; +---- 1 +'1816-01-01T00:00' +-STATEMENT RETURN localdatetime({year: 1816, week: 52}) AS d; +---- 1 +'1816-12-23T00:00' +-STATEMENT RETURN localdatetime({year: 1817, week: 1}) AS d; +---- 1 +'1816-12-30T00:00' +-STATEMENT RETURN localdatetime({year: 1817, week: 10}) AS d; +---- 1 +'1817-03-03T00:00' +-STATEMENT RETURN localdatetime({year: 1817, week: 30}) AS d; +---- 1 +'1817-07-21T00:00' +-STATEMENT RETURN localdatetime({year: 1817, week: 52}) AS d; +---- 1 +'1817-12-22T00:00' +-STATEMENT RETURN localdatetime({year: 1818, week: 1}) AS d; +---- 1 +'1817-12-29T00:00' +-STATEMENT RETURN localdatetime({year: 1818, week: 52}) AS d; +---- 1 +'1818-12-21T00:00' +-STATEMENT RETURN localdatetime({year: 1818, week: 53}) AS d; +---- 1 +'1818-12-28T00:00' +-STATEMENT RETURN localdatetime({year: 1819, week: 1}) AS d; +---- 1 +'1819-01-04T00:00' +-STATEMENT RETURN localdatetime({year: 1819, week: 52}) AS d; +---- 1 +'1819-12-27T00:00' +-STATEMENT RETURN localdatetime({dayOfWeek: 2, year: 1817, week: 1}) AS d; +---- 1 +'1816-12-31T00:00' +-STATEMENT RETURN localdatetime({date: date('1816-12-30'), week: 2, dayOfWeek: 3}) AS d; +---- 1 +'1817-01-08T00:00' +-STATEMENT RETURN localdatetime({date: date('1816-12-31'), week: 2}) AS d; +---- 1 +'1817-01-07T00:00' +-STATEMENT RETURN localdatetime({date: date('1816-12-31'), year: 1817, week: 2}) AS d; +---- 1 +'1817-01-07T00:00' + +# Should construct week datetime +-CASE Scenario3 +-STATEMENT RETURN datetime({year: 1816, week: 1}) AS d; +## Outcome: the result should be, in any order: +---- 1 +'1816-01-01T00:00Z' +-STATEMENT RETURN datetime({year: 1816, week: 52}) AS d; +---- 1 +'1816-12-23T00:00Z' +-STATEMENT RETURN datetime({year: 1817, week: 1}) AS d; +---- 1 +'1816-12-30T00:00Z' +-STATEMENT RETURN datetime({year: 1817, week: 10}) AS d; +---- 1 +'1817-03-03T00:00Z' +-STATEMENT RETURN datetime({year: 1817, week: 30}) AS d; +---- 1 +'1817-07-21T00:00Z' +-STATEMENT RETURN datetime({year: 1817, week: 52}) AS d; +---- 1 +'1817-12-22T00:00Z' +-STATEMENT RETURN datetime({year: 1818, week: 1}) AS d; +---- 1 +'1817-12-29T00:00Z' +-STATEMENT RETURN datetime({year: 1818, week: 52}) AS d; +---- 1 +'1818-12-21T00:00Z' +-STATEMENT RETURN datetime({year: 1818, week: 53}) AS d; +---- 1 +'1818-12-28T00:00Z' +-STATEMENT RETURN datetime({year: 1819, week: 1}) AS d; +---- 1 +'1819-01-04T00:00Z' +-STATEMENT RETURN datetime({year: 1819, week: 52}) AS d; +---- 1 +'1819-12-27T00:00Z' +-STATEMENT RETURN datetime({dayOfWeek: 2, year: 1817, week: 1}) AS d; +---- 1 +'1816-12-31T00:00Z' +-STATEMENT RETURN datetime({date: date('1816-12-30'), week: 2, dayOfWeek: 3}) AS d; +---- 1 +'1817-01-08T00:00Z' +-STATEMENT RETURN datetime({date: date('1816-12-31'), week: 2}) AS d; +---- 1 +'1817-01-07T00:00Z' +-STATEMENT RETURN datetime({date: date('1816-12-31'), year: 1817, week: 2}) AS d; +---- 1 +'1817-01-07T00:00Z' + +# Should construct date +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN date({year: 1984, month: 10, day: 11}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11' +-STATEMENT RETURN date({year: 1984, week: 10, dayOfWeek: 3}) AS result; +---- 1 +'1984-03-07' +-STATEMENT RETURN date({year: 1984, week: 10}) AS result; +---- 1 +'1984-03-05' +-STATEMENT RETURN date({year: 1984}) AS result; +---- 1 +'1984-01-01' +-STATEMENT RETURN date({year: 1984, ordinalDay: 202}) AS result; +---- 1 +'1984-07-20' +-STATEMENT RETURN date({year: 1984, quarter: 3, dayOfQuarter: 45}) AS result; +---- 1 +'1984-08-14' +-STATEMENT RETURN date({year: 1984, quarter: 3}) AS result; +---- 1 +'1984-07-01' + + +# Should construct local time +-CASE Scenario5 +-STATEMENT RETURN localtime({hour: 12, minute: 31, second: 14, nanosecond: 789, millisecond: 123, microsecond: 456}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.123456789' + +-STATEMENT RETURN localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123' + +-STATEMENT RETURN localtime({hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876' + +-STATEMENT RETURN localtime({hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645' + +-STATEMENT RETURN localtime({hour: 12, minute: 31, second: 14}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14' + +-STATEMENT RETURN localtime({hour: 12, minute: 31}) AS result; +---- 1 +'12:31' + +-STATEMENT RETURN localtime({hour: 12}) AS result; +---- 1 +'12:00' + + +# Should construct time +-CASE Scenario6 +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, nanosecond: 789, millisecond: 123, microsecond: 456}) AS result; +---- 1 +'12:31:14.123456789Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'12:31:14.645876123Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, nanosecond: 3}) AS result; +---- 1 +'12:31:14.000000003Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'12:31:14.645876Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'12:31:14.645Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'12:31:14Z' +-STATEMENT RETURN time({hour: 12, minute: 31}) AS result; +---- 1 +'12:31Z' +-STATEMENT RETURN time({hour: 12}) AS result; +---- 1 +'12:00Z' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}) AS result; +---- 1 +'12:31:14.645876123+01:00' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS result; +---- 1 +'12:31:14.645876+01:00' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, millisecond: 645, timezone: '+01:00'}) AS result; +---- 1 +'12:31:14.645+01:00' +-STATEMENT RETURN time({hour: 12, minute: 31, second: 14, timezone: '+01:00'}) AS result; +---- 1 +'12:31:14+01:00' +-STATEMENT RETURN time({hour: 12, minute: 31, timezone: '+01:00'}) AS result; +---- 1 +'12:31+01:00' +-STATEMENT RETURN time({hour: 12, timezone: '+01:00'}) AS result; +---- 1 +'12:00+01:00' + +# Should construct local date time +-CASE Scenario7 +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 789, millisecond: 123, microsecond: 456}) AS result; +---- 1 +'1984-10-11T12:31:14.123456789' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-10-11T12:31:14.645876123' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 3}) AS result; +---- 1 +'1984-10-11T12:31:14.000000003' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-10-11T12:31:14.645876' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-10-11T12:31:14.645' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-10-11T12:31:14' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31}) AS result; +---- 1 +'1984-10-11T12:31' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11, hour: 12}) AS result; +---- 1 +'1984-10-11T12:00' +-STATEMENT RETURN localdatetime({year: 1984, month: 10, day: 11}) AS result; +---- 1 +'1984-10-11T00:00' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-03-07T12:31:14.645876123' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-03-07T12:31:14.645876' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-03-07T12:31:14.645' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-03-07T12:31:14' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31}) AS result; +---- 1 +'1984-03-07T12:31' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12}) AS result; +---- 1 +'1984-03-07T12:00' +-STATEMENT RETURN localdatetime({year: 1984, week: 10, dayOfWeek: 3}) AS result; +---- 1 +'1984-03-07T00:00' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-07-20T12:31:14.645876123' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-07-20T12:31:14.645876' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-07-20T12:31:14.645' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-07-20T12:31:14' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31}) AS result; +---- 1 +'1984-07-20T12:31' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202, hour: 12}) AS result; +---- 1 +'1984-07-20T12:00' +-STATEMENT RETURN localdatetime({year: 1984, ordinalDay: 202}) AS result; +---- 1 +'1984-07-20T00:00' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-08-14T12:31:14.645876123' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-08-14T12:31:14.645876' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-08-14T12:31:14.645' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-08-14T12:31:14' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31}) AS result; +---- 1 +'1984-08-14T12:31' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12}) AS result; +---- 1 +'1984-08-14T12:00' +-STATEMENT RETURN localdatetime({year: 1984, quarter: 3, dayOfQuarter: 45}) AS result; +---- 1 +'1984-08-14T00:00' +-STATEMENT RETURN localdatetime({year: 1984}) AS result; +---- 1 +'1984-01-01T00:00' + +# Should construct date time with default time zone +-CASE Scenario8 +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 789, millisecond: 123, microsecond: 456}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.123456789Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-10-11T12:31:14.645876123Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-10-11T12:31:14.645876Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-10-11T12:31:14.645Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-10-11T12:31:14Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31}) AS result; +---- 1 +'1984-10-11T12:31Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11, hour: 12}) AS result; +---- 1 +'1984-10-11T12:00Z' +-STATEMENT RETURN datetime({year: 1984, month: 10, day: 11}) AS result; +---- 1 +'1984-10-11T00:00Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-03-07T12:31:14.645876123Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-03-07T12:31:14.645876Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-03-07T12:31:14.645Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-03-07T12:31:14Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31}) AS result; +---- 1 +'1984-03-07T12:31Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12}) AS result; +---- 1 +'1984-03-07T12:00Z' +-STATEMENT RETURN datetime({year: 1984, week: 10, dayOfWeek: 3}) AS result; +---- 1 +'1984-03-07T00:00Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-07-20T12:31:14.645876123Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-07-20T12:31:14.645876Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-07-20T12:31:14.645Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-07-20T12:31:14Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31}) AS result; +---- 1 +'1984-07-20T12:31Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202, hour: 12}) AS result; +---- 1 +'1984-07-20T12:00Z' +-STATEMENT RETURN datetime({year: 1984, ordinalDay: 202}) AS result; +---- 1 +'1984-07-20T00:00Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS result; +---- 1 +'1984-08-14T12:31:14.645876123Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, microsecond: 645876}) AS result; +---- 1 +'1984-08-14T12:31:14.645876Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, millisecond: 645}) AS result; +---- 1 +'1984-08-14T12:31:14.645Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14}) AS result; +---- 1 +'1984-08-14T12:31:14Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31}) AS result; +---- 1 +'1984-08-14T12:31Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12}) AS result; +---- 1 +'1984-08-14T12:00Z' +-STATEMENT RETURN datetime({year: 1984, quarter: 3, dayOfQuarter: 45}) AS result; +---- 1 +'1984-08-14T00:00Z' +-STATEMENT RETURN datetime({year: 1984}) AS result; +---- 1 +'1984-01-01T00:00Z' diff --git a/test/test_files/tck/expressions/temporal/temporal2.test b/test/test_files/tck/expressions/temporal/temporal2.test new file mode 100644 index 00000000000..8c6ba2f22ce --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal2.test @@ -0,0 +1,176 @@ +-GROUP TCKTemporal2 +-DATASET CSV tck + +-- + +# Should parse date from string +-CASE Scenario1 +-STATEMENT RETURN date('2015-07-21') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('20150721') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('2015-07') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-01' + +-STATEMENT RETURN date('201507') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-01' + +-STATEMENT RETURN date('2015-W30-2') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('2015W302') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('2015-W30') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-20' + +-STATEMENT RETURN date('2015W30') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-20' + +-STATEMENT RETURN date('2015-202') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('2015202') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21' + +-STATEMENT RETURN date('2015') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-01-01' + + +# Should parse local time from string +-CASE Scenario2 +-STATEMENT RETURN localtime('21:40:32.142') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32.142' +-STATEMENT RETURN localtime('214032.142') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32.142' + +-STATEMENT RETURN localtime('21:40:32') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32' + +-STATEMENT RETURN localtime('214032') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32' + +-STATEMENT RETURN localtime('21:40') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40' + +-STATEMENT RETURN localtime('2140') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40' + +-STATEMENT RETURN localtime('21') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:00' + + +# Should parse time from string +-CASE Scenario3 +-STATEMENT RETURN time('21:40:32.142+0100') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32.142+01:00' +-STATEMENT RETURN time('214032.142Z') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32.142Z' +-STATEMENT RETURN time('21:40:32+01:00') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32+01:00' +-STATEMENT RETURN time('214032-0100') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40:32-01:00' +-STATEMENT RETURN time('21:40-01:30') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40-01:30' + +-STATEMENT RETURN time('2140-00:00') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40Z' + +-STATEMENT RETURN time('2140-02') AS result; +## Outcome: the result should be, in any order: +---- 1 +'21:40-02:00' + +-STATEMENT RETURN time('22+18:00') AS result; +## Outcome: the result should be, in any order: +---- 1 +'22:00+18:00' + + +# Should parse local date time from string +-CASE Scenario4 +-STATEMENT RETURN localdatetime('2015-07-21T21:40:32.142') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21T21:40:32.142' +-STATEMENT RETURN localdatetime('2015-W30-2T214032.142') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21T21:40:32.142' + +-STATEMENT RETURN localdatetime('2015-202T21:40:32') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21T21:40:32' + +-STATEMENT RETURN localdatetime('2015T214032') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-01-01T21:40:32' + +-STATEMENT RETURN localdatetime('20150721T21:40') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21T21:40' + +-STATEMENT RETURN localdatetime('2015-W30T2140') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-20T21:40' + +-STATEMENT RETURN localdatetime('2015202T21') AS result; +## Outcome: the result should be, in any order: +---- 1 +'2015-07-21T21:00' + + diff --git a/test/test_files/tck/expressions/temporal/temporal3.test b/test/test_files/tck/expressions/temporal/temporal3.test new file mode 100644 index 00000000000..c84fcd9f3cd --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal3.test @@ -0,0 +1,1326 @@ +-GROUP TCKTemporal3 +-DATASET CSV tck + +-- + + +# Should select date +-CASE Scenario1 +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other, year: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'0028-11-11' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other, day: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-28' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other, week: 1}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-08' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other, ordinalDay: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-28' + +-STATEMENT WITH date({year: 1984, month: 11, day: 11}) AS other + RETURN date({date: other, quarter: 3}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-08-11' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other, year: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'0028-11-11' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other, day: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-28' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other, week: 1}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-08' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other, ordinalDay: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-28' + +-STATEMENT WITH localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN date({date: other, quarter: 3}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-08-11' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-11' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other, year: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'0028-11-11' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other, day: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-11-28' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other, week: 1}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-08' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other, ordinalDay: 28}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-01-28' + +-STATEMENT WITH datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN date({date: other, quarter: 3}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-08-11' + +# Should select local time +-CASE Scenario22 +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN localtime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123' +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN localtime({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123' + +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN localtime({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645876123' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN localtime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN localtime({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN localtime({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645876' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localtime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localtime({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localtime({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localtime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localtime({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localtime({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00:42' + +# Should select time +-CASE Scenario34 +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN time(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123Z' + +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN time({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123Z' + +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN time({time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123+05:00' + +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN time({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645876123Z' + +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN time({time: other, second: 42, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645876123+05:00' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN time(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876+01:00' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN time({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876+01:00' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN time({time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'16:31:14.645876+05:00' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN time({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645876+01:00' + +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN time({time: other, second: 42, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'16:31:42.645876+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN time(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN time({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN time({time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645+05:00' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN time({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN time({time: other, second: 42, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:31:42.645+05:00' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN time(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00+01:00' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN time({time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00+01:00' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN time({time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'16:00+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN time({time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'12:00:42+01:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN time({time: other, second: 42, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'16:00:42+05:00' + +# Should select date into local date time +-CASE Scenario54 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN localdatetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10' + +# Should select date into local date time +-CASE Scenario55 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN localdatetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10' + +# Should select date into local date time +-CASE Scenario56 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T10:10:10' + +# Should select date into local date time +-CASE Scenario57 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T10:10:10' + +# Should select date into local date time +-CASE Scenario58 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10' + +# Should select date into local date time +-CASE Scenario59 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10' + +# Should select time into local date time +-CASE Scenario60 +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123' +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645876123' +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876' +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645876' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00:42' + +# Should select date and time into local date time +-CASE Scenario68 +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00' +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645876123' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645876123' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645876' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645876' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:00' +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:00:42' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00' +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherTime + RETURN localdatetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42' + +# Should select datetime into local date time +-CASE Scenario92 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645' + +# Should select datetime into local date time +-CASE Scenario93 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({datetime: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645' + +# Should select datetime into local date time +-CASE Scenario94 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN localdatetime({datetime: other, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645' + +# Should select datetime into local date time +-CASE Scenario95 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00' + +# Should select datetime into local date time +-CASE Scenario96 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({datetime: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00' + +# Should select datetime into local date time +-CASE Scenario97 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN localdatetime({datetime: other, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42' + +# Should select date into date time +-CASE Scenario98 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10Z' + +# Should select date into date time +-CASE Scenario99 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10+05:00' + +# Should select date into date time +-CASE Scenario100 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10Z' + +# Should select date into date time +-CASE Scenario101 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10-10:00[Pacific/Honolulu]' + +# Should select date into date time +-CASE Scenario102 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T10:10:10Z' + +# Should select date into date time +-CASE Scenario103 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T10:10:10+05:00' + +# Should select date into date time +-CASE Scenario104 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T10:10:10Z' + +# Should select date into date time +-CASE Scenario105 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T10:10:10-10:00[Pacific/Honolulu]' + +# Should select date into date time +-CASE Scenario106 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10Z' + +# Should select date into date time +-CASE Scenario107 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN datetime({date: other, hour: 10, minute: 10, second: 10, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T10:10:10+05:00' + +# Should select date into date time +-CASE Scenario108 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10Z' + +# Should select date into date time +-CASE Scenario109 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS other + RETURN datetime({date: other, day: 28, hour: 10, minute: 10, second: 10, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T10:10:10-10:00[Pacific/Honolulu]' + +# Should select time into date time +-CASE Scenario110 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123Z' + +# Should select time into date time +-CASE Scenario111 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123+05:00' + +# Should select time into date time +-CASE Scenario112 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645876123Z' + +# Should select time into date time +-CASE Scenario113 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645876123-10:00[Pacific/Honolulu]' + +# Should select time into date time +-CASE Scenario114 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876+01:00' + +# Should select time into date time +-CASE Scenario115 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:31:14.645876+05:00' + +# Should select time into date time +-CASE Scenario116 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645876+01:00' + +# Should select time into date time +-CASE Scenario117 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T01:31:42.645876-10:00[Pacific/Honolulu]' + +# Should select time into date time +-CASE Scenario118 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645Z' + +# Should select time into date time +-CASE Scenario119 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645+05:00' + +# Should select time into date time +-CASE Scenario120 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645Z' + +# Should select time into date time +-CASE Scenario121 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:42.645-10:00[Pacific/Honolulu]' + +# Should select time into date time +-CASE Scenario122 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' + +# Should select time into date time +-CASE Scenario123 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:00+05:00' + +# Should select time into date time +-CASE Scenario124 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00:42+01:00[Europe/Stockholm]' + +# Should select time into date time +-CASE Scenario125 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({year: 1984, month: 10, day: 11, time: other, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T01:00:42-10:00[Pacific/Honolulu]' + +# Should select date and time into date time +-CASE Scenario126 +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123Z' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123+05:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123Z' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123-10:00[Pacific/Honolulu]' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876+01:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:31:14.645876+05:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876+01:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T01:31:42.645876-10:00[Pacific/Honolulu]' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645Z' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645+05:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645Z' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645-10:00[Pacific/Honolulu]' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:00+05:00' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42+01:00[Europe/Stockholm]' + +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T01:00:42-10:00[Pacific/Honolulu]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645876123Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645876123+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645876123Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645876123-10:00[Pacific/Honolulu]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645876+01:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T16:31:14.645876+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645876+01:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T01:31:42.645876-10:00[Pacific/Honolulu]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645-10:00[Pacific/Honolulu]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:00+01:00[Europe/Stockholm]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T16:00+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:00:42+02:00[Europe/Stockholm]' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T00:00:42-10:00[Pacific/Honolulu]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123Z' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123Z' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876123-10:00[Pacific/Honolulu]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876+01:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:31:14.645876+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645876+01:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T01:31:42.645876-10:00[Pacific/Honolulu]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645Z' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645Z' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:31:42.645-10:00[Pacific/Honolulu]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:00+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42+01:00[Europe/Stockholm]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}) AS otherDate, datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS otherTime + RETURN datetime({date: otherDate, time: otherTime, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T01:00:42-10:00[Pacific/Honolulu]' + +# Should datetime into date time +-CASE Scenario174 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({datetime: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({datetime: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-07T12:31:14.645+05:00' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({datetime: other, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645Z' + +-STATEMENT WITH localdatetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}) AS other + RETURN datetime({datetime: other, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-03-28T12:31:42.645-10:00[Pacific/Honolulu]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime(other) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({datetime: other}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({datetime: other, timezone: '+05:00'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T16:00+05:00' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({datetime: other, day: 28, second: 42}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T12:00:42+01:00[Europe/Stockholm]' + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: 'Europe/Stockholm'}) AS other + RETURN datetime({datetime: other, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28T01:00:42-10:00[Pacific/Honolulu]' diff --git a/test/test_files/tck/expressions/temporal/temporal4.test b/test/test_files/tck/expressions/temporal/temporal4.test new file mode 100644 index 00000000000..a7f9d49c30f --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal4.test @@ -0,0 +1,541 @@ +-GROUP TCKTemporal4 +-DATASET CSV tck + +-- + +# Should store date +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: date({year: 1984, month: 10, day: 11})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11' + +# Should store date array +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [date({year: 1984, month: 10, day: 12})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1984-10-12'] + +# Should store date array +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [date({year: 1984, month: 10, day: 13}), date({year: 1984, month: 10, day: 14}), date({year: 1984, month: 10, day: 15})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1984-10-13', '1984-10-14', '1984-10-15'] + +# Should store local time +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: localtime({hour: 12})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'12:00' + +# Should store local time array +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [localtime({hour: 13})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['13:00'] + +# Should store local time array +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [localtime({hour: 14}), localtime({hour: 15}), localtime({hour: 16})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['14:00', '15:00', '16:00'] + +# Should store time +-CASE Scenario7 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: time({hour: 12})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'12:00Z' + +# Should store time array +-CASE Scenario8 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [time({hour: 13})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['13:00Z'] + +# Should store time array +-CASE Scenario9 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [time({hour: 14}), time({hour: 15}), time({hour: 16})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['14:00Z', '15:00Z', '16:00Z'] + +# Should store local date time +-CASE Scenario10 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: localdatetime({year: 1912})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'1912-01-01T00:00' + +# Should store local date time array +-CASE Scenario11 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [localdatetime({year: 1913})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1913-01-01T00:00'] + +# Should store local date time array +-CASE Scenario12 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [localdatetime({year: 1914}), localdatetime({year: 1915}), localdatetime({year: 1916})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1914-01-01T00:00', '1915-01-01T00:00', '1916-01-01T00:00'] + +# Should store date time +-CASE Scenario13 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: datetime({year: 1912})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'1912-01-01T00:00Z' + +# Should store date time array +-CASE Scenario14 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [datetime({year: 1913})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1913-01-01T00:00Z'] + +# Should store date time array +-CASE Scenario15 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [datetime({year: 1914}), datetime({year: 1915}), datetime({year: 1916})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['1914-01-01T00:00Z', '1915-01-01T00:00Z', '1916-01-01T00:00Z'] + +# Should store duration +-CASE Scenario16 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({created: duration({seconds: 12})}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.created; +## Outcome: the result should be, in any order: +---- 1 +'PT12S' + +# Should store duration array +-CASE Scenario17 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [duration({seconds: 13})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['PT13S'] + +# Should store duration array +-CASE Scenario18 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE ({dates: [duration({seconds: 14}), duration({seconds: 15}), duration({seconds: 16})]}); +## Outcome: the result should be empty +## Outcome: the side effects should be: +---- 1 ++properties|1 +## Action: executing control query: +-STATEMENT MATCH (n) + RETURN n.dates; +## Outcome: the result should be, in any order: +---- 1 +['PT14S', 'PT15S', 'PT16S'] + +# Should propagate null +-CASE Scenario19 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN date(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario20 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN date.transaction(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario21 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN date.statement(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario22 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN date.realtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario23 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario24 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localtime.transaction(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario25 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localtime.statement(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario26 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localtime.realtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario27 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN time(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario28 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN time.transaction(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario29 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN time.statement(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario30 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN time.realtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario31 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localdatetime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario32 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localdatetime.transaction(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario33 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localdatetime.statement(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario34 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN localdatetime.realtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario35 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN datetime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario36 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN datetime.transaction(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario37 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN datetime.statement(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario38 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN datetime.realtime(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null + +# Should propagate null +-CASE Scenario39 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT RETURN duration(null) AS t; +## Outcome: the result should be, in any order: +---- 1 +null \ No newline at end of file diff --git a/test/test_files/tck/expressions/temporal/temporal5.test b/test/test_files/tck/expressions/temporal/temporal5.test new file mode 100644 index 00000000000..b86a8395d55 --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal5.test @@ -0,0 +1,103 @@ +-GROUP TCKTemporal5 +-DATASET CSV tck + +-- + + +# Should provide accessors for date +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: date({year: 1984, month: 10, day: 11})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.year, d.quarter, d.month, d.week, d.weekYear, d.day, d.ordinalDay, d.weekDay, d.dayOfQuarter; +## Outcome: the result should be, in any order: +---- 1 +1984|4|10|41|1984|11|285|4|11 + +# Should provide accessors for date in last weekYear +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: date({year: 1984, month: 1, day: 1})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.year, d.weekYear, d.week, d.weekDay; +## Outcome: the result should be, in any order: +---- 1 +1984|1983|52|7 + +# Should provide accessors for local time +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.hour, d.minute, d.second, d.millisecond, d.microsecond, d.nanosecond; +## Outcome: the result should be, in any order: +---- 1 +12|31|14|645|645876|645876123 + +# Should provide accessors for time +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.hour, d.minute, d.second, d.millisecond, d.microsecond, d.nanosecond, d.timezone, d.offset, d.offsetMinutes, d.offsetSeconds; +## Outcome: the result should be, in any order: +---- 1 +12|31|14|645|645876|645876123|'+01:00'|'+01:00'|60|3600 + +# Should provide accessors for local date time +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.year, d.quarter, d.month, d.week, d.weekYear, d.day, d.ordinalDay, d.weekDay, d.dayOfQuarter, + d.hour, d.minute, d.second, d.millisecond, d.microsecond, d.nanosecond; +## Outcome: the result should be, in any order: +---- 1 +1984|4|11|45|1984|11|316|7|42|12|31|14|645|645876|645876123 + +# Should provide accessors for date time +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: 'Europe/Stockholm'})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.year, d.quarter, d.month, d.week, d.weekYear, d.day, d.ordinalDay, d.weekDay, d.dayOfQuarter, + d.hour, d.minute, d.second, d.millisecond, d.microsecond, d.nanosecond, + d.timezone, d.offset, d.offsetMinutes, d.offsetSeconds, d.epochSeconds, d.epochMillis; +## Outcome: the result should be, in any order: +---- 1 +1984|4|11|45|1984|11|316|7|42|12|31|14|645|645876|645876123|'Europe/Stockholm'|'+01:00'|60|3600|469020674|469020674645 + +# Should provide accessors for duration +-CASE Scenario7 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Val {date: duration({years: 1, months: 4, days: 10, hours: 1, minutes: 1, seconds: 1, nanoseconds: 111111111})}); +-STATEMENT MATCH (v:Val) + WITH v.date AS d + RETURN d.years, d.quarters, d.months, d.weeks, d.days, + d.hours, d.minutes, d.seconds, d.milliseconds, d.microseconds, d.nanoseconds, + d.quartersOfYear, d.monthsOfQuarter, d.monthsOfYear, d.daysOfWeek, d.minutesOfHour, d.secondsOfMinute, d.millisecondsOfSecond, d.microsecondsOfSecond, d.nanosecondsOfSecond; +## Outcome: the result should be, in any order: +---- 1 +1|5|16|1|10|1|61|3661|3661111|3661111111|3661111111111|1|1|4|3|1|1|111|111111|111111111 + + diff --git a/test/test_files/tck/expressions/temporal/temporal6.test b/test/test_files/tck/expressions/temporal/temporal6.test new file mode 100644 index 00000000000..f75756b92af --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal6.test @@ -0,0 +1,149 @@ +-GROUP TCKTemporal6 +-DATASET CSV tck + +-- + + +# Should serialize date +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS d + RETURN toString(d) AS ts, date(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11'|True + +# Should serialize local time +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN toString(d) AS ts, localtime(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123'|True + +# Should serialize time +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}) AS d + RETURN toString(d) AS ts, time(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'12:31:14.645876123+01:00'|True + +# Should serialize local date time +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN toString(d) AS ts, localdatetime(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123'|True + +# Should serialize date time +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}) AS d + RETURN toString(d) AS ts, datetime(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-11T12:31:14.645876123+01:00'|True + +# Should serialize duration +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'P12Y5M14DT16H13M10.000000001S'|True + +-STATEMENT WITH duration({years: 12, months: 5, days: -14, hours: 16}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'P12Y5M-14DT16H'|True + +-STATEMENT WITH duration({minutes: 12, seconds: -60}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT11M'|True + +-STATEMENT WITH duration({seconds: 2, milliseconds: -1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT1.999S'|True + +-STATEMENT WITH duration({seconds: -2, milliseconds: 1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT-1.999S'|True + +-STATEMENT WITH duration({seconds: -2, milliseconds: -1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT-2.001S'|True + +-STATEMENT WITH duration({days: 1, milliseconds: 1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'P1DT0.001S'|True + +-STATEMENT WITH duration({days: 1, milliseconds: -1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'P1DT-0.001S'|True + +-STATEMENT WITH duration({seconds: 60, milliseconds: -1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT59.999S'|True + +-STATEMENT WITH duration({seconds: -60, milliseconds: 1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT-59.999S'|True + +-STATEMENT WITH duration({seconds: -60, milliseconds: -1}) AS d + RETURN toString(d) AS ts, duration(toString(d)) = d AS b; +## Outcome: the result should be, in any order: +---- 1 +'PT-1M-0.001S'|True + +# Should serialize timezones correctly +-CASE Scenario17 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH datetime({year: 2017, month: 8, day: 8, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: 'Europe/Stockholm'}) AS d + RETURN toString(d) AS ts; +## Outcome: the result should be, in any order: +---- 1 +'2017-08-08T12:31:14.645876123+02:00[Europe/Stockholm]' \ No newline at end of file diff --git a/test/test_files/tck/expressions/temporal/temporal7.test b/test/test_files/tck/expressions/temporal/temporal7.test new file mode 100644 index 00000000000..9aee5b9595b --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal7.test @@ -0,0 +1,147 @@ +-GROUP TCKTemporal7 +-DATASET CSV tck + +-- + + +# Should compare dates +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1980, month: 12, day: 24}) AS x, date({year: 1984, month: 10, day: 11}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|True|False|True|False + +# Should compare dates +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS x, date({year: 1984, month: 10, day: 11}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|False|True|True|True + +# Should compare local times +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 10, minute: 35}) AS x, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|True|False|True|False + +# Should compare local times +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS x, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|False|True|True|True + +# Should compare times +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 10, minute: 0, timezone: '+01:00'}) AS x, time({hour: 9, minute: 35, second: 14, nanosecond: 645876123, timezone: '+00:00'}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|True|False|True|False + +# Should compare times +-CASE Scenario6 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +## Context: any graph +-STATEMENT WITH time({hour: 9, minute: 35, second: 14, nanosecond: 645876123, timezone: '+00:00'}) AS x, time({hour: 9, minute: 35, second: 14, nanosecond: 645876123, timezone: '+00:00'}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|False|True|True|True + +# Should compare local date times +-CASE Scenario7 +-STATEMENT WITH localdatetime({year: 1980, month: 12, day: 11, hour: 12, minute: 31, second: 14}) AS x, localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|True|False|True|False +-STATEMENT WITH localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS x, localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|False|True|True|True + +# Should compare date times +-CASE Scenario9 +-STATEMENT WITH datetime({year: 1980, month: 12, day: 11, hour: 12, minute: 31, second: 14, timezone: '+00:00'}) AS x, datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, timezone: '+05:00'}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|True|False|True|False + +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, timezone: '+05:00'}) AS x, datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, timezone: '+05:00'}) AS d + RETURN x > d, x < d, x >= d, x <= d, x = d; +## Outcome: the result should be, in any order: +---- 1 +False|False|True|True|True + +# Should compare durations for equality +-CASE Scenario11 +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, date({year: 1984, month: 10, day: 11}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, localtime({hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, time({hour: 9, minute: 35, second: 14, nanosecond: 645876123, timezone: '+00:00'}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, timezone: '+05:00'}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +True +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, duration({years: 12, months: 5, days: 14, hours: 16, minutes: 13, seconds: 10}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +True +-STATEMENT WITH duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70}) AS x, duration({years: 12, months: 5, days: 13, hours: 40, minutes: 13, seconds: 10}) AS d + RETURN x = d; +## Outcome: the result should be, in any order: +---- 1 +False diff --git a/test/test_files/tck/expressions/temporal/temporal8.test b/test/test_files/tck/expressions/temporal/temporal8.test new file mode 100644 index 00000000000..b2bbf280524 --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal8.test @@ -0,0 +1,304 @@ +-GROUP TCKTemporal8 +-DATASET CSV tck + +-- + + +# Should add or subtract duration to or from date +-CASE Scenario1 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {dur: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 2})}); +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-03-25'|'1972-04-27' + +# Should add or subtract duration to or from date +-CASE Scenario2 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {dur: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-28'|'1984-09-25' + +# Should add or subtract duration to or from date +-CASE Scenario3 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {dur: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT WITH date({year: 1984, month: 10, day: 11}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-10-11'|'1971-10-12' + +# Should add or subtract duration to or from local time +-CASE Scenario4 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {dur: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 2})}); +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'04:44:24.000000003'|'20:18:03.999999999' + +# Should add or subtract duration to or from local time +-CASE Scenario5 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {dur: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'04:20:24.000000001'|'20:42:04.000000001' + +# Should add or subtract duration to or from local time +-CASE Scenario6 +-STATEMENT CREATE (:Duration {dur: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT WITH localtime({hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'22:29:27.500000004'|'02:33:00.499999998' +-STATEMENT CREATE (:Duration {dur: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 2})}); +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'04:44:24.000000003+01:00'|'20:18:03.999999999+01:00' + +-STATEMENT CREATE (:Duration {dur: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'04:20:24.000000001+01:00'|'20:42:04.000000001+01:00' + +-STATEMENT CREATE (:Duration {dur: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT WITH time({hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'22:29:27.500000004+01:00'|'02:33:00.499999998+01:00' + +-STATEMENT CREATE (:Duration {dur: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 2})}); +-STATEMENT WITH localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-03-26T04:44:24.000000003'|'1972-04-26T20:18:03.999999999' + +-STATEMENT CREATE (:Duration {dur: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT WITH localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-29T04:20:24.000000001'|'1984-09-24T20:42:04.000000001' + +-STATEMENT CREATE (:Duration {dur: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT WITH localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-10-11T22:29:27.500000004'|'1971-10-12T02:33:00.499999998' + +-STATEMENT CREATE (:Duration {dur: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 2})}); +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-03-26T04:44:24.000000003+01:00'|'1972-04-26T20:18:03.999999999+01:00' + +-STATEMENT CREATE (:Duration {dur: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1984-10-29T04:20:24.000000001+01:00'|'1984-09-24T20:42:04.000000001+01:00' + +-STATEMENT CREATE (:Duration {dur: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT WITH datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 1, timezone: '+01:00'}) AS x + MATCH (d:Duration) + RETURN x + d.dur AS sum, x - d.dur AS diff; +## Outcome: the result should be, in any order: +---- 1 +'1997-10-11T22:29:27.500000004+01:00'|'1971-10-12T02:33:00.499999998+01:00' + +# Should add or subtract durations +-CASE Scenario16 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}) + CREATE (:Duration2 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P24Y10M28DT32H26M20.000000002S'|'PT0S' + +# Should add or subtract durations +-CASE Scenario17 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}) + CREATE (:Duration2 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P12Y6MT32H2M20.000000001S'|'P12Y4M28DT24M0.000000001S' + +# Should add or subtract durations +-CASE Scenario18 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}) + CREATE (:Duration2 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P25Y4M43DT50H11M23.500000004S'|'P-6M-15DT-17H-45M-3.500000002S' + +# Should add or subtract durations +-CASE Scenario19 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}) + CREATE (:Duration2 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P12Y6MT32H2M20.000000001S'|'P-12Y-4M-28DT-24M-0.000000001S' + +# Should add or subtract durations +-CASE Scenario20 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}) + CREATE (:Duration2 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P2M-28DT31H38M20S'|'PT0S' + +# Should add or subtract durations +-CASE Scenario21 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}) + CREATE (:Duration2 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P13Y15DT49H47M23.500000003S'|'P-12Y-10M-43DT-18H-9M-3.500000003S' + +# Should add or subtract durations +-CASE Scenario22 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}) + CREATE (:Duration2 {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P25Y4M43DT50H11M23.500000004S'|'P6M15DT17H45M3.500000002S' + +# Should add or subtract durations +-CASE Scenario23 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}) + CREATE (:Duration2 {date: duration({months: 1, days: -14, hours: 16, minutes: -12, seconds: 70})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P13Y15DT49H47M23.500000003S'|'P12Y10M43DT18H9M3.500000003S' + +# Should add or subtract durations +-CASE Scenario24 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration1 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}) + CREATE (:Duration2 {date: duration({years: 12.5, months: 5.5, days: 14.5, hours: 16.5, minutes: 12.5, seconds: 70.5, nanoseconds: 3})}); +-STATEMENT MATCH (dur:Duration1), (dur2: Duration2) + RETURN dur.date + dur2.date AS sum, dur.date - dur2.date AS diff; +## Outcome: the result should be, in any order: +---- 1 +'P25Y10M58DT67H56M27.000000006S'|'PT0S' + +# Should multiply or divide durations by numbers +-CASE Scenario25 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (d:Duration) + RETURN d.date * 1 AS prod, d.date / 1 AS div; +## Outcome: the result should be, in any order: +---- 1 +'P12Y5M14DT16H13M10.000000001S'|'P12Y5M14DT16H13M10.000000001S' + +# Should multiply or divide durations by numbers +-CASE Scenario26 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (d:Duration) + RETURN d.date * 2 AS prod, d.date / 2 AS div; +## Outcome: the result should be, in any order: +---- 1 +'P24Y10M28DT32H26M20.000000002S'|'P6Y2M22DT13H21M8S' + +# Should multiply or divide durations by numbers +-CASE Scenario27 +## VERIFY +-STATEMENT CREATE NODE TABLE A(ID SERIAL, name STRING, PRIMARY KEY(ID)); +---- ok +-STATEMENT CREATE (:Duration {date: duration({years: 12, months: 5, days: 14, hours: 16, minutes: 12, seconds: 70, nanoseconds: 1})}); +-STATEMENT MATCH (d:Duration) + RETURN d.date * 0.5 AS prod, d.date / 0.5 AS div; +## Outcome: the result should be, in any order: +---- 1 +'P6Y2M22DT13H21M8S'|'P24Y10M28DT32H26M20.000000002S' \ No newline at end of file diff --git a/test/test_files/tck/expressions/temporal/temporal9.test b/test/test_files/tck/expressions/temporal/temporal9.test new file mode 100644 index 00000000000..fe4a87f53de --- /dev/null +++ b/test/test_files/tck/expressions/temporal/temporal9.test @@ -0,0 +1,480 @@ +-GROUP TCKTemporal9 +-DATASET CSV tck + +-- + +# Should truncate date +-CASE Scenario1 +-STATEMENT RETURN date.truncate('millennium', date({year: 2017, month: 10, day: 11}), {day: 2}) AS result; +## Outcome: the result should be, in any order: +---- 1 +'2000-01-02' +-STATEMENT RETURN date.truncate('millennium', date({year: 2017, month: 10, day: 11}), {}) AS result; +---- 1 +'2000-01-01' +-STATEMENT RETURN date.truncate('millennium', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'2000-01-02' +-STATEMENT RETURN date.truncate('millennium', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'2000-01-01' +-STATEMENT RETURN date.truncate('millennium', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'2000-01-02' +-STATEMENT RETURN date.truncate('millennium', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'2000-01-01' +-STATEMENT RETURN date.truncate('century', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1900-01-02' +-STATEMENT RETURN date.truncate('century', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1900-01-01' +-STATEMENT RETURN date.truncate('century', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1900-01-02' +-STATEMENT RETURN date.truncate('century', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1900-01-01' +-STATEMENT RETURN date.truncate('century', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1900-01-02' +-STATEMENT RETURN date.truncate('century', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1900-01-01' +-STATEMENT RETURN date.truncate('decade', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1980-01-02' +-STATEMENT RETURN date.truncate('decade', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1980-01-01' +-STATEMENT RETURN date.truncate('decade', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1980-01-02' +-STATEMENT RETURN date.truncate('decade', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1980-01-01' +-STATEMENT RETURN date.truncate('decade', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1980-01-02' +-STATEMENT RETURN date.truncate('decade', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1980-01-01' +-STATEMENT RETURN date.truncate('year', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1984-01-02' +-STATEMENT RETURN date.truncate('year', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-01-01' +-STATEMENT RETURN date.truncate('year', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-01-02' +-STATEMENT RETURN date.truncate('year', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-01-01' +-STATEMENT RETURN date.truncate('year', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-01-02' +-STATEMENT RETURN date.truncate('year', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-01-01' +-STATEMENT RETURN date.truncate('weekYear', date({year: 1984, month: 2, day: 1}), {day: 5}) AS result; +---- 1 +'1984-01-05' +-STATEMENT RETURN date.truncate('weekYear', date({year: 1984, month: 2, day: 1}), {}) AS result; +---- 1 +'1984-01-02' +-STATEMENT RETURN date.truncate('weekYear', datetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 5}) AS result; +---- 1 +'1983-01-05' +-STATEMENT RETURN date.truncate('weekYear', datetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1983-01-03' +-STATEMENT RETURN date.truncate('weekYear', localdatetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 5}) AS result; +---- 1 +'1983-01-05' +-STATEMENT RETURN date.truncate('weekYear', localdatetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1983-01-03' +-STATEMENT RETURN date.truncate('quarter', date({year: 1984, month: 11, day: 11}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('quarter', date({year: 1984, month: 11, day: 11}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('quarter', datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('quarter', datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('quarter', localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('quarter', localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('month', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('month', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('month', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('month', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('month', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-10-02' +-STATEMENT RETURN date.truncate('month', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-01' +-STATEMENT RETURN date.truncate('week', date({year: 1984, month: 10, day: 11}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09' +-STATEMENT RETURN date.truncate('week', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-08' +-STATEMENT RETURN date.truncate('week', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09' +-STATEMENT RETURN date.truncate('week', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-08' +-STATEMENT RETURN date.truncate('week', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09' +-STATEMENT RETURN date.truncate('week', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-08' +-STATEMENT RETURN date.truncate('day', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-11' +-STATEMENT RETURN date.truncate('day', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-11' +-STATEMENT RETURN date.truncate('day', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11' + + +# Should truncate datetime +-CASE Scenario2 +-STATEMENT RETURN datetime.truncate('millennium', date({year: 2017, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'2000-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('millennium', date({year: 2017, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('millennium', date({year: 2017, month: 10, day: 11}), {}) AS result; +---- 1 +'2000-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('millennium', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'2000-01-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('millennium', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'2000-01-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('millennium', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('millennium', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'2000-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('millennium', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('millennium', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'2000-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('century', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1900-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('century', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1900-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('century', date({year: 2017, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('century', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1900-01-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('century', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1900-01-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('century', datetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('century', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1900-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('century', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1900-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('century', localdatetime({year: 2017, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'2000-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('decade', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1980-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('decade', date({year: 1984, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1980-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('decade', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1980-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('decade', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1980-01-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('decade', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1980-01-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('decade', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1980-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('decade', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1980-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('decade', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1980-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('decade', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1980-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('year', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1984-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('year', date({year: 1984, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('year', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('year', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-01-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('year', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-01-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('year', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('year', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('year', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-01-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('year', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-01-01T00:00Z' +-STATEMENT RETURN datetime.truncate('weekYear', date({year: 1984, month: 2, day: 1}), {day: 5}) AS result; +---- 1 +'1984-01-05T00:00Z' +-STATEMENT RETURN datetime.truncate('weekYear', date({year: 1984, month: 2, day: 1}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-01-02T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('weekYear', date({year: 1984, month: 2, day: 1}), {}) AS result; +---- 1 +'1984-01-02T00:00Z' +-STATEMENT RETURN datetime.truncate('weekYear', datetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 5}) AS result; +---- 1 +'1983-01-05T00:00+01:00' +-STATEMENT RETURN datetime.truncate('weekYear', datetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1983-01-03T00:00+01:00' +-STATEMENT RETURN datetime.truncate('weekYear', datetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1983-01-03T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('weekYear', localdatetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 5}) AS result; +---- 1 +'1983-01-05T00:00Z' +-STATEMENT RETURN datetime.truncate('weekYear', localdatetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1983-01-03T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('weekYear', localdatetime({year: 1984, month: 1, day: 1, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1983-01-03T00:00Z' +-STATEMENT RETURN datetime.truncate('quarter', date({year: 1984, month: 11, day: 11}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00Z' +-STATEMENT RETURN datetime.truncate('quarter', date({year: 1984, month: 11, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('quarter', date({year: 1984, month: 11, day: 11}), {}) AS result; +---- 1 +'1984-10-01T00:00Z' +-STATEMENT RETURN datetime.truncate('quarter', datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('quarter', datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('quarter', datetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('quarter', localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00Z' +-STATEMENT RETURN datetime.truncate('quarter', localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('quarter', localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-01T00:00Z' +-STATEMENT RETURN datetime.truncate('month', date({year: 1984, month: 10, day: 11}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00Z' +-STATEMENT RETURN datetime.truncate('month', date({year: 1984, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('month', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-01T00:00Z' +-STATEMENT RETURN datetime.truncate('month', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00+01:00' +-STATEMENT RETURN datetime.truncate('month', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-01T00:00+01:00' +-STATEMENT RETURN datetime.truncate('month', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('month', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {day: 2}) AS result; +---- 1 +'1984-10-02T00:00Z' +-STATEMENT RETURN datetime.truncate('month', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-01T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('month', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-01T00:00Z' +-STATEMENT RETURN datetime.truncate('week', date({year: 1984, month: 10, day: 11}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09T00:00Z' +-STATEMENT RETURN datetime.truncate('week', date({year: 1984, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-08T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('week', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-08T00:00Z' +-STATEMENT RETURN datetime.truncate('week', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09T00:00+01:00' +-STATEMENT RETURN datetime.truncate('week', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-08T00:00+01:00' +-STATEMENT RETURN datetime.truncate('week', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-08T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('week', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {dayOfWeek: 2}) AS result; +---- 1 +'1984-10-09T00:00Z' +-STATEMENT RETURN datetime.truncate('week', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-08T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('week', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-08T00:00Z' +-STATEMENT RETURN datetime.truncate('day', date({year: 1984, month: 10, day: 11}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T00:00:00.000000002Z' +-STATEMENT RETURN datetime.truncate('day', date({year: 1984, month: 10, day: 11}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('day', date({year: 1984, month: 10, day: 11}), {}) AS result; +---- 1 +'1984-10-11T00:00Z' +-STATEMENT RETURN datetime.truncate('day', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T00:00:00.000000002+01:00' +-STATEMENT RETURN datetime.truncate('day', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-11T00:00+01:00' +-STATEMENT RETURN datetime.truncate('day', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('day', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T00:00:00.000000002Z' +-STATEMENT RETURN datetime.truncate('day', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T00:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('day', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T00:00Z' +-STATEMENT RETURN datetime.truncate('hour', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:00:00.000000002-01:00' +-STATEMENT RETURN datetime.truncate('hour', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('hour', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {}) AS result; +---- 1 +'1984-10-11T12:00-01:00' +-STATEMENT RETURN datetime.truncate('hour', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:00:00.000000002Z' +-STATEMENT RETURN datetime.truncate('hour', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T12:00+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('hour', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T12:00Z' +-STATEMENT RETURN datetime.truncate('minute', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:00.000000002-01:00' +-STATEMENT RETURN datetime.truncate('minute', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T12:31+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('minute', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}), {}) AS result; +---- 1 +'1984-10-11T12:31-01:00' +-STATEMENT RETURN datetime.truncate('minute', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:00.000000002Z' +-STATEMENT RETURN datetime.truncate('minute', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {timezone: 'Europe/Stockholm'}) AS result; +---- 1 +'1984-10-11T12:31+01:00[Europe/Stockholm]' +-STATEMENT RETURN datetime.truncate('minute', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T12:31Z' +-STATEMENT RETURN datetime.truncate('second', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.000000002+01:00' +-STATEMENT RETURN datetime.truncate('second', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-11T12:31:14+01:00' +-STATEMENT RETURN datetime.truncate('second', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.000000002Z' +-STATEMENT RETURN datetime.truncate('second', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T12:31:14Z' +-STATEMENT RETURN datetime.truncate('millisecond', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.645000002+01:00' +-STATEMENT RETURN datetime.truncate('millisecond', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-11T12:31:14.645+01:00' +-STATEMENT RETURN datetime.truncate('millisecond', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.645000002Z' +-STATEMENT RETURN datetime.truncate('millisecond', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T12:31:14.645Z' +-STATEMENT RETURN datetime.truncate('microsecond', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.645876002+01:00' +-STATEMENT RETURN datetime.truncate('microsecond', datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '+01:00'}), {}) AS result; +---- 1 +'1984-10-11T12:31:14.645876+01:00' +-STATEMENT RETURN datetime.truncate('microsecond', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {nanosecond: 2}) AS result; +---- 1 +'1984-10-11T12:31:14.645876002Z' +-STATEMENT RETURN datetime.truncate('microsecond', localdatetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123}), {}) AS result; +---- 1 +'1984-10-11T12:31:14.645876Z'