From 95df08dee2eaeb27723b26825bac2b91ed721636 Mon Sep 17 00:00:00 2001 From: Anton Popov Date: Wed, 25 Oct 2023 23:55:39 +0000 Subject: [PATCH] fix test --- ...4_json_merge_patch_function_test.reference | 20 +++++++++---------- .../02874_json_merge_patch_function_test.sql | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/queries/0_stateless/02874_json_merge_patch_function_test.reference b/tests/queries/0_stateless/02874_json_merge_patch_function_test.reference index 29283d0f232..d7de5819d77 100644 --- a/tests/queries/0_stateless/02874_json_merge_patch_function_test.reference +++ b/tests/queries/0_stateless/02874_json_merge_patch_function_test.reference @@ -8,13 +8,13 @@ {"a":{"b":[3,4],"c":2}} {"a":5,"b":2,"c":4,"d":6} {"a":1,"b":null} -{"k0":"0","k1":"1"} -{"k2":"2","k3":"3"} -{"k4":"4","k5":"5"} -{"k6":"6","k7":"7"} -{"k8":"8","k9":"9"} -{"k10":"222","k11":"11"} -{"k12":"222","k13":"13"} -{"k14":"222","k15":"15"} -{"k16":"222","k17":"17"} -{"k18":"222","k19":"19"} +{"k0":0,"k1":1} +{"k2":2,"k3":3} +{"k4":4,"k5":5} +{"k6":6,"k7":7} +{"k8":8,"k9":9} +{"k10":222,"k11":11} +{"k12":222,"k13":13} +{"k14":222,"k15":15} +{"k16":222,"k17":17} +{"k18":222,"k19":19} diff --git a/tests/queries/0_stateless/02874_json_merge_patch_function_test.sql b/tests/queries/0_stateless/02874_json_merge_patch_function_test.sql index 4f4b2e20f30..9f0c3fd48cd 100644 --- a/tests/queries/0_stateless/02874_json_merge_patch_function_test.sql +++ b/tests/queries/0_stateless/02874_json_merge_patch_function_test.sql @@ -14,11 +14,11 @@ select jsonMergePatch('[1]'); -- { serverError BAD_ARGUMENTS } select jsonMergePatch('{"a": "1","b": 2,"c": [true,"qrdzkzjvnos": true,"yxqhipj": false,"oesax": "33o8_6AyUy"}]}', '{"c": "1"}'); -- { serverError BAD_ARGUMENTS } drop table if exists t_json_merge; -create table t_json_merge (s1 String, s2 String) engine = Memory; +create table t_json_merge (id UInt64, s1 String, s2 String) engine = Memory; -insert into t_json_merge select toJSONString(map('k' || toString(number * 2), number * 2)), toJSONString(map('k' || toString(number * 2 + 1), number * 2 + 1)) from numbers(5); -insert into t_json_merge select toJSONString(map('k' || toString(number * 2), number * 2)), toJSONString(map('k' || toString(number * 2 + 1), number * 2 + 1, 'k' || toString(number * 2), 222)) from numbers(5, 5); +insert into t_json_merge select number, format('{{ "k{0}": {0} }}', toString(number * 2)), format('{{ "k{0}": {0} }}', toString(number * 2 + 1)) from numbers(5); +insert into t_json_merge select number, format('{{ "k{0}": {0} }}', toString(number * 2)), format('{{ "k{0}": {0}, "k{1}": 222 }}', toString(number * 2 + 1), toString(number * 2)) from numbers(5, 5); -select jsonMergePatch(s1, s2) from t_json_merge; +select jsonMergePatch(s1, s2) from t_json_merge ORDER BY id; drop table t_json_merge;