From 3f47c9dc17994f80141593f2608649815902b3b5 Mon Sep 17 00:00:00 2001 From: vdimir Date: Mon, 16 Dec 2024 08:25:33 +0000 Subject: [PATCH] Documentation for composed_data_type_output_format_mode --- src/Core/FormatFactorySettings.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Core/FormatFactorySettings.h b/src/Core/FormatFactorySettings.h index 45f8d9bb9b6..68830ef2592 100644 --- a/src/Core/FormatFactorySettings.h +++ b/src/Core/FormatFactorySettings.h @@ -1244,7 +1244,34 @@ Set the quoting rule for identifiers in SHOW CREATE query Set the quoting style for identifiers in SHOW CREATE query )", 0) \ DECLARE(String, composed_data_type_output_format_mode, "default", R"( -Set composed data type output format mode, default or spark. +Set output format mode for composed data types like Array, Map, Tuple. Possible values: 'default', 'spark'. + +In 'default' mode, the output format is the same as in the previous versions of ClickHouse, + - Arrays are displayed without spaces between elements. + - Maps use curly braces `{}` and colons `:` to separate keys and values. + - Tuples are displayed with single quotes around string elements. + +Example of 'default' mode: + +``` +┌─[1, 2, 3]─┬─map('a', 1, 'b', 2)─┬─(123, 'abc')─┐ +│ [1,2,3] │ {'a':1,'b':2} │ (123,'abc') │ +└───────────┴─────────────────────┴──────────────┘ +``` + +In 'spark' mode, the output format is similar to Apache Spark: + - Arrays are displayed with spaces between elements. + - Maps use curly braces `{}` and arrows `->` to separate keys and values. + - Tuples are displayed without single quotes around string elements. + +Example of 'spark' mode: + +``` +┌─[1, 2, 3]─┬─map('a', 1, 'b', 2)─┬─(123, 'abc')─┐ +│ [1, 2, 3] │ {a -> 1, b -> 2} │ (123, abc) │ +└───────────┴─────────────────────┴──────────────┘ +``` + )", 0) \ // End of FORMAT_FACTORY_SETTINGS