From 60a1d303adf739f9d2b0aacaf9b3c51003c2909a Mon Sep 17 00:00:00 2001 From: kevinyhzou Date: Fri, 28 Jun 2024 10:00:21 +0800 Subject: [PATCH] Fix json ignore key case --- .../src/test/resources/text-data/json-settings/data.txt | 1 + cpp-ch/local-engine/Common/CHUtil.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/backends-clickhouse/src/test/resources/text-data/json-settings/data.txt b/backends-clickhouse/src/test/resources/text-data/json-settings/data.txt index 0541ce3469a7..230b46ec3803 100644 --- a/backends-clickhouse/src/test/resources/text-data/json-settings/data.txt +++ b/backends-clickhouse/src/test/resources/text-data/json-settings/data.txt @@ -1,4 +1,5 @@ {"a":1,"b":2,"c":3} +{"a":"a5", "B":"b6", "c":7} {"a":"4"} {"t":{"ta":"cc","tb":100,"tc":1.234}} {"t":{"ta":"cc","tb":100,"td":"ignore"}} diff --git a/cpp-ch/local-engine/Common/CHUtil.cpp b/cpp-ch/local-engine/Common/CHUtil.cpp index a4634c3f3bc7..6d75e2f1fe44 100644 --- a/cpp-ch/local-engine/Common/CHUtil.cpp +++ b/cpp-ch/local-engine/Common/CHUtil.cpp @@ -676,6 +676,7 @@ void BackendInitializerUtil::initSettings(std::map & b settings.set("input_format_parquet_import_nested", true); settings.set("input_format_json_read_numbers_as_strings", true); settings.set("input_format_json_read_bools_as_numbers", false); + settings.set("input_format_json_ignore_key_case", true); settings.set("input_format_csv_trim_whitespaces", false); settings.set("input_format_csv_allow_cr_end_of_line", true); settings.set("output_format_orc_string_as_string", true);