From 0e77575a76a425cbf04c84203731fa1d9bfbf011 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 22 May 2017 23:13:17 +0300 Subject: [PATCH] JSONEachRow: allow to parse true and false as 1 and 0 for UInt8, Int8 data types [#CLICKHOUSE-3] --- .../0_stateless/00462_json_true_false_literals.reference | 4 ++++ .../queries/0_stateless/00462_json_true_false_literals.sql | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00462_json_true_false_literals.reference create mode 100644 dbms/tests/queries/0_stateless/00462_json_true_false_literals.sql diff --git a/dbms/tests/queries/0_stateless/00462_json_true_false_literals.reference b/dbms/tests/queries/0_stateless/00462_json_true_false_literals.reference new file mode 100644 index 00000000000..77d2a070c6d --- /dev/null +++ b/dbms/tests/queries/0_stateless/00462_json_true_false_literals.reference @@ -0,0 +1,4 @@ +0 0 +1 1 +0 false +1 true diff --git a/dbms/tests/queries/0_stateless/00462_json_true_false_literals.sql b/dbms/tests/queries/0_stateless/00462_json_true_false_literals.sql new file mode 100644 index 00000000000..1906ac6ebff --- /dev/null +++ b/dbms/tests/queries/0_stateless/00462_json_true_false_literals.sql @@ -0,0 +1,6 @@ +DROP TABLE IF EXISTS test.json; +CREATE TABLE test.json (x UInt8, title String) ENGINE = Memory; +INSERT INTO test.json FORMAT JSONEachRow {"x": true, "title": "true"}, {"x": false, "title": "false"}, {"x": 0, "title": "0"}, {"x": 1, "title": "1"} + +SELECT * FROM test.json ORDER BY title; +DROP TABLE IF EXISTS test.json;