From 523f33d57d4f3fb3638a63a2fb42c146bf6c41d7 Mon Sep 17 00:00:00 2001 From: Memo Date: Fri, 22 Apr 2022 18:59:55 +0800 Subject: [PATCH 01/34] add bin tests --- ...02285_hex_bin_support_more_types.reference | 30 +++++++++++++++++++ ...l => 02285_hex_bin_support_more_types.sql} | 30 +++++++++++++++++++ .../02285_hex_support_more_types.reference | 15 ---------- 3 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 tests/queries/0_stateless/02285_hex_bin_support_more_types.reference rename tests/queries/0_stateless/{02285_hex_support_more_types.sql => 02285_hex_bin_support_more_types.sql} (50%) delete mode 100644 tests/queries/0_stateless/02285_hex_support_more_types.reference diff --git a/tests/queries/0_stateless/02285_hex_bin_support_more_types.reference b/tests/queries/0_stateless/02285_hex_bin_support_more_types.reference new file mode 100644 index 00000000000..53d97c3b7b2 --- /dev/null +++ b/tests/queries/0_stateless/02285_hex_bin_support_more_types.reference @@ -0,0 +1,30 @@ +174876E800 +174876E800 +64 +9C +64 +FF9C +64 +FFFFFF9C +64 +FFFFFFFFFFFFFF9C +174876E800 +174876E800 +174876E800 +FFFFFFFFFFFFFFFFFFFFFFE8B7891800 +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8B7891800 +0001011101001000011101101110100000000000 +0001011101001000011101101110100000000000 +01100100 +10011100 +01100100 +1111111110011100 +01100100 +11111111111111111111111110011100 +01100100 +1111111111111111111111111111111111111111111111111111111110011100 +0001011101001000011101101110100000000000 +0001011101001000011101101110100000000000 +0001011101001000011101101110100000000000 +11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110100010110111100010010001100000000000 +1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110100010110111100010010001100000000000 diff --git a/tests/queries/0_stateless/02285_hex_support_more_types.sql b/tests/queries/0_stateless/02285_hex_bin_support_more_types.sql similarity index 50% rename from tests/queries/0_stateless/02285_hex_support_more_types.sql rename to tests/queries/0_stateless/02285_hex_bin_support_more_types.sql index f07009c11cd..0efbd8dd34e 100644 --- a/tests/queries/0_stateless/02285_hex_support_more_types.sql +++ b/tests/queries/0_stateless/02285_hex_bin_support_more_types.sql @@ -28,3 +28,33 @@ SELECT hex(toInt128(-100000000000)) AS res; SELECT hex(toInt256(-100000000000)) AS res; +SELECT bin(toUInt128(100000000000)) AS res; + +SELECT bin(toUInt256(100000000000)) AS res; + +SELECT bin(toInt8(100)) AS res; + +SELECT bin(toInt8(-100)) AS res; + +SELECT bin(toInt16(100)) AS res; + +SELECT bin(toInt16(-100)) AS res; + +SELECT bin(toInt32(100)) AS res; + +SELECT bin(toInt32(-100)) AS res; + +SELECT bin(toInt64(100)) AS res; + +SELECT bin(toInt64(-100)) AS res; + +SELECT bin(toInt128(100000000000)) AS res; + +SELECT bin(toInt128(100000000000)) AS res; + +SELECT bin(toInt256(100000000000)) AS res; + +SELECT bin(toInt128(-100000000000)) AS res; + +SELECT bin(toInt256(-100000000000)) AS res; + diff --git a/tests/queries/0_stateless/02285_hex_support_more_types.reference b/tests/queries/0_stateless/02285_hex_support_more_types.reference deleted file mode 100644 index b016b9e3dec..00000000000 --- a/tests/queries/0_stateless/02285_hex_support_more_types.reference +++ /dev/null @@ -1,15 +0,0 @@ -174876E800 -174876E800 -64 -9C -64 -FF9C -64 -FFFFFF9C -64 -FFFFFFFFFFFFFF9C -174876E800 -174876E800 -174876E800 -FFFFFFFFFFFFFFFFFFFFFFE8B7891800 -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8B7891800 From 39fa397e9f518f4e67a35bf037c8d82b61c33a60 Mon Sep 17 00:00:00 2001 From: Anton Popov Date: Fri, 22 Apr 2022 12:07:23 +0000 Subject: [PATCH 02/34] allow names of tuple elements starting from digits --- src/DataTypes/DataTypeTuple.cpp | 3 -- .../02286_tuple_numeric_identifier.reference | 10 +++++ .../02286_tuple_numeric_identifier.sql | 43 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 tests/queries/0_stateless/02286_tuple_numeric_identifier.reference create mode 100644 tests/queries/0_stateless/02286_tuple_numeric_identifier.sql diff --git a/src/DataTypes/DataTypeTuple.cpp b/src/DataTypes/DataTypeTuple.cpp index 908e0184b8d..558b13927c1 100644 --- a/src/DataTypes/DataTypeTuple.cpp +++ b/src/DataTypes/DataTypeTuple.cpp @@ -54,9 +54,6 @@ static std::optional checkTupleNames(const Strings & names) if (name.empty()) return Exception("Names of tuple elements cannot be empty", ErrorCodes::BAD_ARGUMENTS); - if (isNumericASCII(name[0])) - return Exception("Explicitly specified names of tuple elements cannot start with digit", ErrorCodes::BAD_ARGUMENTS); - if (!names_set.insert(name).second) return Exception("Names of tuple elements must be unique", ErrorCodes::DUPLICATE_COLUMN); } diff --git a/tests/queries/0_stateless/02286_tuple_numeric_identifier.reference b/tests/queries/0_stateless/02286_tuple_numeric_identifier.reference new file mode 100644 index 00000000000..5f330409b2a --- /dev/null +++ b/tests/queries/0_stateless/02286_tuple_numeric_identifier.reference @@ -0,0 +1,10 @@ +CREATE TABLE default.t_tuple_numeric\n(\n `t` Tuple(`1` Tuple(`2` Int32, `3` Int32), `4` Int32)\n)\nENGINE = Memory +{"t":{"1":{"2":2,"3":3},"4":4}} +2 3 4 +2 3 4 +2 3 4 +2 3 4 +Tuple(`1` Tuple(`2` Int8, `3` Int8), `4` Int8) +{"t":{"1":{"2":2,"3":3},"4":4}} +2 3 4 +(('value')) diff --git a/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql b/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql new file mode 100644 index 00000000000..67fae224e64 --- /dev/null +++ b/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS t_tuple_numeric; + +CREATE TABLE t_tuple_numeric (t Tuple(`1` Tuple(`2` Int, `3` Int), `4` Int)) ENGINE = Memory; +SHOW CREATE TABLE t_tuple_numeric; + +INSERT INTO t_tuple_numeric VALUES (((2, 3), 4)); + +SET output_format_json_named_tuples_as_objects = 1; + +SELECT * FROM t_tuple_numeric FORMAT JSONEachRow; +SELECT `t`.`1`.`2`, `t`.`1`.`3`, `t`.`4` FROM t_tuple_numeric; +SELECT t.1.1, t.1.2, t.2 FROM t_tuple_numeric; + +SELECT t.1.3 FROM t_tuple_numeric; -- {serverError ILLEGAL_INDEX} +SELECT t.4 FROM t_tuple_numeric; -- {serverError ILLEGAL_INDEX} +SELECT `t`.`1`.`1`, `t`.`1`.`2`, `t`.`2` FROM t_tuple_numeric; -- {serverError UNKNOWN_IDENTIFIER} + +DROP TABLE t_tuple_numeric; + +CREATE TABLE t_tuple_numeric (t Tuple(Tuple(Int, Int), Int)) ENGINE = Memory; + +INSERT INTO t_tuple_numeric VALUES (((2, 3), 4)); + +SELECT t.1.1, t.1.2, t.2 FROM t_tuple_numeric; +SELECT `t`.`1`.`1`, `t`.`1`.`2`, `t`.`2` FROM t_tuple_numeric; + +DROP TABLE t_tuple_numeric; + +SET allow_experimental_object_type = 1; +CREATE TABLE t_tuple_numeric (t JSON) ENGINE = Memory; +INSERT INTO t_tuple_numeric FORMAT JSONEachRow {"t":{"1":{"2":2,"3":3},"4":4}} + +SELECT toTypeName(t) FROM t_tuple_numeric LIMIT 1; + +SELECT * FROM t_tuple_numeric FORMAT JSONEachRow; +SELECT `t`.`1`.`2`, `t`.`1`.`3`, `t`.`4` FROM t_tuple_numeric; + +DROP TABLE t_tuple_numeric; + +WITH + '{"1":{"key":"value"}}' AS data, + JSONExtract(data, 'Tuple("1" Tuple(key String))') AS parsed_json +SELECT parsed_json AS ssid From 50879555efd1b2f343af4bb9001b8a0976ccbb62 Mon Sep 17 00:00:00 2001 From: Anton Popov Date: Fri, 22 Apr 2022 18:29:57 +0200 Subject: [PATCH 03/34] Update 02286_tuple_numeric_identifier.sql --- tests/queries/0_stateless/02286_tuple_numeric_identifier.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql b/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql index 67fae224e64..b5b0508deaa 100644 --- a/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql +++ b/tests/queries/0_stateless/02286_tuple_numeric_identifier.sql @@ -1,3 +1,5 @@ +-- Tags: no-fasttest + DROP TABLE IF EXISTS t_tuple_numeric; CREATE TABLE t_tuple_numeric (t Tuple(`1` Tuple(`2` Int, `3` Int), `4` Int)) ENGINE = Memory; From c02de61086c8d54a9062927702d67798c35483b4 Mon Sep 17 00:00:00 2001 From: zombee0 Date: Wed, 20 Apr 2022 20:00:07 +0800 Subject: [PATCH 04/34] fixed the cow_compositions.cpp clone inner column when there is no need Signed-off-by: zombee0 --- src/Common/examples/cow_compositions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/examples/cow_compositions.cpp b/src/Common/examples/cow_compositions.cpp index f013e751063..05d6fe1d89e 100644 --- a/src/Common/examples/cow_compositions.cpp +++ b/src/Common/examples/cow_compositions.cpp @@ -52,7 +52,7 @@ private: { std::cerr << "Mutating\n"; auto res = shallowMutate(); - res->wrapped = IColumn::mutate(wrapped); + res->wrapped = IColumn::mutate(std::move(res->wrapped).detach()); return res; } From 2b3340861bf757e3d824d2df25ddabba768c4a92 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Sat, 23 Apr 2022 19:53:25 +0200 Subject: [PATCH 05/34] Remove support for ancient CMake The first line in CMakeLists.txt says the minimum CMake version is 3.14. Therefore removing special code for earlier CMake versions. --- CMakeLists.txt | 20 +++----------------- cmake/analysis.cmake | 4 ---- cmake/tools.cmake | 2 +- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8b6e9217d2..57b5b7c2ef8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,23 +328,9 @@ if (ENABLE_BUILD_PROFILING) endif () endif () -if (${CMAKE_VERSION} VERSION_LESS "3.12.4") - # CMake < 3.12 doesn't support setting 20 as a C++ standard version. - # We will add C++ standard controlling flag in CMAKE_CXX_FLAGS manually for now. - - if (COMPILER_GCC OR COMPILER_CLANG) - # to make numeric_limits<__int128> works with GCC - set (_CXX_STANDARD "gnu++2a") - else () - set (_CXX_STANDARD "c++2a") - endif () - - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${_CXX_STANDARD}") -else () - set (CMAKE_CXX_STANDARD 20) - set (CMAKE_CXX_EXTENSIONS ON) # Same as gnu++2a (ON) vs c++2a (OFF): https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html - set (CMAKE_CXX_STANDARD_REQUIRED ON) -endif () +set (CMAKE_CXX_STANDARD 20) +set (CMAKE_CXX_EXTENSIONS ON) # Same as gnu++2a (ON) vs c++2a (OFF): https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html +set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_C_STANDARD 11) set (CMAKE_C_EXTENSIONS ON) diff --git a/cmake/analysis.cmake b/cmake/analysis.cmake index d1b9c86f15f..b04cabdfa32 100644 --- a/cmake/analysis.cmake +++ b/cmake/analysis.cmake @@ -2,10 +2,6 @@ option (ENABLE_CLANG_TIDY "Use clang-tidy static analyzer" OFF) if (ENABLE_CLANG_TIDY) - if (${CMAKE_VERSION} VERSION_LESS "3.6.0") - message(FATAL_ERROR "clang-tidy requires CMake version at least 3.6.") - endif() - find_program (CLANG_TIDY_PATH NAMES "clang-tidy" "clang-tidy-13" "clang-tidy-12" "clang-tidy-11" "clang-tidy-10" "clang-tidy-9" "clang-tidy-8") if (CLANG_TIDY_PATH) diff --git a/cmake/tools.cmake b/cmake/tools.cmake index d571a46ad26..350bc488837 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -13,7 +13,7 @@ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version) if (COMPILER_GCC) # Require minimum version of gcc set (GCC_MINIMUM_VERSION 11) - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GCC_MINIMUM_VERSION} AND NOT CMAKE_VERSION VERSION_LESS 2.8.9) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GCC_MINIMUM_VERSION}) message (FATAL_ERROR "GCC version must be at least ${GCC_MINIMUM_VERSION}. For example, if GCC ${GCC_MINIMUM_VERSION} is available under gcc-${GCC_MINIMUM_VERSION}, g++-${GCC_MINIMUM_VERSION} names, do the following: export CC=gcc-${GCC_MINIMUM_VERSION} CXX=g++-${GCC_MINIMUM_VERSION}; rm -rf CMakeCache.txt CMakeFiles; and re run cmake or ./release.") endif () From 017fde41363780f2468cadbdb723abe6e86694da Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Sat, 23 Apr 2022 21:54:07 +0200 Subject: [PATCH 06/34] Update required CMake version in build.md --- docs/en/development/build.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/development/build.md b/docs/en/development/build.md index b128412a55e..f783a2ec62e 100644 --- a/docs/en/development/build.md +++ b/docs/en/development/build.md @@ -75,7 +75,7 @@ This will create the `programs/clickhouse` executable, which can be used with `c The build requires the following components: - Git (is used only to checkout the sources, it’s not needed for the build) -- CMake 3.10 or newer +- CMake 3.14 or newer - Ninja - C++ compiler: clang-13 or newer - Linker: lld From 62aba875f54a3bbac241a3eda8b3c07b8d0f09c2 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 25 Apr 2022 12:02:28 +0200 Subject: [PATCH 07/34] Make arch detection more robust - Properly handle the case that we are on an unsupported but unlisted arch, e.g. mips. Before, we would simply continue configuration/compilation with no architecture set. - CMake variable "ARCH_ARM" could in theory be replaced by "ARCH_AARCH64". This would need refactoring in dependent CMakeLists, therefore not doing it now. --- cmake/arch.cmake | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/cmake/arch.cmake b/cmake/arch.cmake index 82c0d40994c..0b8880db81e 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -1,22 +1,15 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") + if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "i386") + message (FATAL_ERROR "32bit platforms are not supported") + endif () set (ARCH_AMD64 1) -endif () -if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") set (ARCH_AARCH64 1) -endif () -if (ARCH_AARCH64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm") set (ARCH_ARM 1) -endif () -if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "i386") - set (ARCH_I386 1) -endif () -if ((ARCH_ARM AND NOT ARCH_AARCH64) OR ARCH_I386) - message (FATAL_ERROR "32bit platforms are not supported") -endif () -if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64le.*|PPC64LE.*)") +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64le.*|PPC64LE.*)") set (ARCH_PPC64LE 1) -endif () -if (CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") set (ARCH_RISCV64 1) +else () + message (FATAL_ERROR "Platform ${CMAKE_SYSTEM_PROCESSOR} is not supported") endif () - From 3c43914f9a6877f5c2495392a471849494bab0e4 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 24 Apr 2022 22:07:27 +0300 Subject: [PATCH 08/34] tests: simplify 01834_alias_columns_laziness_filimonov Signed-off-by: Azat Khuzhin --- ...alias_columns_laziness_filimonov.reference | 3 ++- .../01834_alias_columns_laziness_filimonov.sh | 24 +++++++------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.reference b/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.reference index 7326d960397..5290ffc5dbe 100644 --- a/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.reference +++ b/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.reference @@ -1 +1,2 @@ -Ok +SleepFunctionCalls: 4 (increment) +SleepFunctionMicroseconds: 400000 (increment) diff --git a/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh b/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh index 1d70ba1df7c..26fcfd38c48 100755 --- a/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh +++ b/tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh @@ -7,22 +7,16 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ${CLICKHOUSE_CLIENT} --multiquery --query " drop table if exists aliases_lazyness; create table aliases_lazyness (x UInt32, y ALIAS sleepEachRow(0.1)) Engine=MergeTree ORDER BY x; -insert into aliases_lazyness(x) select * from numbers(40); +insert into aliases_lazyness(x) select * from numbers(100); " # In very old ClickHouse versions alias column was calculated for every row. -# If it works this way, the query will take at least 0.1 * 40 = 4 seconds. -# If the issue does not exist, the query should take slightly more than 0.1 seconds. -# The exact time is not guaranteed, so we check in a loop that at least once -# the query will process in less than one second, that proves that the behaviour is not like it was long time ago. +# If it works this way, the query will take at least 0.1 * 100 = 10 seconds. +# If the issue does not exist, the query should call sleepEachRow() "only" 4 times: +# - from MergeTreeData::getQueryProcessingStageWithAggregateProjection() -> MergeTreeWhereOptimizer -> getBlockWithConstants() +# - from MergeTreeWhereOptimizer -> getBlockWithConstants() +# - ReadFromMergeTree::selectRangesToRead() -> getBlockWithConstants() +# - Pipeline +${CLICKHOUSE_CLIENT} --profile-events-delay-ms=-1 --print-profile-events --query "SELECT x, y FROM aliases_lazyness WHERE x = 1 FORMAT Null" |& grep -o -e "SleepFunctionMicroseconds.*" -e "SleepFunctionCalls.*" -i=0 retries=300 -while [[ $i -lt $retries ]]; do - timeout 1 ${CLICKHOUSE_CLIENT} --query "SELECT x, y FROM aliases_lazyness WHERE x = 1 FORMAT Null" && break - ((++i)) -done - -${CLICKHOUSE_CLIENT} --multiquery --query " -drop table aliases_lazyness; -SELECT 'Ok'; -" +${CLICKHOUSE_CLIENT} --query "drop table aliases_lazyness" From d28b1559e6de85ea208db2f705b6027daa45105d Mon Sep 17 00:00:00 2001 From: Anton Popov Date: Mon, 25 Apr 2022 16:44:24 +0000 Subject: [PATCH 09/34] fix merges of wide parts with type Object --- .../MergeTree/MergeTreeBlockReadUtils.cpp | 9 +++---- ...01825_type_json_wide_parts_merge.reference | 3 +++ .../01825_type_json_wide_parts_merge.sql | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 tests/queries/0_stateless/01825_type_json_wide_parts_merge.reference create mode 100644 tests/queries/0_stateless/01825_type_json_wide_parts_merge.sql diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp index e300ceeb4fc..dac304fcdff 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp @@ -44,12 +44,11 @@ bool injectRequiredColumnsRecursively( if (alter_conversions.isColumnRenamed(column_name_in_part)) column_name_in_part = alter_conversions.getColumnOldName(column_name_in_part); - auto column_in_part = NameAndTypePair( - column_name_in_part, column_in_storage->getSubcolumnName(), - column_in_storage->getTypeInStorage(), column_in_storage->type); + auto column_in_part = part->getColumns().tryGetByName(column_name_in_part); - /// column has files and hence does not require evaluation - if (part->hasColumnFiles(column_in_part)) + if (column_in_part + && (!column_in_storage->isSubcolumn() + || column_in_part->type->tryGetSubcolumnType(column_in_storage->getSubcolumnName()))) { /// ensure each column is added only once if (!required_columns.contains(column_name)) diff --git a/tests/queries/0_stateless/01825_type_json_wide_parts_merge.reference b/tests/queries/0_stateless/01825_type_json_wide_parts_merge.reference new file mode 100644 index 00000000000..b41a6da16f5 --- /dev/null +++ b/tests/queries/0_stateless/01825_type_json_wide_parts_merge.reference @@ -0,0 +1,3 @@ +{"data":{"k1":0,"k2":2}} +{"data":{"k1":1,"k2":0}} +Tuple(k1 Int8, k2 Int8) diff --git a/tests/queries/0_stateless/01825_type_json_wide_parts_merge.sql b/tests/queries/0_stateless/01825_type_json_wide_parts_merge.sql new file mode 100644 index 00000000000..fd023e473a4 --- /dev/null +++ b/tests/queries/0_stateless/01825_type_json_wide_parts_merge.sql @@ -0,0 +1,25 @@ +-- Tags: no-fasttest + +SET allow_experimental_object_type = 1; +SET output_format_json_named_tuples_as_objects = 1; + +DROP TABLE IF EXISTS t_json_wide_parts; + +CREATE TABLE t_json_wide_parts (data JSON) +ENGINE MergeTree ORDER BY tuple() +SETTINGS min_bytes_for_wide_part = 0; + +SYSTEM STOP MERGES t_json_wide_parts; + +INSERT INTO t_json_wide_parts VALUES ('{"k1": 1}'); +INSERT INTO t_json_wide_parts VALUES ('{"k2": 2}'); + +SYSTEM START MERGES t_json_wide_parts; +OPTIMIZE TABLE t_json_wide_parts FINAL; + +SELECT data FROM t_json_wide_parts ORDER BY data.k1 FORMAT JSONEachRow; + +SELECT type FROM system.parts_columns +WHERE table = 't_json_wide_parts' AND database = currentDatabase() AND active; + +DROP TABLE t_json_wide_parts; From a76a35d3ce142928ec1afa40698d988dd229823c Mon Sep 17 00:00:00 2001 From: kssenii Date: Mon, 25 Apr 2022 18:49:00 +0200 Subject: [PATCH 10/34] Better drop cache --- src/Common/FileCache.cpp | 5 +-- src/Common/FileCache.h | 4 +-- src/Common/FileSegment.cpp | 4 +-- src/Interpreters/InterpreterSystemQuery.cpp | 4 +-- src/Parsers/ASTSystemQuery.h | 3 ++ src/Parsers/ParserSystemQuery.cpp | 10 ++++++ tests/config/config.d/storage_conf.xml | 18 ++++++++++ .../02286_drop_filesystem_cache.reference | 30 ++++++++++++++++ .../02286_drop_filesystem_cache.sql | 34 +++++++++++++++++++ 9 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 tests/queries/0_stateless/02286_drop_filesystem_cache.reference create mode 100644 tests/queries/0_stateless/02286_drop_filesystem_cache.sql diff --git a/src/Common/FileCache.cpp b/src/Common/FileCache.cpp index 2f9eec33022..e8d6c52d948 100644 --- a/src/Common/FileCache.cpp +++ b/src/Common/FileCache.cpp @@ -555,7 +555,7 @@ void LRUFileCache::remove(const Key & key) fs::remove(key_path); } -void LRUFileCache::tryRemoveAll() +void LRUFileCache::remove(bool force_remove_unreleasable) { /// Try remove all cached files by cache_base_path. /// Only releasable file segments are evicted. @@ -567,12 +567,13 @@ void LRUFileCache::tryRemoveAll() auto & [key, offset] = *it++; auto * cell = getCell(key, offset, cache_lock); - if (cell->releasable()) + if (cell->releasable() || force_remove_unreleasable) { auto file_segment = cell->file_segment; if (file_segment) { std::lock_guard segment_lock(file_segment->mutex); + file_segment->detached = true; remove(file_segment->key(), file_segment->offset(), cache_lock, segment_lock); } } diff --git a/src/Common/FileCache.h b/src/Common/FileCache.h index 983156959de..d18bdc74acf 100644 --- a/src/Common/FileCache.h +++ b/src/Common/FileCache.h @@ -42,7 +42,7 @@ public: virtual void remove(const Key & key) = 0; - virtual void tryRemoveAll() = 0; + virtual void remove(bool force_remove_unreleasable) = 0; static bool isReadOnly(); @@ -145,7 +145,7 @@ public: void remove(const Key & key) override; - void tryRemoveAll() override; + void remove(bool force_remove_unreleasable) override; std::vector tryGetCachePaths(const Key & key) override; diff --git a/src/Common/FileSegment.cpp b/src/Common/FileSegment.cpp index e94a54ec3f7..4de8b043903 100644 --- a/src/Common/FileSegment.cpp +++ b/src/Common/FileSegment.cpp @@ -452,6 +452,8 @@ void FileSegment::completeBatchAndResetDownloader() void FileSegment::complete(State state) { + assertNotDetached(); + std::lock_guard cache_lock(cache->mutex); std::lock_guard segment_lock(mutex); @@ -477,8 +479,6 @@ void FileSegment::complete(State state) download_state = state; - assertNotDetached(); - try { completeImpl(cache_lock, segment_lock); diff --git a/src/Interpreters/InterpreterSystemQuery.cpp b/src/Interpreters/InterpreterSystemQuery.cpp index 28a2082d233..289aba2a695 100644 --- a/src/Interpreters/InterpreterSystemQuery.cpp +++ b/src/Interpreters/InterpreterSystemQuery.cpp @@ -306,12 +306,12 @@ BlockIO InterpreterSystemQuery::execute() { auto caches = FileCacheFactory::instance().getAll(); for (const auto & [_, cache_data] : caches) - cache_data.cache->tryRemoveAll(); + cache_data.cache->remove(query.force_removal); } else { auto cache = FileCacheFactory::instance().get(query.filesystem_cache_path); - cache->tryRemoveAll(); + cache->remove(query.force_removal); } break; } diff --git a/src/Parsers/ASTSystemQuery.h b/src/Parsers/ASTSystemQuery.h index 600525f9abe..a5a2c724135 100644 --- a/src/Parsers/ASTSystemQuery.h +++ b/src/Parsers/ASTSystemQuery.h @@ -89,7 +89,10 @@ public: String volume; String disk; UInt64 seconds{}; + + /// Values for `drop fileystem cache` system query. String filesystem_cache_path; + bool force_removal = false; String getID(char) const override { return "SYSTEM query"; } diff --git a/src/Parsers/ParserSystemQuery.cpp b/src/Parsers/ParserSystemQuery.cpp index 61e96b9c1de..8990becaedc 100644 --- a/src/Parsers/ParserSystemQuery.cpp +++ b/src/Parsers/ParserSystemQuery.cpp @@ -346,6 +346,16 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & res->seconds = seconds->as()->value.get(); break; } + case Type::DROP_FILESYSTEM_CACHE: + { + ParserLiteral path_parser; + ASTPtr ast; + if (path_parser.parse(pos, ast, expected)) + res->filesystem_cache_path = ast->as()->value.safeGet(); + if (ParserKeyword{"FORCE"}.ignore(pos, expected)) + res->force_removal = true; + break; + } default: { diff --git a/tests/config/config.d/storage_conf.xml b/tests/config/config.d/storage_conf.xml index 3dd4811b1bf..474e22fa577 100644 --- a/tests/config/config.d/storage_conf.xml +++ b/tests/config/config.d/storage_conf.xml @@ -10,7 +10,18 @@ 0 22548578304 1 + ./s3_cache/ + + s3 + http://localhost:11111/test/00170_test/ + clickhouse + clickhouse + 1 + 0 + 22548578304 + 0 + @@ -20,6 +31,13 @@ + + +
+ s3_cache +
+
+
diff --git a/tests/queries/0_stateless/02286_drop_filesystem_cache.reference b/tests/queries/0_stateless/02286_drop_filesystem_cache.reference new file mode 100644 index 00000000000..0dabc778274 --- /dev/null +++ b/tests/queries/0_stateless/02286_drop_filesystem_cache.reference @@ -0,0 +1,30 @@ +-- { echo } + +SET enable_filesystem_cache_on_write_operations=0; +DROP TABLE IF EXISTS test; +CREATE TABLE test (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache', min_bytes_for_wide_part = 10485760; +SYSTEM DROP FILESYSTEM CACHE; +SELECT count() FROM system.filesystem_cache; +0 +INSERT INTO test SELECT number, toString(number) FROM numbers(100); +SELECT * FROM test FORMAT Null; +SELECT count() FROM system.filesystem_cache; +2 +SYSTEM DROP FILESYSTEM CACHE FORCE; +SELECT count() FROM system.filesystem_cache; +0 +SELECT * FROM test FORMAT Null; +SELECT count() FROM system.filesystem_cache; +1 +SYSTEM DROP FILESYSTEM CACHE './data'; -- { serverError 36 } +SELECT count() FROM system.filesystem_cache; +1 +DROP TABLE IF EXISTS test2; +CREATE TABLE test2 (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache_2', min_bytes_for_wide_part = 10485760; +INSERT INTO test2 SELECT number, toString(number) FROM numbers(100); +SELECT * FROM test2 FORMAT Null; +SELECT count() FROM system.filesystem_cache; +3 +SYSTEM DROP FILESYSTEM CACHE './s3_cache/'; +SELECT count() FROM system.filesystem_cache; +2 diff --git a/tests/queries/0_stateless/02286_drop_filesystem_cache.sql b/tests/queries/0_stateless/02286_drop_filesystem_cache.sql new file mode 100644 index 00000000000..4c99c248dbc --- /dev/null +++ b/tests/queries/0_stateless/02286_drop_filesystem_cache.sql @@ -0,0 +1,34 @@ +-- Tags: no-parallel, no-fasttest, no-s3-storage + +-- { echo } + +SET enable_filesystem_cache_on_write_operations=0; + +DROP TABLE IF EXISTS test; +CREATE TABLE test (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache', min_bytes_for_wide_part = 10485760; + +SYSTEM DROP FILESYSTEM CACHE; + +SELECT count() FROM system.filesystem_cache; +INSERT INTO test SELECT number, toString(number) FROM numbers(100); + +SELECT * FROM test FORMAT Null; +SELECT count() FROM system.filesystem_cache; + +SYSTEM DROP FILESYSTEM CACHE FORCE; +SELECT count() FROM system.filesystem_cache; + +SELECT * FROM test FORMAT Null; +SELECT count() FROM system.filesystem_cache; + +SYSTEM DROP FILESYSTEM CACHE './data'; -- { serverError 36 } +SELECT count() FROM system.filesystem_cache; + +DROP TABLE IF EXISTS test2; +CREATE TABLE test2 (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache_2', min_bytes_for_wide_part = 10485760; +INSERT INTO test2 SELECT number, toString(number) FROM numbers(100); +SELECT * FROM test2 FORMAT Null; +SELECT count() FROM system.filesystem_cache; + +SYSTEM DROP FILESYSTEM CACHE './s3_cache/'; +SELECT count() FROM system.filesystem_cache; From 5dc9478bac78baa90af5190dff67e472fa4006be Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Mon, 25 Apr 2022 16:54:30 +0000 Subject: [PATCH 11/34] fix SortingStep::updateOutputStream() --- src/Processors/QueryPlan/SortingStep.cpp | 2 ++ .../function_calculation_after_sorting_and_limit.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Processors/QueryPlan/SortingStep.cpp b/src/Processors/QueryPlan/SortingStep.cpp index 859c9fd9e19..255beebbdf1 100644 --- a/src/Processors/QueryPlan/SortingStep.cpp +++ b/src/Processors/QueryPlan/SortingStep.cpp @@ -98,6 +98,8 @@ void SortingStep::updateInputStream(DataStream input_stream) void SortingStep::updateOutputStream(Block result_header) { output_stream = createOutputStream(input_streams.at(0), std::move(result_header), getDataStreamTraits()); + output_stream->sort_description = result_description; + output_stream->sort_mode = DataStream::SortMode::Stream; updateDistinctColumns(output_stream->header, output_stream->distinct_columns); } diff --git a/tests/performance/function_calculation_after_sorting_and_limit.xml b/tests/performance/function_calculation_after_sorting_and_limit.xml index ddb8f860600..bd4b0e57aaa 100644 --- a/tests/performance/function_calculation_after_sorting_and_limit.xml +++ b/tests/performance/function_calculation_after_sorting_and_limit.xml @@ -1,4 +1,5 @@ SELECT sipHash64(number) FROM numbers(1e8) ORDER BY number LIMIT 5 SELECT sipHash64(number) FROM numbers(1e8) ORDER BY number + 1 LIMIT 5 + SELECT sipHash64(number) FROM numbers(1e8) ORDER BY number + 1 LIMIT 99999995, 5 From cf34ae0f673cda51905ae27adaa6c2fd4c5047cb Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Mon, 25 Apr 2022 19:40:28 +0200 Subject: [PATCH 12/34] Update ASTSystemQuery.h --- src/Parsers/ASTSystemQuery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsers/ASTSystemQuery.h b/src/Parsers/ASTSystemQuery.h index a5a2c724135..213b741f63b 100644 --- a/src/Parsers/ASTSystemQuery.h +++ b/src/Parsers/ASTSystemQuery.h @@ -90,7 +90,7 @@ public: String disk; UInt64 seconds{}; - /// Values for `drop fileystem cache` system query. + /// Values for `drop filesystem cache` system query. String filesystem_cache_path; bool force_removal = false; From d7ff09b8e0267eed13d647c6885b9b0d4541a2fd Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Mon, 25 Apr 2022 18:23:24 +0000 Subject: [PATCH 13/34] update tests --- .../01576_alias_column_rewrite.reference | 11 ++-- .../01655_plan_optimizations.reference | 2 +- .../0_stateless/01655_plan_optimizations.sh | 2 +- ...02149_read_in_order_fixed_prefix.reference | 58 +++++++++---------- 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/tests/queries/0_stateless/01576_alias_column_rewrite.reference b/tests/queries/0_stateless/01576_alias_column_rewrite.reference index 68875735110..678cbf7fb57 100644 --- a/tests/queries/0_stateless/01576_alias_column_rewrite.reference +++ b/tests/queries/0_stateless/01576_alias_column_rewrite.reference @@ -33,13 +33,12 @@ Expression (Projection) Expression (Before ORDER BY) SettingQuotaAndLimits (Set limits and quota after reading from storage) ReadFromMergeTree (default.test_table) -Expression (Projection) +Expression ((Projection + Before ORDER BY [lifted up part])) Limit (preliminary LIMIT (without OFFSET)) - Expression (Before ORDER BY [lifted up part]) - Sorting - Expression (Before ORDER BY) - SettingQuotaAndLimits (Set limits and quota after reading from storage) - ReadFromMergeTree (default.test_table) + Sorting + Expression (Before ORDER BY) + SettingQuotaAndLimits (Set limits and quota after reading from storage) + ReadFromMergeTree (default.test_table) optimize_aggregation_in_order Expression ((Projection + Before ORDER BY)) Aggregating diff --git a/tests/queries/0_stateless/01655_plan_optimizations.reference b/tests/queries/0_stateless/01655_plan_optimizations.reference index bb9c614f728..f870a52284c 100644 --- a/tests/queries/0_stateless/01655_plan_optimizations.reference +++ b/tests/queries/0_stateless/01655_plan_optimizations.reference @@ -144,7 +144,7 @@ Filter 2 3 > function calculation should be done after sorting and limit (if possible) > Expression should be divided into two subexpressions and only one of them should be moved after Sorting -Expression (Before ORDER BY [lifted up part]) +Expression ((Projection + Before ORDER BY [lifted up part])) FUNCTION sipHash64 Sorting Expression (Before ORDER BY) diff --git a/tests/queries/0_stateless/01655_plan_optimizations.sh b/tests/queries/0_stateless/01655_plan_optimizations.sh index 0b7f004a2ce..3a3ce95460c 100755 --- a/tests/queries/0_stateless/01655_plan_optimizations.sh +++ b/tests/queries/0_stateless/01655_plan_optimizations.sh @@ -201,7 +201,7 @@ echo "> function calculation should be done after sorting and limit (if possible echo "> Expression should be divided into two subexpressions and only one of them should be moved after Sorting" $CLICKHOUSE_CLIENT -q " explain actions = 1 select number as n, sipHash64(n) from numbers(100) order by number + 1 limit 5" | - sed 's/^ *//g' | grep -o "^ *\(Expression (Before ORDER BY.*)\|Sorting\|FUNCTION \w\+\)" + sed 's/^ *//g' | grep -o "^ *\(Expression (.*Before ORDER BY.*)\|Sorting\|FUNCTION \w\+\)" echo "> this query should be executed without throwing an exception" $CLICKHOUSE_CLIENT -q " select throwIf(number = 5) from (select * from numbers(10)) order by number limit 1" diff --git a/tests/queries/0_stateless/02149_read_in_order_fixed_prefix.reference b/tests/queries/0_stateless/02149_read_in_order_fixed_prefix.reference index 67a043d6646..9e24b7c6ea6 100644 --- a/tests/queries/0_stateless/02149_read_in_order_fixed_prefix.reference +++ b/tests/queries/0_stateless/02149_read_in_order_fixed_prefix.reference @@ -7,15 +7,13 @@ ExpressionTransform (Limit) Limit - (Expression) - ExpressionTransform - (Sorting) - MergingSortedTransform 2 → 1 - (Expression) - ExpressionTransform × 2 - (SettingQuotaAndLimits) - (ReadFromMergeTree) - MergeTreeInOrder × 2 0 → 1 + (Sorting) + MergingSortedTransform 2 → 1 + (Expression) + ExpressionTransform × 2 + (SettingQuotaAndLimits) + (ReadFromMergeTree) + MergeTreeInOrder × 2 0 → 1 2020-10-01 9 2020-10-01 9 2020-10-01 9 @@ -25,18 +23,16 @@ ExpressionTransform ExpressionTransform (Limit) Limit - (Expression) - ExpressionTransform - (Sorting) - MergingSortedTransform 2 → 1 - (Expression) - ExpressionTransform × 2 - (SettingQuotaAndLimits) - (ReadFromMergeTree) - ReverseTransform - MergeTreeReverse 0 → 1 - ReverseTransform - MergeTreeReverse 0 → 1 + (Sorting) + MergingSortedTransform 2 → 1 + (Expression) + ExpressionTransform × 2 + (SettingQuotaAndLimits) + (ReadFromMergeTree) + ReverseTransform + MergeTreeReverse 0 → 1 + ReverseTransform + MergeTreeReverse 0 → 1 2020-10-01 9 2020-10-01 9 2020-10-01 9 @@ -46,17 +42,15 @@ ExpressionTransform ExpressionTransform (Limit) Limit - (Expression) - ExpressionTransform - (Sorting) - FinishSortingTransform - PartialSortingTransform - MergingSortedTransform 2 → 1 - (Expression) - ExpressionTransform × 2 - (SettingQuotaAndLimits) - (ReadFromMergeTree) - MergeTreeInOrder × 2 0 → 1 + (Sorting) + FinishSortingTransform + PartialSortingTransform + MergingSortedTransform 2 → 1 + (Expression) + ExpressionTransform × 2 + (SettingQuotaAndLimits) + (ReadFromMergeTree) + MergeTreeInOrder × 2 0 → 1 2020-10-11 0 2020-10-11 0 2020-10-11 0 From cfcf8dbfbe6e8abbfd2875011bb03b11a640fbec Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Mon, 25 Apr 2022 21:00:39 +0200 Subject: [PATCH 14/34] fix backward incompatibility --- src/Parsers/ParserCreateQuery.cpp | 8 ++++++-- .../0_stateless/02184_default_table_engine.reference | 2 ++ .../0_stateless/02184_default_table_engine.sql | 12 +++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Parsers/ParserCreateQuery.cpp b/src/Parsers/ParserCreateQuery.cpp index 9c9989dc39f..0c36aeb3141 100644 --- a/src/Parsers/ParserCreateQuery.cpp +++ b/src/Parsers/ParserCreateQuery.cpp @@ -355,8 +355,9 @@ bool ParserStorage::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) ASTPtr settings; bool storage_like = false; + bool parsed_engine_keyword = s_engine.ignore(pos, expected); - if (s_engine.ignore(pos, expected)) + if (parsed_engine_keyword) { s_eq.ignore(pos, expected); @@ -422,7 +423,10 @@ bool ParserStorage::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) return false; } - if (s_settings.ignore(pos, expected)) + /// Do not allow SETTINGS clause without ENGINE, + /// because we cannot distinguish engine settings from query settings in this case. + /// And because settings for each engine are different. + if (parsed_engine_keyword && s_settings.ignore(pos, expected)) { if (!settings_p.parse(pos, settings, expected)) return false; diff --git a/tests/queries/0_stateless/02184_default_table_engine.reference b/tests/queries/0_stateless/02184_default_table_engine.reference index 200578f3da9..bc217f3b23a 100644 --- a/tests/queries/0_stateless/02184_default_table_engine.reference +++ b/tests/queries/0_stateless/02184_default_table_engine.reference @@ -25,3 +25,5 @@ CREATE TABLE default.mem\n(\n `n` UInt8\n)\nENGINE = Memory CREATE TABLE default.val\n(\n `n` Int32\n) AS values(\'n int\', 1, 2) CREATE TABLE default.val2\n(\n `n` Int32\n) AS values(\'n int\', 1, 2) CREATE TABLE default.log\n(\n `n` Int32\n)\nENGINE = Log +CREATE TABLE default.kek\n(\n `n` Int32\n)\nENGINE = Memory +CREATE TABLE default.lol\n(\n `n` Int32\n)\nENGINE = MergeTree\nORDER BY n\nSETTINGS min_bytes_for_wide_part = 123, index_granularity = 8192 diff --git a/tests/queries/0_stateless/02184_default_table_engine.sql b/tests/queries/0_stateless/02184_default_table_engine.sql index d129ccc801e..0aac32c9869 100644 --- a/tests/queries/0_stateless/02184_default_table_engine.sql +++ b/tests/queries/0_stateless/02184_default_table_engine.sql @@ -66,7 +66,7 @@ DROP TABLE t2; CREATE DATABASE test_02184 ORDER BY kek; -- {serverError 80} -CREATE DATABASE test_02184 SETTINGS x=1; -- {serverError 80} +CREATE DATABASE test_02184 SETTINGS x=1; -- {serverError 115} CREATE TABLE table_02184 (x UInt8, y int, PRIMARY KEY (x)) ENGINE=MergeTree PRIMARY KEY y; -- {clientError 36} SET default_table_engine = 'MergeTree'; CREATE TABLE table_02184 (x UInt8, y int, PRIMARY KEY (x)) PRIMARY KEY y; -- {clientError 36} @@ -118,3 +118,13 @@ SHOW CREATE TABLE log; DROP TABLE val; DROP TABLE val2; DROP TABLE log; + +DROP TABLE IF EXISTS kek; +DROP TABLE IF EXISTS lol; +SET default_table_engine = 'Memory'; +CREATE TABLE kek (n int) SETTINGS log_queries=1; +CREATE TABLE lol (n int) ENGINE=MergeTree ORDER BY n SETTINGS min_bytes_for_wide_part=123 SETTINGS log_queries=1; +SHOW CREATE TABLE kek; +SHOW CREATE TABLE lol; +DROP TABLE kek; +DROP TABLE lol; From 3215faca72368a1b29ea707148ae5d9629f46040 Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Mon, 25 Apr 2022 21:15:38 +0200 Subject: [PATCH 15/34] Update storage_conf.xml --- tests/config/config.d/storage_conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/config.d/storage_conf.xml b/tests/config/config.d/storage_conf.xml index 474e22fa577..45fad002c88 100644 --- a/tests/config/config.d/storage_conf.xml +++ b/tests/config/config.d/storage_conf.xml @@ -34,7 +34,7 @@
- s3_cache + s3_cache_2
From a2dc780174879eed63d06d32932bca4542f2b27d Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 25 Apr 2022 21:16:02 +0200 Subject: [PATCH 16/34] Make backward compatible integration tests runner --- .../integration/runner/compose/docker_compose_keeper.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/test/integration/runner/compose/docker_compose_keeper.yml b/docker/test/integration/runner/compose/docker_compose_keeper.yml index a729a9c7734..811bbdd800d 100644 --- a/docker/test/integration/runner/compose/docker_compose_keeper.yml +++ b/docker/test/integration/runner/compose/docker_compose_keeper.yml @@ -17,7 +17,7 @@ services: - type: ${keeper_fs:-tmpfs} source: ${keeper_db_dir1:-} target: /var/lib/clickhouse-keeper - entrypoint: "${keeper_cmd_prefix:-} --config=/etc/clickhouse-keeper/keeper_config1.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" + entrypoint: "${keeper_cmd_prefix:-clickhouse keeper} --config=/etc/clickhouse-keeper/keeper_config1.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" cap_add: - SYS_PTRACE - NET_ADMIN @@ -47,7 +47,7 @@ services: - type: ${keeper_fs:-tmpfs} source: ${keeper_db_dir2:-} target: /var/lib/clickhouse-keeper - entrypoint: "${keeper_cmd_prefix:-} --config=/etc/clickhouse-keeper/keeper_config2.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" + entrypoint: "${keeper_cmd_prefix:-clickhouse keeper} --config=/etc/clickhouse-keeper/keeper_config2.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" cap_add: - SYS_PTRACE - NET_ADMIN @@ -77,7 +77,7 @@ services: - type: ${keeper_fs:-tmpfs} source: ${keeper_db_dir3:-} target: /var/lib/clickhouse-keeper - entrypoint: "${keeper_cmd_prefix:-} --config=/etc/clickhouse-keeper/keeper_config3.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" + entrypoint: "${keeper_cmd_prefix:-clickhouse keeper} --config=/etc/clickhouse-keeper/keeper_config3.xml --log-file=/var/log/clickhouse-keeper/clickhouse-keeper.log --errorlog-file=/var/log/clickhouse-keeper/clickhouse-keeper.err.log" cap_add: - SYS_PTRACE - NET_ADMIN From 35b8d302da85472572c42e7d31932ff6825e21ea Mon Sep 17 00:00:00 2001 From: kssenii Date: Mon, 25 Apr 2022 21:57:13 +0200 Subject: [PATCH 17/34] Fix --- src/Common/FileSegment.cpp | 4 ++-- src/Parsers/ASTSystemQuery.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Common/FileSegment.cpp b/src/Common/FileSegment.cpp index 4de8b043903..a14051fa9c8 100644 --- a/src/Common/FileSegment.cpp +++ b/src/Common/FileSegment.cpp @@ -452,11 +452,11 @@ void FileSegment::completeBatchAndResetDownloader() void FileSegment::complete(State state) { - assertNotDetached(); - std::lock_guard cache_lock(cache->mutex); std::lock_guard segment_lock(mutex); + assertNotDetached(); + bool is_downloader = isDownloaderImpl(segment_lock); if (!is_downloader) { diff --git a/src/Parsers/ASTSystemQuery.cpp b/src/Parsers/ASTSystemQuery.cpp index a4b0a69faaa..274d1639b4b 100644 --- a/src/Parsers/ASTSystemQuery.cpp +++ b/src/Parsers/ASTSystemQuery.cpp @@ -192,6 +192,13 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, << (settings.hilite ? hilite_keyword : "") << " SECOND" << (settings.hilite ? hilite_none : ""); } + else if (type == Type::DROP_FILESYSTEM_CACHE) + { + if (!filesystem_cache_path.empty()) + settings.ostr << (settings.hilite ? hilite_none : "") << filesystem_cache_path; + if (force_removal) + settings.ostr << (settings.hilite ? hilite_keyword : "") << " FORCE"; + } } From 049d2a0897fceb97868ec13f6235ddcb49a8d42f Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Mon, 25 Apr 2022 22:18:45 +0200 Subject: [PATCH 18/34] fix tests --- .../01169_alter_partition_isolation_stress.sh | 10 ++++++---- .../01171_mv_select_insert_isolation_long.sh | 10 ++++++---- .../0_stateless/01174_select_insert_isolation.sh | 5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/queries/0_stateless/01169_alter_partition_isolation_stress.sh b/tests/queries/0_stateless/01169_alter_partition_isolation_stress.sh index ab348fd31fb..9fef47c8d5d 100755 --- a/tests/queries/0_stateless/01169_alter_partition_isolation_stress.sh +++ b/tests/queries/0_stateless/01169_alter_partition_isolation_stress.sh @@ -17,9 +17,10 @@ $CLICKHOUSE_CLIENT --query "CREATE TABLE dst (n UInt64, type UInt8) ENGINE=Merge function thread_insert() { set -e - trap "exit 0" INT val=1 - while true; do + trap "STOP_THE_LOOP=1" INT + STOP_THE_LOOP=0 + while [[ $STOP_THE_LOOP != 1 ]]; do $CLICKHOUSE_CLIENT --multiquery --query " BEGIN TRANSACTION; INSERT INTO src VALUES /* ($val, 1) */ ($val, 1); @@ -91,8 +92,9 @@ function thread_partition_dst_to_src() function thread_select() { set -e - trap "exit 0" INT - while true; do + trap "STOP_THE_LOOP=1" INT + STOP_THE_LOOP=0 + while [[ $STOP_THE_LOOP != 1 ]]; do $CLICKHOUSE_CLIENT --multiquery --query " BEGIN TRANSACTION; -- no duplicates diff --git a/tests/queries/0_stateless/01171_mv_select_insert_isolation_long.sh b/tests/queries/0_stateless/01171_mv_select_insert_isolation_long.sh index 5086515e9eb..261fa480491 100755 --- a/tests/queries/0_stateless/01171_mv_select_insert_isolation_long.sh +++ b/tests/queries/0_stateless/01171_mv_select_insert_isolation_long.sh @@ -50,8 +50,9 @@ function thread_insert_rollback() function thread_optimize() { set -e - trap "exit 0" INT - while true; do + trap "STOP_THE_LOOP=1" INT + STOP_THE_LOOP=0 + while [[ $STOP_THE_LOOP != 1 ]]; do optimize_query="OPTIMIZE TABLE src" partition_id=$(( RANDOM % 2 )) if (( RANDOM % 2 )); then @@ -102,8 +103,9 @@ function thread_select() function thread_select_insert() { set -e - trap "exit 0" INT - while true; do + trap "STOP_THE_LOOP=1" INT + STOP_THE_LOOP=0 + while [[ $STOP_THE_LOOP != 1 ]]; do $CLICKHOUSE_CLIENT --multiquery --query " BEGIN TRANSACTION; SELECT throwIf((SELECT count() FROM tmp) != 0) FORMAT Null; diff --git a/tests/queries/0_stateless/01174_select_insert_isolation.sh b/tests/queries/0_stateless/01174_select_insert_isolation.sh index 8872ab82c03..4bce09cf1d5 100755 --- a/tests/queries/0_stateless/01174_select_insert_isolation.sh +++ b/tests/queries/0_stateless/01174_select_insert_isolation.sh @@ -35,8 +35,9 @@ function thread_insert_rollback() function thread_select() { - trap "exit 0" INT - while true; do + trap "STOP_THE_LOOP=1" INT + STOP_THE_LOOP=0 + while [[ $STOP_THE_LOOP != 1 ]]; do # Result of `uniq | wc -l` must be 1 if the first and the last queries got the same result $CLICKHOUSE_CLIENT --multiquery --query " BEGIN TRANSACTION; From 19a376b9f74a706b39ef9e405037a5f54b8c6acb Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Mon, 25 Apr 2022 22:41:46 +0200 Subject: [PATCH 19/34] fix assertions --- src/Storages/MergeTree/IMergeTreeDataPart.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Storages/MergeTree/IMergeTreeDataPart.cpp b/src/Storages/MergeTree/IMergeTreeDataPart.cpp index 1b026279989..a1946ced259 100644 --- a/src/Storages/MergeTree/IMergeTreeDataPart.cpp +++ b/src/Storages/MergeTree/IMergeTreeDataPart.cpp @@ -1414,6 +1414,9 @@ bool IMergeTreeDataPart::assertHasValidVersionMetadata() const if (part_is_probably_removed_from_disk) return true; + if (state == State::Temporary) + return true; + DiskPtr disk = volume->getDisk(); if (!disk->exists(getFullRelativePath())) return true; @@ -1772,6 +1775,7 @@ String IMergeTreeDataPart::getRelativePathForDetachedPart(const String & prefix) void IMergeTreeDataPart::renameToDetached(const String & prefix) const { renameTo(getRelativePathForDetachedPart(prefix), true); + part_is_probably_removed_from_disk = true; } void IMergeTreeDataPart::makeCloneInDetached(const String & prefix, const StorageMetadataPtr & /*metadata_snapshot*/) const From b761d5bf3a5dbbae5522539917adea61684853ed Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Tue, 26 Apr 2022 06:51:23 +0000 Subject: [PATCH 20/34] Update version_date.tsv after v22.4.3.3-stable --- utils/list-versions/version_date.tsv | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/list-versions/version_date.tsv b/utils/list-versions/version_date.tsv index 9d1f8487169..32b2170fcb2 100644 --- a/utils/list-versions/version_date.tsv +++ b/utils/list-versions/version_date.tsv @@ -1,3 +1,4 @@ +v22.4.3.3-stable 2022-04-26 v22.4.2.1-stable 2022-04-22 v22.3.3.44-lts 2022-04-06 v22.3.2.2-lts 2022-03-17 From 298c0dd673be2c02cd9d815a633f71bd3018173e Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Tue, 26 Apr 2022 15:06:50 +0800 Subject: [PATCH 21/34] Fix flaky test --- tests/queries/0_stateless/01460_mark_inclusion_search_crash.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/01460_mark_inclusion_search_crash.sql b/tests/queries/0_stateless/01460_mark_inclusion_search_crash.sql index 148ecdab490..86c4d988c38 100644 --- a/tests/queries/0_stateless/01460_mark_inclusion_search_crash.sql +++ b/tests/queries/0_stateless/01460_mark_inclusion_search_crash.sql @@ -7,6 +7,6 @@ INSERT INTO pk (x, y, z) VALUES (1, 11, 1235), (2, 11, 4395), (3, 22, 3545), (4, SET max_block_size = 1; SET max_rows_to_read = 5; -SELECT toUInt32(x), y, z FROM pk WHERE (x >= toDateTime(100000)) AND (x <= toDateTime(3)); +SELECT toUInt32(x), y, z FROM pk WHERE (x >= toDateTime(100000)) AND (x <= toDateTime(90000)); DROP TABLE IF EXISTS pk; From 07fcb5772971bfed778e88eeda459a148d487fd8 Mon Sep 17 00:00:00 2001 From: Ramazan Polat Date: Tue, 26 Apr 2022 10:29:21 +0300 Subject: [PATCH 22/34] add missing pandas package --- utils/clickhouse-diagnostics/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/clickhouse-diagnostics/requirements.txt b/utils/clickhouse-diagnostics/requirements.txt index 1d2b6ef3916..d29acab2161 100644 --- a/utils/clickhouse-diagnostics/requirements.txt +++ b/utils/clickhouse-diagnostics/requirements.txt @@ -4,3 +4,4 @@ requests sqlparse tenacity xmltodict +pandas From cb9d95659cca9cdc9306f395295cda00aa4f3898 Mon Sep 17 00:00:00 2001 From: Alexander Gololobov <440544+davenger@users.noreply.github.com> Date: Tue, 26 Apr 2022 09:57:05 +0200 Subject: [PATCH 23/34] Fix style issue reported by black formatter --- docs/tools/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/website.py b/docs/tools/website.py index 302645dfa0f..e638af7b4b0 100644 --- a/docs/tools/website.py +++ b/docs/tools/website.py @@ -322,7 +322,7 @@ def process_benchmark_results(args): required_keys = { "dbms": ["result"], "hardware": ["result", "system", "system_full", "kind"], - "versions": ["version", "system"] + "versions": ["version", "system"], } for benchmark_kind in ["dbms", "hardware", "versions"]: results = [] From 6339a48923bd18d1fe383a3c698eb5383263e3d1 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Apr 2022 09:17:17 +0300 Subject: [PATCH 24/34] Add is_all_data_sent into system.processes v2: fix SHOW PROCESSLIST (does not have process list entry) Signed-off-by: Azat Khuzhin --- docs/en/operations/system-tables/processes.md | 3 +++ src/Interpreters/ProcessList.cpp | 1 + src/Interpreters/ProcessList.h | 7 +++++++ src/Server/TCPHandler.cpp | 7 +++++++ src/Storages/System/StorageSystemProcesses.cpp | 2 ++ 5 files changed, 20 insertions(+) diff --git a/docs/en/operations/system-tables/processes.md b/docs/en/operations/system-tables/processes.md index f261ee9b696..a77fbf2a109 100644 --- a/docs/en/operations/system-tables/processes.md +++ b/docs/en/operations/system-tables/processes.md @@ -13,6 +13,8 @@ Columns: - `memory_usage` (UInt64) – Amount of RAM the request uses. It might not include some types of dedicated memory. See the [max_memory_usage](../../operations/settings/query-complexity.md#settings_max_memory_usage) setting. - `query` (String) – The query text. For `INSERT`, it does not include the data to insert. - `query_id` (String) – Query ID, if defined. +- `is_cancelled` (Int8) – Was query cancelled. +- `is_all_data_sent` (Int8) – Was all data sent to the client (in other words query had been finished on the server). ```sql :) SELECT * FROM system.processes LIMIT 10 FORMAT Vertical; @@ -43,6 +45,7 @@ http_user_agent: quota_key: elapsed: 0.000582537 is_cancelled: 0 +is_all_data_sent: 0 read_rows: 0 read_bytes: 0 total_rows_approx: 0 diff --git a/src/Interpreters/ProcessList.cpp b/src/Interpreters/ProcessList.cpp index 26146781327..0f728ec7a33 100644 --- a/src/Interpreters/ProcessList.cpp +++ b/src/Interpreters/ProcessList.cpp @@ -455,6 +455,7 @@ QueryStatusInfo QueryStatus::getInfo(bool get_thread_list, bool get_profile_even res.client_info = client_info; res.elapsed_seconds = watch.elapsedSeconds(); res.is_cancelled = is_killed.load(std::memory_order_relaxed); + res.is_all_data_sent = is_all_data_sent.load(std::memory_order_relaxed); res.read_rows = progress_in.read_rows; res.read_bytes = progress_in.read_bytes; res.total_rows = progress_in.total_rows_to_read; diff --git a/src/Interpreters/ProcessList.h b/src/Interpreters/ProcessList.h index c5c83904b7c..a30c0f59feb 100644 --- a/src/Interpreters/ProcessList.h +++ b/src/Interpreters/ProcessList.h @@ -61,6 +61,7 @@ struct QueryStatusInfo Int64 peak_memory_usage; ClientInfo client_info; bool is_cancelled; + bool is_all_data_sent; /// Optional fields, filled by query std::vector thread_ids; @@ -101,6 +102,9 @@ protected: std::atomic is_killed { false }; + /// All data to the client already had been sent. Including EndOfStream. + std::atomic is_all_data_sent { false }; + void setUserProcessList(ProcessListForUser * user_process_list_); /// Be careful using it. For example, queries field of ProcessListForUser could be modified concurrently. const ProcessListForUser * getUserProcessList() const { return user_process_list; } @@ -194,6 +198,9 @@ public: bool isKilled() const { return is_killed; } + bool isAllDataSent() const { return is_all_data_sent; } + void setAllDataSent() { is_all_data_sent = true; } + /// Adds a pipeline to the QueryStatus void addPipelineExecutor(PipelineExecutor * e); diff --git a/src/Server/TCPHandler.cpp b/src/Server/TCPHandler.cpp index b6c4b068d32..911d0a4e76b 100644 --- a/src/Server/TCPHandler.cpp +++ b/src/Server/TCPHandler.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1710,6 +1711,12 @@ void TCPHandler::sendException(const Exception & e, bool with_stack_trace) void TCPHandler::sendEndOfStream() { state.sent_all_data = true; + /// The following queries does not have process_list_entry: + /// - internal + /// - SHOW PROCESSLIST + if (state.io.process_list_entry) + (*state.io.process_list_entry)->setAllDataSent(); + writeVarUInt(Protocol::Server::EndOfStream, *out); out->next(); } diff --git a/src/Storages/System/StorageSystemProcesses.cpp b/src/Storages/System/StorageSystemProcesses.cpp index efa01561ad4..08d3666216f 100644 --- a/src/Storages/System/StorageSystemProcesses.cpp +++ b/src/Storages/System/StorageSystemProcesses.cpp @@ -52,6 +52,7 @@ NamesAndTypesList StorageSystemProcesses::getNamesAndTypes() {"elapsed", std::make_shared()}, {"is_cancelled", std::make_shared()}, + {"is_all_data_sent", std::make_shared()}, {"read_rows", std::make_shared()}, {"read_bytes", std::make_shared()}, {"total_rows_approx", std::make_shared()}, @@ -120,6 +121,7 @@ void StorageSystemProcesses::fillData(MutableColumns & res_columns, ContextPtr c res_columns[i++]->insert(process.elapsed_seconds); res_columns[i++]->insert(process.is_cancelled); + res_columns[i++]->insert(process.is_all_data_sent); res_columns[i++]->insert(process.read_rows); res_columns[i++]->insert(process.read_bytes); res_columns[i++]->insert(process.total_rows); From c2c8b5cd7e5ef4753e1c3fced19ced9ceecc501c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Apr 2022 09:20:17 +0300 Subject: [PATCH 25/34] clickhouse-test: improve left queries after the test hardening Right now it is possible to have "false-positive" for this hardening, because there is a tiny delay (that can be quite significant on CI, when it is under pressure) between when the server sends EndOfStream and the server removes an entry from system.processes. But now system.processes has is_all_data_sent column, that means that the EndOfStream was sent, and we can use it to avoid false positive. Here is an example of such report [1]: 2022-04-25 03:47:18 00806_alter_update: [ FAIL ] 0.95 sec. - Queries left in background after the test finished: 2022-04-25 03:47:18 "elapsed": 0.100084746, 2022-04-25 03:47:18 "is_cancelled": 0, 2022-04-25 03:47:18 "query": "DROP TABLE alter_update_00806;", 2022-04-25 03:47:18 "thread_ids": [ 2022-04-25 03:47:18 "8950" 2022-04-25 03:47:18 ], 2022.04.25 03:47:17.887095 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} executeQuery: (from [::1]:52012) (comment: 00806_alter_update.sql) DROP TABLE alter_update_00806; 2022.04.25 03:47:17.887493 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} ContextAccess (default): Access granted: DROP TABLE ON test_7ntsjn.alter_update_00806 2022.04.25 03:47:17.887765 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} test_7ntsjn.alter_update_00806 (1bc92bca-10a7-444e-be5e-7f61f4650169): Found 2 old parts to remove. 2022.04.25 03:47:17.887947 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} test_7ntsjn.alter_update_00806 (1bc92bca-10a7-444e-be5e-7f61f4650169): Removing part from filesystem 20180101_20180101_1_1_0 2022.04.25 03:47:17.888960 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} test_7ntsjn.alter_update_00806 (1bc92bca-10a7-444e-be5e-7f61f4650169): Removing part from filesystem 20180102_20180102_2_2_0 2022.04.25 03:47:17.890620 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} DatabaseCatalog: Waiting for table 1bc92bca-10a7-444e-be5e-7f61f4650169 to be finally dropped 2022.04.25 03:47:17.895046 [ 8950 ] {7c062004-4c22-486c-934a-f405846e2c81} MemoryTracker: Peak memory usage (for query): 0.00 B. ... 2022.04.25 03:47:17.938328 [ 4422 ] {aa01985a-78f5-4c0e-b646-8d04a4a1dc77} executeQuery: (from [::1]:59416) (comment: 00806_alter_update.sql) DROP DATABASE test_7ntsjn 2022.04.25 03:47:17.938667 [ 4422 ] {aa01985a-78f5-4c0e-b646-8d04a4a1dc77} ContextAccess (default): Access granted: DROP DATABASE ON test_7ntsjn.* ... 2022.04.25 03:47:18.154847 [ 8950 ] {} TCPHandler: Processed in 0.269358257 sec. 2022.04.25 03:47:18.154991 [ 8950 ] {} TCPHandler: Done processing connection. 2022.04.25 03:47:18.155181 [ 8950 ] {} TCP-Session: e1d8176a-ee62-4e0a-9855-fe9eb52e06dc Destroying unnamed session of user 94309d50-4f52-5250-31bd-74fecac179db [1]: https://s3.amazonaws.com/clickhouse-test-reports/36319/a646cf76b6d4699f06aea1e8d777edb1ad6fd2c5/stateless_tests__debug__actions__[1/3]/runlog.log So as you can see here DROP TABLE was captured when elapsed was 0.1, while TCPHandler processes it for 0.26 seconds. Also from the same report you are seeing that DROP DATABASE was executed before TCPHandler stopoped processing DROP TABLE. Signed-off-by: Azat Khuzhin --- tests/clickhouse-test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/clickhouse-test b/tests/clickhouse-test index a1f1f467e59..878e6de264f 100755 --- a/tests/clickhouse-test +++ b/tests/clickhouse-test @@ -225,6 +225,7 @@ def get_processlist_after_test(args): FROM clusterAllReplicas('test_cluster_database_replicated', system.processes) WHERE query NOT LIKE '%system.processes%' AND + NOT is_all_data_sent AND Settings['log_comment'] = '{log_comment}' AND current_database = '{database}' """) @@ -234,6 +235,7 @@ def get_processlist_after_test(args): FROM system.processes WHERE query NOT LIKE '%system.processes%' AND + NOT is_all_data_sent AND Settings['log_comment'] = '{log_comment}' AND current_database = '{database}' """) From b6f127c977605c5476980b4ef1b86c3596834fe1 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Apr 2022 12:11:33 +0300 Subject: [PATCH 26/34] tests: fix system.processes definition in 02117_show_create_table_system Signed-off-by: Azat Khuzhin --- .../0_stateless/02117_show_create_table_system.reference | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index 246b8ef6d3b..70b8d79079c 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_system.reference @@ -36,7 +36,7 @@ CREATE TABLE system.part_moves_between_shards\n(\n `database` String,\n `t CREATE TABLE system.parts\n(\n `partition` String,\n `name` String,\n `uuid` UUID,\n `part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `secondary_indices_compressed_bytes` UInt64,\n `secondary_indices_uncompressed_bytes` UInt64,\n `secondary_indices_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `is_frozen` UInt8,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `hash_of_all_files` String,\n `hash_of_uncompressed_files` String,\n `uncompressed_hash_of_compressed_files` String,\n `delete_ttl_info_min` DateTime,\n `delete_ttl_info_max` DateTime,\n `move_ttl_info.expression` Array(String),\n `move_ttl_info.min` Array(DateTime),\n `move_ttl_info.max` Array(DateTime),\n `default_compression_codec` String,\n `recompression_ttl_info.expression` Array(String),\n `recompression_ttl_info.min` Array(DateTime),\n `recompression_ttl_info.max` Array(DateTime),\n `group_by_ttl_info.expression` Array(String),\n `group_by_ttl_info.min` Array(DateTime),\n `group_by_ttl_info.max` Array(DateTime),\n `rows_where_ttl_info.expression` Array(String),\n `rows_where_ttl_info.min` Array(DateTime),\n `rows_where_ttl_info.max` Array(DateTime),\n `projections` Array(String),\n `visible` UInt8,\n `creation_tid` Tuple(UInt64, UInt64, UUID),\n `removal_tid` Tuple(UInt64, UInt64, UUID),\n `creation_csn` UInt64,\n `removal_csn` UInt64,\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemParts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' CREATE TABLE system.parts_columns\n(\n `partition` String,\n `name` String,\n `uuid` UUID,\n `part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `column` String,\n `type` String,\n `column_position` UInt64,\n `default_kind` String,\n `default_expression` String,\n `column_bytes_on_disk` UInt64,\n `column_data_compressed_bytes` UInt64,\n `column_data_uncompressed_bytes` UInt64,\n `column_marks_bytes` UInt64,\n `serialization_kind` String,\n `subcolumns.names` Array(String),\n `subcolumns.types` Array(String),\n `subcolumns.serializations` Array(String),\n `subcolumns.bytes_on_disk` Array(UInt64),\n `subcolumns.data_compressed_bytes` Array(UInt64),\n `subcolumns.data_uncompressed_bytes` Array(UInt64),\n `subcolumns.marks_bytes` Array(UInt64),\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemPartsColumns()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' CREATE TABLE system.privileges\n(\n `privilege` Enum16(\'SHOW DATABASES\' = 0, \'SHOW TABLES\' = 1, \'SHOW COLUMNS\' = 2, \'SHOW DICTIONARIES\' = 3, \'SHOW\' = 4, \'SELECT\' = 5, \'INSERT\' = 6, \'ALTER UPDATE\' = 7, \'ALTER DELETE\' = 8, \'ALTER ADD COLUMN\' = 9, \'ALTER MODIFY COLUMN\' = 10, \'ALTER DROP COLUMN\' = 11, \'ALTER COMMENT COLUMN\' = 12, \'ALTER CLEAR COLUMN\' = 13, \'ALTER RENAME COLUMN\' = 14, \'ALTER MATERIALIZE COLUMN\' = 15, \'ALTER COLUMN\' = 16, \'ALTER MODIFY COMMENT\' = 17, \'ALTER ORDER BY\' = 18, \'ALTER SAMPLE BY\' = 19, \'ALTER ADD INDEX\' = 20, \'ALTER DROP INDEX\' = 21, \'ALTER MATERIALIZE INDEX\' = 22, \'ALTER CLEAR INDEX\' = 23, \'ALTER INDEX\' = 24, \'ALTER ADD PROJECTION\' = 25, \'ALTER DROP PROJECTION\' = 26, \'ALTER MATERIALIZE PROJECTION\' = 27, \'ALTER CLEAR PROJECTION\' = 28, \'ALTER PROJECTION\' = 29, \'ALTER ADD CONSTRAINT\' = 30, \'ALTER DROP CONSTRAINT\' = 31, \'ALTER CONSTRAINT\' = 32, \'ALTER TTL\' = 33, \'ALTER MATERIALIZE TTL\' = 34, \'ALTER SETTINGS\' = 35, \'ALTER MOVE PARTITION\' = 36, \'ALTER FETCH PARTITION\' = 37, \'ALTER FREEZE PARTITION\' = 38, \'ALTER DATABASE SETTINGS\' = 39, \'ALTER TABLE\' = 40, \'ALTER DATABASE\' = 41, \'ALTER VIEW REFRESH\' = 42, \'ALTER VIEW MODIFY QUERY\' = 43, \'ALTER VIEW\' = 44, \'ALTER\' = 45, \'CREATE DATABASE\' = 46, \'CREATE TABLE\' = 47, \'CREATE VIEW\' = 48, \'CREATE DICTIONARY\' = 49, \'CREATE TEMPORARY TABLE\' = 50, \'CREATE FUNCTION\' = 51, \'CREATE\' = 52, \'DROP DATABASE\' = 53, \'DROP TABLE\' = 54, \'DROP VIEW\' = 55, \'DROP DICTIONARY\' = 56, \'DROP FUNCTION\' = 57, \'DROP\' = 58, \'TRUNCATE\' = 59, \'OPTIMIZE\' = 60, \'KILL QUERY\' = 61, \'KILL TRANSACTION\' = 62, \'MOVE PARTITION BETWEEN SHARDS\' = 63, \'CREATE USER\' = 64, \'ALTER USER\' = 65, \'DROP USER\' = 66, \'CREATE ROLE\' = 67, \'ALTER ROLE\' = 68, \'DROP ROLE\' = 69, \'ROLE ADMIN\' = 70, \'CREATE ROW POLICY\' = 71, \'ALTER ROW POLICY\' = 72, \'DROP ROW POLICY\' = 73, \'CREATE QUOTA\' = 74, \'ALTER QUOTA\' = 75, \'DROP QUOTA\' = 76, \'CREATE SETTINGS PROFILE\' = 77, \'ALTER SETTINGS PROFILE\' = 78, \'DROP SETTINGS PROFILE\' = 79, \'SHOW USERS\' = 80, \'SHOW ROLES\' = 81, \'SHOW ROW POLICIES\' = 82, \'SHOW QUOTAS\' = 83, \'SHOW SETTINGS PROFILES\' = 84, \'SHOW ACCESS\' = 85, \'ACCESS MANAGEMENT\' = 86, \'SYSTEM SHUTDOWN\' = 87, \'SYSTEM DROP DNS CACHE\' = 88, \'SYSTEM DROP MARK CACHE\' = 89, \'SYSTEM DROP UNCOMPRESSED CACHE\' = 90, \'SYSTEM DROP MMAP CACHE\' = 91, \'SYSTEM DROP COMPILED EXPRESSION CACHE\' = 92, \'SYSTEM DROP CACHE\' = 93, \'SYSTEM RELOAD CONFIG\' = 94, \'SYSTEM RELOAD SYMBOLS\' = 95, \'SYSTEM RELOAD DICTIONARY\' = 96, \'SYSTEM RELOAD MODEL\' = 97, \'SYSTEM RELOAD FUNCTION\' = 98, \'SYSTEM RELOAD EMBEDDED DICTIONARIES\' = 99, \'SYSTEM RELOAD\' = 100, \'SYSTEM RESTART DISK\' = 101, \'SYSTEM MERGES\' = 102, \'SYSTEM TTL MERGES\' = 103, \'SYSTEM FETCHES\' = 104, \'SYSTEM MOVES\' = 105, \'SYSTEM DISTRIBUTED SENDS\' = 106, \'SYSTEM REPLICATED SENDS\' = 107, \'SYSTEM SENDS\' = 108, \'SYSTEM REPLICATION QUEUES\' = 109, \'SYSTEM DROP REPLICA\' = 110, \'SYSTEM SYNC REPLICA\' = 111, \'SYSTEM RESTART REPLICA\' = 112, \'SYSTEM RESTORE REPLICA\' = 113, \'SYSTEM FLUSH DISTRIBUTED\' = 114, \'SYSTEM FLUSH LOGS\' = 115, \'SYSTEM FLUSH\' = 116, \'SYSTEM THREAD FUZZER\' = 117, \'SYSTEM\' = 118, \'dictGet\' = 119, \'addressToLine\' = 120, \'addressToLineWithInlines\' = 121, \'addressToSymbol\' = 122, \'demangle\' = 123, \'INTROSPECTION\' = 124, \'FILE\' = 125, \'URL\' = 126, \'REMOTE\' = 127, \'MONGO\' = 128, \'MYSQL\' = 129, \'POSTGRES\' = 130, \'SQLITE\' = 131, \'ODBC\' = 132, \'JDBC\' = 133, \'HDFS\' = 134, \'S3\' = 135, \'HIVE\' = 136, \'SOURCES\' = 137, \'ALL\' = 138, \'NONE\' = 139),\n `aliases` Array(String),\n `level` Nullable(Enum8(\'GLOBAL\' = 0, \'DATABASE\' = 1, \'TABLE\' = 2, \'DICTIONARY\' = 3, \'VIEW\' = 4, \'COLUMN\' = 5)),\n `parent_group` Nullable(Enum16(\'SHOW DATABASES\' = 0, \'SHOW TABLES\' = 1, \'SHOW COLUMNS\' = 2, \'SHOW DICTIONARIES\' = 3, \'SHOW\' = 4, \'SELECT\' = 5, \'INSERT\' = 6, \'ALTER UPDATE\' = 7, \'ALTER DELETE\' = 8, \'ALTER ADD COLUMN\' = 9, \'ALTER MODIFY COLUMN\' = 10, \'ALTER DROP COLUMN\' = 11, \'ALTER COMMENT COLUMN\' = 12, \'ALTER CLEAR COLUMN\' = 13, \'ALTER RENAME COLUMN\' = 14, \'ALTER MATERIALIZE COLUMN\' = 15, \'ALTER COLUMN\' = 16, \'ALTER MODIFY COMMENT\' = 17, \'ALTER ORDER BY\' = 18, \'ALTER SAMPLE BY\' = 19, \'ALTER ADD INDEX\' = 20, \'ALTER DROP INDEX\' = 21, \'ALTER MATERIALIZE INDEX\' = 22, \'ALTER CLEAR INDEX\' = 23, \'ALTER INDEX\' = 24, \'ALTER ADD PROJECTION\' = 25, \'ALTER DROP PROJECTION\' = 26, \'ALTER MATERIALIZE PROJECTION\' = 27, \'ALTER CLEAR PROJECTION\' = 28, \'ALTER PROJECTION\' = 29, \'ALTER ADD CONSTRAINT\' = 30, \'ALTER DROP CONSTRAINT\' = 31, \'ALTER CONSTRAINT\' = 32, \'ALTER TTL\' = 33, \'ALTER MATERIALIZE TTL\' = 34, \'ALTER SETTINGS\' = 35, \'ALTER MOVE PARTITION\' = 36, \'ALTER FETCH PARTITION\' = 37, \'ALTER FREEZE PARTITION\' = 38, \'ALTER DATABASE SETTINGS\' = 39, \'ALTER TABLE\' = 40, \'ALTER DATABASE\' = 41, \'ALTER VIEW REFRESH\' = 42, \'ALTER VIEW MODIFY QUERY\' = 43, \'ALTER VIEW\' = 44, \'ALTER\' = 45, \'CREATE DATABASE\' = 46, \'CREATE TABLE\' = 47, \'CREATE VIEW\' = 48, \'CREATE DICTIONARY\' = 49, \'CREATE TEMPORARY TABLE\' = 50, \'CREATE FUNCTION\' = 51, \'CREATE\' = 52, \'DROP DATABASE\' = 53, \'DROP TABLE\' = 54, \'DROP VIEW\' = 55, \'DROP DICTIONARY\' = 56, \'DROP FUNCTION\' = 57, \'DROP\' = 58, \'TRUNCATE\' = 59, \'OPTIMIZE\' = 60, \'KILL QUERY\' = 61, \'KILL TRANSACTION\' = 62, \'MOVE PARTITION BETWEEN SHARDS\' = 63, \'CREATE USER\' = 64, \'ALTER USER\' = 65, \'DROP USER\' = 66, \'CREATE ROLE\' = 67, \'ALTER ROLE\' = 68, \'DROP ROLE\' = 69, \'ROLE ADMIN\' = 70, \'CREATE ROW POLICY\' = 71, \'ALTER ROW POLICY\' = 72, \'DROP ROW POLICY\' = 73, \'CREATE QUOTA\' = 74, \'ALTER QUOTA\' = 75, \'DROP QUOTA\' = 76, \'CREATE SETTINGS PROFILE\' = 77, \'ALTER SETTINGS PROFILE\' = 78, \'DROP SETTINGS PROFILE\' = 79, \'SHOW USERS\' = 80, \'SHOW ROLES\' = 81, \'SHOW ROW POLICIES\' = 82, \'SHOW QUOTAS\' = 83, \'SHOW SETTINGS PROFILES\' = 84, \'SHOW ACCESS\' = 85, \'ACCESS MANAGEMENT\' = 86, \'SYSTEM SHUTDOWN\' = 87, \'SYSTEM DROP DNS CACHE\' = 88, \'SYSTEM DROP MARK CACHE\' = 89, \'SYSTEM DROP UNCOMPRESSED CACHE\' = 90, \'SYSTEM DROP MMAP CACHE\' = 91, \'SYSTEM DROP COMPILED EXPRESSION CACHE\' = 92, \'SYSTEM DROP CACHE\' = 93, \'SYSTEM RELOAD CONFIG\' = 94, \'SYSTEM RELOAD SYMBOLS\' = 95, \'SYSTEM RELOAD DICTIONARY\' = 96, \'SYSTEM RELOAD MODEL\' = 97, \'SYSTEM RELOAD FUNCTION\' = 98, \'SYSTEM RELOAD EMBEDDED DICTIONARIES\' = 99, \'SYSTEM RELOAD\' = 100, \'SYSTEM RESTART DISK\' = 101, \'SYSTEM MERGES\' = 102, \'SYSTEM TTL MERGES\' = 103, \'SYSTEM FETCHES\' = 104, \'SYSTEM MOVES\' = 105, \'SYSTEM DISTRIBUTED SENDS\' = 106, \'SYSTEM REPLICATED SENDS\' = 107, \'SYSTEM SENDS\' = 108, \'SYSTEM REPLICATION QUEUES\' = 109, \'SYSTEM DROP REPLICA\' = 110, \'SYSTEM SYNC REPLICA\' = 111, \'SYSTEM RESTART REPLICA\' = 112, \'SYSTEM RESTORE REPLICA\' = 113, \'SYSTEM FLUSH DISTRIBUTED\' = 114, \'SYSTEM FLUSH LOGS\' = 115, \'SYSTEM FLUSH\' = 116, \'SYSTEM THREAD FUZZER\' = 117, \'SYSTEM\' = 118, \'dictGet\' = 119, \'addressToLine\' = 120, \'addressToLineWithInlines\' = 121, \'addressToSymbol\' = 122, \'demangle\' = 123, \'INTROSPECTION\' = 124, \'FILE\' = 125, \'URL\' = 126, \'REMOTE\' = 127, \'MONGO\' = 128, \'MYSQL\' = 129, \'POSTGRES\' = 130, \'SQLITE\' = 131, \'ODBC\' = 132, \'JDBC\' = 133, \'HDFS\' = 134, \'S3\' = 135, \'HIVE\' = 136, \'SOURCES\' = 137, \'ALL\' = 138, \'NONE\' = 139))\n)\nENGINE = SystemPrivileges()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.processes\n(\n `is_initial_query` UInt8,\n `user` String,\n `query_id` String,\n `address` IPv6,\n `port` UInt16,\n `initial_user` String,\n `initial_query_id` String,\n `initial_address` IPv6,\n `initial_port` UInt16,\n `interface` UInt8,\n `os_user` String,\n `client_hostname` String,\n `client_name` String,\n `client_revision` UInt64,\n `client_version_major` UInt64,\n `client_version_minor` UInt64,\n `client_version_patch` UInt64,\n `http_method` UInt8,\n `http_user_agent` String,\n `http_referer` String,\n `forwarded_for` String,\n `quota_key` String,\n `distributed_depth` UInt64,\n `elapsed` Float64,\n `is_cancelled` UInt8,\n `read_rows` UInt64,\n `read_bytes` UInt64,\n `total_rows_approx` UInt64,\n `written_rows` UInt64,\n `written_bytes` UInt64,\n `memory_usage` Int64,\n `peak_memory_usage` Int64,\n `query` String,\n `thread_ids` Array(UInt64),\n `ProfileEvents` Map(String, UInt64),\n `Settings` Map(String, String),\n `current_database` String,\n `ProfileEvents.Names` Array(String),\n `ProfileEvents.Values` Array(UInt64),\n `Settings.Names` Array(String),\n `Settings.Values` Array(String)\n)\nENGINE = SystemProcesses()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' +CREATE TABLE system.processes\n(\n `is_initial_query` UInt8,\n `user` String,\n `query_id` String,\n `address` IPv6,\n `port` UInt16,\n `initial_user` String,\n `initial_query_id` String,\n `initial_address` IPv6,\n `initial_port` UInt16,\n `interface` UInt8,\n `os_user` String,\n `client_hostname` String,\n `client_name` String,\n `client_revision` UInt64,\n `client_version_major` UInt64,\n `client_version_minor` UInt64,\n `client_version_patch` UInt64,\n `http_method` UInt8,\n `http_user_agent` String,\n `http_referer` String,\n `forwarded_for` String,\n `quota_key` String,\n `distributed_depth` UInt64,\n `elapsed` Float64,\n `is_cancelled` UInt8,\n `is_all_data_sent` UInt8,\n `read_rows` UInt64,\n `read_bytes` UInt64,\n `total_rows_approx` UInt64,\n `written_rows` UInt64,\n `written_bytes` UInt64,\n `memory_usage` Int64,\n `peak_memory_usage` Int64,\n `query` String,\n `thread_ids` Array(UInt64),\n `ProfileEvents` Map(String, UInt64),\n `Settings` Map(String, String),\n `current_database` String,\n `ProfileEvents.Names` Array(String),\n `ProfileEvents.Values` Array(UInt64),\n `Settings.Names` Array(String),\n `Settings.Values` Array(String)\n)\nENGINE = SystemProcesses()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' CREATE TABLE system.projection_parts\n(\n `partition` String,\n `name` String,\n `part_type` String,\n `parent_name` String,\n `parent_uuid` UUID,\n `parent_part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `parent_marks` UInt64,\n `parent_rows` UInt64,\n `parent_bytes_on_disk` UInt64,\n `parent_data_compressed_bytes` UInt64,\n `parent_data_uncompressed_bytes` UInt64,\n `parent_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `is_frozen` UInt8,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `hash_of_all_files` String,\n `hash_of_uncompressed_files` String,\n `uncompressed_hash_of_compressed_files` String,\n `delete_ttl_info_min` DateTime,\n `delete_ttl_info_max` DateTime,\n `move_ttl_info.expression` Array(String),\n `move_ttl_info.min` Array(DateTime),\n `move_ttl_info.max` Array(DateTime),\n `default_compression_codec` String,\n `recompression_ttl_info.expression` Array(String),\n `recompression_ttl_info.min` Array(DateTime),\n `recompression_ttl_info.max` Array(DateTime),\n `group_by_ttl_info.expression` Array(String),\n `group_by_ttl_info.min` Array(DateTime),\n `group_by_ttl_info.max` Array(DateTime),\n `rows_where_ttl_info.expression` Array(String),\n `rows_where_ttl_info.min` Array(DateTime),\n `rows_where_ttl_info.max` Array(DateTime),\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemProjectionParts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' CREATE TABLE system.projection_parts_columns\n(\n `partition` String,\n `name` String,\n `part_type` String,\n `parent_name` String,\n `parent_uuid` UUID,\n `parent_part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `parent_marks` UInt64,\n `parent_rows` UInt64,\n `parent_bytes_on_disk` UInt64,\n `parent_data_compressed_bytes` UInt64,\n `parent_data_uncompressed_bytes` UInt64,\n `parent_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `column` String,\n `type` String,\n `column_position` UInt64,\n `default_kind` String,\n `default_expression` String,\n `column_bytes_on_disk` UInt64,\n `column_data_compressed_bytes` UInt64,\n `column_data_uncompressed_bytes` UInt64,\n `column_marks_bytes` UInt64,\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemProjectionPartsColumns()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' CREATE TABLE system.quota_limits\n(\n `quota_name` String,\n `duration` UInt32,\n `is_randomized_interval` UInt8,\n `max_queries` Nullable(UInt64),\n `max_query_selects` Nullable(UInt64),\n `max_query_inserts` Nullable(UInt64),\n `max_errors` Nullable(UInt64),\n `max_result_rows` Nullable(UInt64),\n `max_result_bytes` Nullable(UInt64),\n `max_read_rows` Nullable(UInt64),\n `max_read_bytes` Nullable(UInt64),\n `max_execution_time` Nullable(Float64),\n `max_written_bytes` Nullable(UInt64)\n)\nENGINE = SystemQuotaLimits()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' From 87421d81ce6c74d65b4d2da0a7861e81460eee24 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Apr 2022 12:13:28 +0300 Subject: [PATCH 27/34] tests: use TSVRaw format in 02117_show_create_table_system Signed-off-by: Azat Khuzhin --- .../02117_show_create_table_system.reference | 1179 ++++++++++++++++- .../02117_show_create_table_system.sql | 132 +- 2 files changed, 1179 insertions(+), 132 deletions(-) diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index 70b8d79079c..a67cf5770bf 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_system.reference @@ -1,66 +1,1113 @@ -CREATE TABLE system.aggregate_function_combinators\n(\n `name` String,\n `is_internal` UInt8\n)\nENGINE = SystemAggregateFunctionCombinators()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.asynchronous_inserts\n(\n `query` String,\n `database` String,\n `table` String,\n `format` String,\n `first_update` DateTime64(6),\n `last_update` DateTime64(6),\n `total_bytes` UInt64,\n `entries.query_id` Array(String),\n `entries.bytes` Array(UInt64),\n `entries.finished` Array(UInt8),\n `entries.exception` Array(String)\n)\nENGINE = SystemAsynchronousInserts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.asynchronous_metrics\n(\n `metric` String,\n `value` Float64\n)\nENGINE = SystemAsynchronousMetrics()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.build_options\n(\n `name` String,\n `value` String\n)\nENGINE = SystemBuildOptions()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.clusters\n(\n `cluster` String,\n `shard_num` UInt32,\n `shard_weight` UInt32,\n `replica_num` UInt32,\n `host_name` String,\n `host_address` String,\n `port` UInt16,\n `is_local` UInt8,\n `user` String,\n `default_database` String,\n `errors_count` UInt32,\n `slowdowns_count` UInt32,\n `estimated_recovery_time` UInt32\n)\nENGINE = SystemClusters()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.collations\n(\n `name` String,\n `language` Nullable(String)\n)\nENGINE = SystemTableCollations()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.columns\n(\n `database` String,\n `table` String,\n `name` String,\n `type` String,\n `position` UInt64,\n `default_kind` String,\n `default_expression` String,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `comment` String,\n `is_in_partition_key` UInt8,\n `is_in_sorting_key` UInt8,\n `is_in_primary_key` UInt8,\n `is_in_sampling_key` UInt8,\n `compression_codec` String,\n `character_octet_length` Nullable(UInt64),\n `numeric_precision` Nullable(UInt64),\n `numeric_precision_radix` Nullable(UInt64),\n `numeric_scale` Nullable(UInt64),\n `datetime_precision` Nullable(UInt64)\n)\nENGINE = SystemColumns()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.contributors\n(\n `name` String\n)\nENGINE = SystemContributors()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.current_roles\n(\n `role_name` String,\n `with_admin_option` UInt8,\n `is_default` UInt8\n)\nENGINE = SystemCurrentRoles()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.data_skipping_indices\n(\n `database` String,\n `table` String,\n `name` String,\n `type` String,\n `expr` String,\n `granularity` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks` UInt64\n)\nENGINE = SystemDataSkippingIndices()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.data_type_families\n(\n `name` String,\n `case_insensitive` UInt8,\n `alias_to` String\n)\nENGINE = SystemTableDataTypeFamilies()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.databases\n(\n `name` String,\n `engine` String,\n `data_path` String,\n `metadata_path` String,\n `uuid` UUID,\n `comment` String,\n `database` String\n)\nENGINE = SystemDatabases()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.detached_parts\n(\n `database` String,\n `table` String,\n `partition_id` Nullable(String),\n `name` String,\n `disk` String,\n `reason` Nullable(String),\n `min_block_number` Nullable(Int64),\n `max_block_number` Nullable(Int64),\n `level` Nullable(UInt32)\n)\nENGINE = SystemDetachedParts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.dictionaries\n(\n `database` String,\n `name` String,\n `uuid` UUID,\n `status` Enum8(\'NOT_LOADED\' = 0, \'LOADED\' = 1, \'FAILED\' = 2, \'LOADING\' = 3, \'FAILED_AND_RELOADING\' = 4, \'LOADED_AND_RELOADING\' = 5, \'NOT_EXIST\' = 6),\n `origin` String,\n `type` String,\n `key.names` Array(String),\n `key.types` Array(String),\n `attribute.names` Array(String),\n `attribute.types` Array(String),\n `bytes_allocated` UInt64,\n `query_count` UInt64,\n `hit_rate` Float64,\n `found_rate` Float64,\n `element_count` UInt64,\n `load_factor` Float64,\n `source` String,\n `lifetime_min` UInt64,\n `lifetime_max` UInt64,\n `loading_start_time` DateTime,\n `last_successful_update_time` DateTime,\n `loading_duration` Float32,\n `last_exception` String,\n `comment` String\n)\nENGINE = SystemDictionaries()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.disks\n(\n `name` String,\n `path` String,\n `free_space` UInt64,\n `total_space` UInt64,\n `keep_free_space` UInt64,\n `type` String,\n `cache_path` String\n)\nENGINE = SystemDisks()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.distributed_ddl_queue\n(\n `entry` String,\n `entry_version` Nullable(UInt8),\n `initiator_host` Nullable(String),\n `initiator_port` Nullable(UInt16),\n `cluster` String,\n `query` String,\n `settings` Map(String, String),\n `query_create_time` DateTime,\n `host` Nullable(String),\n `port` Nullable(UInt16),\n `status` Nullable(Enum8(\'Inactive\' = 0, \'Active\' = 1, \'Finished\' = 2, \'Removing\' = 3, \'Unknown\' = 4)),\n `exception_code` Nullable(UInt16),\n `exception_text` Nullable(String),\n `query_finish_time` Nullable(DateTime),\n `query_duration_ms` Nullable(UInt64)\n)\nENGINE = SystemDDLWorkerQueue()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.distribution_queue\n(\n `database` String,\n `table` String,\n `data_path` String,\n `is_blocked` UInt8,\n `error_count` UInt64,\n `data_files` UInt64,\n `data_compressed_bytes` UInt64,\n `broken_data_files` UInt64,\n `broken_data_compressed_bytes` UInt64,\n `last_exception` String\n)\nENGINE = SystemDistributionQueue()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.enabled_roles\n(\n `role_name` String,\n `with_admin_option` UInt8,\n `is_current` UInt8,\n `is_default` UInt8\n)\nENGINE = SystemEnabledRoles()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.errors\n(\n `name` String,\n `code` Int32,\n `value` UInt64,\n `last_error_time` DateTime,\n `last_error_message` String,\n `last_error_trace` Array(UInt64),\n `remote` UInt8\n)\nENGINE = SystemErrors()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.events\n(\n `event` String,\n `value` UInt64,\n `description` String\n)\nENGINE = SystemEvents()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.formats\n(\n `name` String,\n `is_input` UInt8,\n `is_output` UInt8\n)\nENGINE = SystemFormats()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.functions\n(\n `name` String,\n `is_aggregate` UInt8,\n `case_insensitive` UInt8,\n `alias_to` String,\n `create_query` String,\n `origin` Enum8(\'System\' = 0, \'SQLUserDefined\' = 1, \'ExecutableUserDefined\' = 2)\n)\nENGINE = SystemFunctions()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.grants\n(\n `user_name` Nullable(String),\n `role_name` Nullable(String),\n `access_type` Enum16(\'SHOW DATABASES\' = 0, \'SHOW TABLES\' = 1, \'SHOW COLUMNS\' = 2, \'SHOW DICTIONARIES\' = 3, \'SHOW\' = 4, \'SELECT\' = 5, \'INSERT\' = 6, \'ALTER UPDATE\' = 7, \'ALTER DELETE\' = 8, \'ALTER ADD COLUMN\' = 9, \'ALTER MODIFY COLUMN\' = 10, \'ALTER DROP COLUMN\' = 11, \'ALTER COMMENT COLUMN\' = 12, \'ALTER CLEAR COLUMN\' = 13, \'ALTER RENAME COLUMN\' = 14, \'ALTER MATERIALIZE COLUMN\' = 15, \'ALTER COLUMN\' = 16, \'ALTER MODIFY COMMENT\' = 17, \'ALTER ORDER BY\' = 18, \'ALTER SAMPLE BY\' = 19, \'ALTER ADD INDEX\' = 20, \'ALTER DROP INDEX\' = 21, \'ALTER MATERIALIZE INDEX\' = 22, \'ALTER CLEAR INDEX\' = 23, \'ALTER INDEX\' = 24, \'ALTER ADD PROJECTION\' = 25, \'ALTER DROP PROJECTION\' = 26, \'ALTER MATERIALIZE PROJECTION\' = 27, \'ALTER CLEAR PROJECTION\' = 28, \'ALTER PROJECTION\' = 29, \'ALTER ADD CONSTRAINT\' = 30, \'ALTER DROP CONSTRAINT\' = 31, \'ALTER CONSTRAINT\' = 32, \'ALTER TTL\' = 33, \'ALTER MATERIALIZE TTL\' = 34, \'ALTER SETTINGS\' = 35, \'ALTER MOVE PARTITION\' = 36, \'ALTER FETCH PARTITION\' = 37, \'ALTER FREEZE PARTITION\' = 38, \'ALTER DATABASE SETTINGS\' = 39, \'ALTER TABLE\' = 40, \'ALTER DATABASE\' = 41, \'ALTER VIEW REFRESH\' = 42, \'ALTER VIEW MODIFY QUERY\' = 43, \'ALTER VIEW\' = 44, \'ALTER\' = 45, \'CREATE DATABASE\' = 46, \'CREATE TABLE\' = 47, \'CREATE VIEW\' = 48, \'CREATE DICTIONARY\' = 49, \'CREATE TEMPORARY TABLE\' = 50, \'CREATE FUNCTION\' = 51, \'CREATE\' = 52, \'DROP DATABASE\' = 53, \'DROP TABLE\' = 54, \'DROP VIEW\' = 55, \'DROP DICTIONARY\' = 56, \'DROP FUNCTION\' = 57, \'DROP\' = 58, \'TRUNCATE\' = 59, \'OPTIMIZE\' = 60, \'KILL QUERY\' = 61, \'KILL TRANSACTION\' = 62, \'MOVE PARTITION BETWEEN SHARDS\' = 63, \'CREATE USER\' = 64, \'ALTER USER\' = 65, \'DROP USER\' = 66, \'CREATE ROLE\' = 67, \'ALTER ROLE\' = 68, \'DROP ROLE\' = 69, \'ROLE ADMIN\' = 70, \'CREATE ROW POLICY\' = 71, \'ALTER ROW POLICY\' = 72, \'DROP ROW POLICY\' = 73, \'CREATE QUOTA\' = 74, \'ALTER QUOTA\' = 75, \'DROP QUOTA\' = 76, \'CREATE SETTINGS PROFILE\' = 77, \'ALTER SETTINGS PROFILE\' = 78, \'DROP SETTINGS PROFILE\' = 79, \'SHOW USERS\' = 80, \'SHOW ROLES\' = 81, \'SHOW ROW POLICIES\' = 82, \'SHOW QUOTAS\' = 83, \'SHOW SETTINGS PROFILES\' = 84, \'SHOW ACCESS\' = 85, \'ACCESS MANAGEMENT\' = 86, \'SYSTEM SHUTDOWN\' = 87, \'SYSTEM DROP DNS CACHE\' = 88, \'SYSTEM DROP MARK CACHE\' = 89, \'SYSTEM DROP UNCOMPRESSED CACHE\' = 90, \'SYSTEM DROP MMAP CACHE\' = 91, \'SYSTEM DROP COMPILED EXPRESSION CACHE\' = 92, \'SYSTEM DROP CACHE\' = 93, \'SYSTEM RELOAD CONFIG\' = 94, \'SYSTEM RELOAD SYMBOLS\' = 95, \'SYSTEM RELOAD DICTIONARY\' = 96, \'SYSTEM RELOAD MODEL\' = 97, \'SYSTEM RELOAD FUNCTION\' = 98, \'SYSTEM RELOAD EMBEDDED DICTIONARIES\' = 99, \'SYSTEM RELOAD\' = 100, \'SYSTEM RESTART DISK\' = 101, \'SYSTEM MERGES\' = 102, \'SYSTEM TTL MERGES\' = 103, \'SYSTEM FETCHES\' = 104, \'SYSTEM MOVES\' = 105, \'SYSTEM DISTRIBUTED SENDS\' = 106, \'SYSTEM REPLICATED SENDS\' = 107, \'SYSTEM SENDS\' = 108, \'SYSTEM REPLICATION QUEUES\' = 109, \'SYSTEM DROP REPLICA\' = 110, \'SYSTEM SYNC REPLICA\' = 111, \'SYSTEM RESTART REPLICA\' = 112, \'SYSTEM RESTORE REPLICA\' = 113, \'SYSTEM FLUSH DISTRIBUTED\' = 114, \'SYSTEM FLUSH LOGS\' = 115, \'SYSTEM FLUSH\' = 116, \'SYSTEM THREAD FUZZER\' = 117, \'SYSTEM\' = 118, \'dictGet\' = 119, \'addressToLine\' = 120, \'addressToLineWithInlines\' = 121, \'addressToSymbol\' = 122, \'demangle\' = 123, \'INTROSPECTION\' = 124, \'FILE\' = 125, \'URL\' = 126, \'REMOTE\' = 127, \'MONGO\' = 128, \'MYSQL\' = 129, \'POSTGRES\' = 130, \'SQLITE\' = 131, \'ODBC\' = 132, \'JDBC\' = 133, \'HDFS\' = 134, \'S3\' = 135, \'HIVE\' = 136, \'SOURCES\' = 137, \'ALL\' = 138, \'NONE\' = 139),\n `database` Nullable(String),\n `table` Nullable(String),\n `column` Nullable(String),\n `is_partial_revoke` UInt8,\n `grant_option` UInt8\n)\nENGINE = SystemGrants()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.graphite_retentions\n(\n `config_name` String,\n `rule_type` String,\n `regexp` String,\n `function` String,\n `age` UInt64,\n `precision` UInt64,\n `priority` UInt16,\n `is_default` UInt8,\n `Tables.database` Array(String),\n `Tables.table` Array(String)\n)\nENGINE = SystemGraphite()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.licenses\n(\n `library_name` String,\n `license_type` String,\n `license_path` String,\n `license_text` String\n)\nENGINE = SystemLicenses()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.macros\n(\n `macro` String,\n `substitution` String\n)\nENGINE = SystemMacros()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.merge_tree_settings\n(\n `name` String,\n `value` String,\n `changed` UInt8,\n `description` String,\n `type` String\n)\nENGINE = SystemMergeTreeSettings()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.merges\n(\n `database` String,\n `table` String,\n `elapsed` Float64,\n `progress` Float64,\n `num_parts` UInt64,\n `source_part_names` Array(String),\n `result_part_name` String,\n `source_part_paths` Array(String),\n `result_part_path` String,\n `partition_id` String,\n `is_mutation` UInt8,\n `total_size_bytes_compressed` UInt64,\n `total_size_marks` UInt64,\n `bytes_read_uncompressed` UInt64,\n `rows_read` UInt64,\n `bytes_written_uncompressed` UInt64,\n `rows_written` UInt64,\n `columns_written` UInt64,\n `memory_usage` UInt64,\n `thread_id` UInt64,\n `merge_type` String,\n `merge_algorithm` String\n)\nENGINE = SystemMerges()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.metrics\n(\n `metric` String,\n `value` Int64,\n `description` String\n)\nENGINE = SystemMetrics()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.models\n(\n `name` String,\n `status` Enum8(\'NOT_LOADED\' = 0, \'LOADED\' = 1, \'FAILED\' = 2, \'LOADING\' = 3, \'FAILED_AND_RELOADING\' = 4, \'LOADED_AND_RELOADING\' = 5, \'NOT_EXIST\' = 6),\n `origin` String,\n `type` String,\n `loading_start_time` DateTime,\n `loading_duration` Float32,\n `last_exception` String\n)\nENGINE = SystemModels()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.mutations\n(\n `database` String,\n `table` String,\n `mutation_id` String,\n `command` String,\n `create_time` DateTime,\n `block_numbers.partition_id` Array(String),\n `block_numbers.number` Array(Int64),\n `parts_to_do_names` Array(String),\n `parts_to_do` Int64,\n `is_done` UInt8,\n `latest_failed_part` String,\n `latest_fail_time` DateTime,\n `latest_fail_reason` String\n)\nENGINE = SystemMutations()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.numbers\n(\n `number` UInt64\n)\nENGINE = SystemNumbers()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.numbers_mt\n(\n `number` UInt64\n)\nENGINE = SystemNumbers()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.one\n(\n `dummy` UInt8\n)\nENGINE = SystemOne()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.part_moves_between_shards\n(\n `database` String,\n `table` String,\n `task_name` String,\n `task_uuid` UUID,\n `create_time` DateTime,\n `part_name` String,\n `part_uuid` UUID,\n `to_shard` String,\n `dst_part_name` String,\n `update_time` DateTime,\n `state` String,\n `rollback` UInt8,\n `num_tries` UInt32,\n `last_exception` String\n)\nENGINE = SystemShardMoves()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.parts\n(\n `partition` String,\n `name` String,\n `uuid` UUID,\n `part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `secondary_indices_compressed_bytes` UInt64,\n `secondary_indices_uncompressed_bytes` UInt64,\n `secondary_indices_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `is_frozen` UInt8,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `hash_of_all_files` String,\n `hash_of_uncompressed_files` String,\n `uncompressed_hash_of_compressed_files` String,\n `delete_ttl_info_min` DateTime,\n `delete_ttl_info_max` DateTime,\n `move_ttl_info.expression` Array(String),\n `move_ttl_info.min` Array(DateTime),\n `move_ttl_info.max` Array(DateTime),\n `default_compression_codec` String,\n `recompression_ttl_info.expression` Array(String),\n `recompression_ttl_info.min` Array(DateTime),\n `recompression_ttl_info.max` Array(DateTime),\n `group_by_ttl_info.expression` Array(String),\n `group_by_ttl_info.min` Array(DateTime),\n `group_by_ttl_info.max` Array(DateTime),\n `rows_where_ttl_info.expression` Array(String),\n `rows_where_ttl_info.min` Array(DateTime),\n `rows_where_ttl_info.max` Array(DateTime),\n `projections` Array(String),\n `visible` UInt8,\n `creation_tid` Tuple(UInt64, UInt64, UUID),\n `removal_tid` Tuple(UInt64, UInt64, UUID),\n `creation_csn` UInt64,\n `removal_csn` UInt64,\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemParts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.parts_columns\n(\n `partition` String,\n `name` String,\n `uuid` UUID,\n `part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `column` String,\n `type` String,\n `column_position` UInt64,\n `default_kind` String,\n `default_expression` String,\n `column_bytes_on_disk` UInt64,\n `column_data_compressed_bytes` UInt64,\n `column_data_uncompressed_bytes` UInt64,\n `column_marks_bytes` UInt64,\n `serialization_kind` String,\n `subcolumns.names` Array(String),\n `subcolumns.types` Array(String),\n `subcolumns.serializations` Array(String),\n `subcolumns.bytes_on_disk` Array(UInt64),\n `subcolumns.data_compressed_bytes` Array(UInt64),\n `subcolumns.data_uncompressed_bytes` Array(UInt64),\n `subcolumns.marks_bytes` Array(UInt64),\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemPartsColumns()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.privileges\n(\n `privilege` Enum16(\'SHOW DATABASES\' = 0, \'SHOW TABLES\' = 1, \'SHOW COLUMNS\' = 2, \'SHOW DICTIONARIES\' = 3, \'SHOW\' = 4, \'SELECT\' = 5, \'INSERT\' = 6, \'ALTER UPDATE\' = 7, \'ALTER DELETE\' = 8, \'ALTER ADD COLUMN\' = 9, \'ALTER MODIFY COLUMN\' = 10, \'ALTER DROP COLUMN\' = 11, \'ALTER COMMENT COLUMN\' = 12, \'ALTER CLEAR COLUMN\' = 13, \'ALTER RENAME COLUMN\' = 14, \'ALTER MATERIALIZE COLUMN\' = 15, \'ALTER COLUMN\' = 16, \'ALTER MODIFY COMMENT\' = 17, \'ALTER ORDER BY\' = 18, \'ALTER SAMPLE BY\' = 19, \'ALTER ADD INDEX\' = 20, \'ALTER DROP INDEX\' = 21, \'ALTER MATERIALIZE INDEX\' = 22, \'ALTER CLEAR INDEX\' = 23, \'ALTER INDEX\' = 24, \'ALTER ADD PROJECTION\' = 25, \'ALTER DROP PROJECTION\' = 26, \'ALTER MATERIALIZE PROJECTION\' = 27, \'ALTER CLEAR PROJECTION\' = 28, \'ALTER PROJECTION\' = 29, \'ALTER ADD CONSTRAINT\' = 30, \'ALTER DROP CONSTRAINT\' = 31, \'ALTER CONSTRAINT\' = 32, \'ALTER TTL\' = 33, \'ALTER MATERIALIZE TTL\' = 34, \'ALTER SETTINGS\' = 35, \'ALTER MOVE PARTITION\' = 36, \'ALTER FETCH PARTITION\' = 37, \'ALTER FREEZE PARTITION\' = 38, \'ALTER DATABASE SETTINGS\' = 39, \'ALTER TABLE\' = 40, \'ALTER DATABASE\' = 41, \'ALTER VIEW REFRESH\' = 42, \'ALTER VIEW MODIFY QUERY\' = 43, \'ALTER VIEW\' = 44, \'ALTER\' = 45, \'CREATE DATABASE\' = 46, \'CREATE TABLE\' = 47, \'CREATE VIEW\' = 48, \'CREATE DICTIONARY\' = 49, \'CREATE TEMPORARY TABLE\' = 50, \'CREATE FUNCTION\' = 51, \'CREATE\' = 52, \'DROP DATABASE\' = 53, \'DROP TABLE\' = 54, \'DROP VIEW\' = 55, \'DROP DICTIONARY\' = 56, \'DROP FUNCTION\' = 57, \'DROP\' = 58, \'TRUNCATE\' = 59, \'OPTIMIZE\' = 60, \'KILL QUERY\' = 61, \'KILL TRANSACTION\' = 62, \'MOVE PARTITION BETWEEN SHARDS\' = 63, \'CREATE USER\' = 64, \'ALTER USER\' = 65, \'DROP USER\' = 66, \'CREATE ROLE\' = 67, \'ALTER ROLE\' = 68, \'DROP ROLE\' = 69, \'ROLE ADMIN\' = 70, \'CREATE ROW POLICY\' = 71, \'ALTER ROW POLICY\' = 72, \'DROP ROW POLICY\' = 73, \'CREATE QUOTA\' = 74, \'ALTER QUOTA\' = 75, \'DROP QUOTA\' = 76, \'CREATE SETTINGS PROFILE\' = 77, \'ALTER SETTINGS PROFILE\' = 78, \'DROP SETTINGS PROFILE\' = 79, \'SHOW USERS\' = 80, \'SHOW ROLES\' = 81, \'SHOW ROW POLICIES\' = 82, \'SHOW QUOTAS\' = 83, \'SHOW SETTINGS PROFILES\' = 84, \'SHOW ACCESS\' = 85, \'ACCESS MANAGEMENT\' = 86, \'SYSTEM SHUTDOWN\' = 87, \'SYSTEM DROP DNS CACHE\' = 88, \'SYSTEM DROP MARK CACHE\' = 89, \'SYSTEM DROP UNCOMPRESSED CACHE\' = 90, \'SYSTEM DROP MMAP CACHE\' = 91, \'SYSTEM DROP COMPILED EXPRESSION CACHE\' = 92, \'SYSTEM DROP CACHE\' = 93, \'SYSTEM RELOAD CONFIG\' = 94, \'SYSTEM RELOAD SYMBOLS\' = 95, \'SYSTEM RELOAD DICTIONARY\' = 96, \'SYSTEM RELOAD MODEL\' = 97, \'SYSTEM RELOAD FUNCTION\' = 98, \'SYSTEM RELOAD EMBEDDED DICTIONARIES\' = 99, \'SYSTEM RELOAD\' = 100, \'SYSTEM RESTART DISK\' = 101, \'SYSTEM MERGES\' = 102, \'SYSTEM TTL MERGES\' = 103, \'SYSTEM FETCHES\' = 104, \'SYSTEM MOVES\' = 105, \'SYSTEM DISTRIBUTED SENDS\' = 106, \'SYSTEM REPLICATED SENDS\' = 107, \'SYSTEM SENDS\' = 108, \'SYSTEM REPLICATION QUEUES\' = 109, \'SYSTEM DROP REPLICA\' = 110, \'SYSTEM SYNC REPLICA\' = 111, \'SYSTEM RESTART REPLICA\' = 112, \'SYSTEM RESTORE REPLICA\' = 113, \'SYSTEM FLUSH DISTRIBUTED\' = 114, \'SYSTEM FLUSH LOGS\' = 115, \'SYSTEM FLUSH\' = 116, \'SYSTEM THREAD FUZZER\' = 117, \'SYSTEM\' = 118, \'dictGet\' = 119, \'addressToLine\' = 120, \'addressToLineWithInlines\' = 121, \'addressToSymbol\' = 122, \'demangle\' = 123, \'INTROSPECTION\' = 124, \'FILE\' = 125, \'URL\' = 126, \'REMOTE\' = 127, \'MONGO\' = 128, \'MYSQL\' = 129, \'POSTGRES\' = 130, \'SQLITE\' = 131, \'ODBC\' = 132, \'JDBC\' = 133, \'HDFS\' = 134, \'S3\' = 135, \'HIVE\' = 136, \'SOURCES\' = 137, \'ALL\' = 138, \'NONE\' = 139),\n `aliases` Array(String),\n `level` Nullable(Enum8(\'GLOBAL\' = 0, \'DATABASE\' = 1, \'TABLE\' = 2, \'DICTIONARY\' = 3, \'VIEW\' = 4, \'COLUMN\' = 5)),\n `parent_group` Nullable(Enum16(\'SHOW DATABASES\' = 0, \'SHOW TABLES\' = 1, \'SHOW COLUMNS\' = 2, \'SHOW DICTIONARIES\' = 3, \'SHOW\' = 4, \'SELECT\' = 5, \'INSERT\' = 6, \'ALTER UPDATE\' = 7, \'ALTER DELETE\' = 8, \'ALTER ADD COLUMN\' = 9, \'ALTER MODIFY COLUMN\' = 10, \'ALTER DROP COLUMN\' = 11, \'ALTER COMMENT COLUMN\' = 12, \'ALTER CLEAR COLUMN\' = 13, \'ALTER RENAME COLUMN\' = 14, \'ALTER MATERIALIZE COLUMN\' = 15, \'ALTER COLUMN\' = 16, \'ALTER MODIFY COMMENT\' = 17, \'ALTER ORDER BY\' = 18, \'ALTER SAMPLE BY\' = 19, \'ALTER ADD INDEX\' = 20, \'ALTER DROP INDEX\' = 21, \'ALTER MATERIALIZE INDEX\' = 22, \'ALTER CLEAR INDEX\' = 23, \'ALTER INDEX\' = 24, \'ALTER ADD PROJECTION\' = 25, \'ALTER DROP PROJECTION\' = 26, \'ALTER MATERIALIZE PROJECTION\' = 27, \'ALTER CLEAR PROJECTION\' = 28, \'ALTER PROJECTION\' = 29, \'ALTER ADD CONSTRAINT\' = 30, \'ALTER DROP CONSTRAINT\' = 31, \'ALTER CONSTRAINT\' = 32, \'ALTER TTL\' = 33, \'ALTER MATERIALIZE TTL\' = 34, \'ALTER SETTINGS\' = 35, \'ALTER MOVE PARTITION\' = 36, \'ALTER FETCH PARTITION\' = 37, \'ALTER FREEZE PARTITION\' = 38, \'ALTER DATABASE SETTINGS\' = 39, \'ALTER TABLE\' = 40, \'ALTER DATABASE\' = 41, \'ALTER VIEW REFRESH\' = 42, \'ALTER VIEW MODIFY QUERY\' = 43, \'ALTER VIEW\' = 44, \'ALTER\' = 45, \'CREATE DATABASE\' = 46, \'CREATE TABLE\' = 47, \'CREATE VIEW\' = 48, \'CREATE DICTIONARY\' = 49, \'CREATE TEMPORARY TABLE\' = 50, \'CREATE FUNCTION\' = 51, \'CREATE\' = 52, \'DROP DATABASE\' = 53, \'DROP TABLE\' = 54, \'DROP VIEW\' = 55, \'DROP DICTIONARY\' = 56, \'DROP FUNCTION\' = 57, \'DROP\' = 58, \'TRUNCATE\' = 59, \'OPTIMIZE\' = 60, \'KILL QUERY\' = 61, \'KILL TRANSACTION\' = 62, \'MOVE PARTITION BETWEEN SHARDS\' = 63, \'CREATE USER\' = 64, \'ALTER USER\' = 65, \'DROP USER\' = 66, \'CREATE ROLE\' = 67, \'ALTER ROLE\' = 68, \'DROP ROLE\' = 69, \'ROLE ADMIN\' = 70, \'CREATE ROW POLICY\' = 71, \'ALTER ROW POLICY\' = 72, \'DROP ROW POLICY\' = 73, \'CREATE QUOTA\' = 74, \'ALTER QUOTA\' = 75, \'DROP QUOTA\' = 76, \'CREATE SETTINGS PROFILE\' = 77, \'ALTER SETTINGS PROFILE\' = 78, \'DROP SETTINGS PROFILE\' = 79, \'SHOW USERS\' = 80, \'SHOW ROLES\' = 81, \'SHOW ROW POLICIES\' = 82, \'SHOW QUOTAS\' = 83, \'SHOW SETTINGS PROFILES\' = 84, \'SHOW ACCESS\' = 85, \'ACCESS MANAGEMENT\' = 86, \'SYSTEM SHUTDOWN\' = 87, \'SYSTEM DROP DNS CACHE\' = 88, \'SYSTEM DROP MARK CACHE\' = 89, \'SYSTEM DROP UNCOMPRESSED CACHE\' = 90, \'SYSTEM DROP MMAP CACHE\' = 91, \'SYSTEM DROP COMPILED EXPRESSION CACHE\' = 92, \'SYSTEM DROP CACHE\' = 93, \'SYSTEM RELOAD CONFIG\' = 94, \'SYSTEM RELOAD SYMBOLS\' = 95, \'SYSTEM RELOAD DICTIONARY\' = 96, \'SYSTEM RELOAD MODEL\' = 97, \'SYSTEM RELOAD FUNCTION\' = 98, \'SYSTEM RELOAD EMBEDDED DICTIONARIES\' = 99, \'SYSTEM RELOAD\' = 100, \'SYSTEM RESTART DISK\' = 101, \'SYSTEM MERGES\' = 102, \'SYSTEM TTL MERGES\' = 103, \'SYSTEM FETCHES\' = 104, \'SYSTEM MOVES\' = 105, \'SYSTEM DISTRIBUTED SENDS\' = 106, \'SYSTEM REPLICATED SENDS\' = 107, \'SYSTEM SENDS\' = 108, \'SYSTEM REPLICATION QUEUES\' = 109, \'SYSTEM DROP REPLICA\' = 110, \'SYSTEM SYNC REPLICA\' = 111, \'SYSTEM RESTART REPLICA\' = 112, \'SYSTEM RESTORE REPLICA\' = 113, \'SYSTEM FLUSH DISTRIBUTED\' = 114, \'SYSTEM FLUSH LOGS\' = 115, \'SYSTEM FLUSH\' = 116, \'SYSTEM THREAD FUZZER\' = 117, \'SYSTEM\' = 118, \'dictGet\' = 119, \'addressToLine\' = 120, \'addressToLineWithInlines\' = 121, \'addressToSymbol\' = 122, \'demangle\' = 123, \'INTROSPECTION\' = 124, \'FILE\' = 125, \'URL\' = 126, \'REMOTE\' = 127, \'MONGO\' = 128, \'MYSQL\' = 129, \'POSTGRES\' = 130, \'SQLITE\' = 131, \'ODBC\' = 132, \'JDBC\' = 133, \'HDFS\' = 134, \'S3\' = 135, \'HIVE\' = 136, \'SOURCES\' = 137, \'ALL\' = 138, \'NONE\' = 139))\n)\nENGINE = SystemPrivileges()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.processes\n(\n `is_initial_query` UInt8,\n `user` String,\n `query_id` String,\n `address` IPv6,\n `port` UInt16,\n `initial_user` String,\n `initial_query_id` String,\n `initial_address` IPv6,\n `initial_port` UInt16,\n `interface` UInt8,\n `os_user` String,\n `client_hostname` String,\n `client_name` String,\n `client_revision` UInt64,\n `client_version_major` UInt64,\n `client_version_minor` UInt64,\n `client_version_patch` UInt64,\n `http_method` UInt8,\n `http_user_agent` String,\n `http_referer` String,\n `forwarded_for` String,\n `quota_key` String,\n `distributed_depth` UInt64,\n `elapsed` Float64,\n `is_cancelled` UInt8,\n `is_all_data_sent` UInt8,\n `read_rows` UInt64,\n `read_bytes` UInt64,\n `total_rows_approx` UInt64,\n `written_rows` UInt64,\n `written_bytes` UInt64,\n `memory_usage` Int64,\n `peak_memory_usage` Int64,\n `query` String,\n `thread_ids` Array(UInt64),\n `ProfileEvents` Map(String, UInt64),\n `Settings` Map(String, String),\n `current_database` String,\n `ProfileEvents.Names` Array(String),\n `ProfileEvents.Values` Array(UInt64),\n `Settings.Names` Array(String),\n `Settings.Values` Array(String)\n)\nENGINE = SystemProcesses()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.projection_parts\n(\n `partition` String,\n `name` String,\n `part_type` String,\n `parent_name` String,\n `parent_uuid` UUID,\n `parent_part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `parent_marks` UInt64,\n `parent_rows` UInt64,\n `parent_bytes_on_disk` UInt64,\n `parent_data_compressed_bytes` UInt64,\n `parent_data_uncompressed_bytes` UInt64,\n `parent_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `is_frozen` UInt8,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `hash_of_all_files` String,\n `hash_of_uncompressed_files` String,\n `uncompressed_hash_of_compressed_files` String,\n `delete_ttl_info_min` DateTime,\n `delete_ttl_info_max` DateTime,\n `move_ttl_info.expression` Array(String),\n `move_ttl_info.min` Array(DateTime),\n `move_ttl_info.max` Array(DateTime),\n `default_compression_codec` String,\n `recompression_ttl_info.expression` Array(String),\n `recompression_ttl_info.min` Array(DateTime),\n `recompression_ttl_info.max` Array(DateTime),\n `group_by_ttl_info.expression` Array(String),\n `group_by_ttl_info.min` Array(DateTime),\n `group_by_ttl_info.max` Array(DateTime),\n `rows_where_ttl_info.expression` Array(String),\n `rows_where_ttl_info.min` Array(DateTime),\n `rows_where_ttl_info.max` Array(DateTime),\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemProjectionParts()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.projection_parts_columns\n(\n `partition` String,\n `name` String,\n `part_type` String,\n `parent_name` String,\n `parent_uuid` UUID,\n `parent_part_type` String,\n `active` UInt8,\n `marks` UInt64,\n `rows` UInt64,\n `bytes_on_disk` UInt64,\n `data_compressed_bytes` UInt64,\n `data_uncompressed_bytes` UInt64,\n `marks_bytes` UInt64,\n `parent_marks` UInt64,\n `parent_rows` UInt64,\n `parent_bytes_on_disk` UInt64,\n `parent_data_compressed_bytes` UInt64,\n `parent_data_uncompressed_bytes` UInt64,\n `parent_marks_bytes` UInt64,\n `modification_time` DateTime,\n `remove_time` DateTime,\n `refcount` UInt32,\n `min_date` Date,\n `max_date` Date,\n `min_time` DateTime,\n `max_time` DateTime,\n `partition_id` String,\n `min_block_number` Int64,\n `max_block_number` Int64,\n `level` UInt32,\n `data_version` UInt64,\n `primary_key_bytes_in_memory` UInt64,\n `primary_key_bytes_in_memory_allocated` UInt64,\n `database` String,\n `table` String,\n `engine` String,\n `disk_name` String,\n `path` String,\n `column` String,\n `type` String,\n `column_position` UInt64,\n `default_kind` String,\n `default_expression` String,\n `column_bytes_on_disk` UInt64,\n `column_data_compressed_bytes` UInt64,\n `column_data_uncompressed_bytes` UInt64,\n `column_marks_bytes` UInt64,\n `bytes` UInt64,\n `marks_size` UInt64\n)\nENGINE = SystemProjectionPartsColumns()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.quota_limits\n(\n `quota_name` String,\n `duration` UInt32,\n `is_randomized_interval` UInt8,\n `max_queries` Nullable(UInt64),\n `max_query_selects` Nullable(UInt64),\n `max_query_inserts` Nullable(UInt64),\n `max_errors` Nullable(UInt64),\n `max_result_rows` Nullable(UInt64),\n `max_result_bytes` Nullable(UInt64),\n `max_read_rows` Nullable(UInt64),\n `max_read_bytes` Nullable(UInt64),\n `max_execution_time` Nullable(Float64),\n `max_written_bytes` Nullable(UInt64)\n)\nENGINE = SystemQuotaLimits()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.quota_usage\n(\n `quota_name` String,\n `quota_key` String,\n `start_time` Nullable(DateTime),\n `end_time` Nullable(DateTime),\n `duration` Nullable(UInt32),\n `queries` Nullable(UInt64),\n `max_queries` Nullable(UInt64),\n `query_selects` Nullable(UInt64),\n `max_query_selects` Nullable(UInt64),\n `query_inserts` Nullable(UInt64),\n `max_query_inserts` Nullable(UInt64),\n `errors` Nullable(UInt64),\n `max_errors` Nullable(UInt64),\n `result_rows` Nullable(UInt64),\n `max_result_rows` Nullable(UInt64),\n `result_bytes` Nullable(UInt64),\n `max_result_bytes` Nullable(UInt64),\n `read_rows` Nullable(UInt64),\n `max_read_rows` Nullable(UInt64),\n `read_bytes` Nullable(UInt64),\n `max_read_bytes` Nullable(UInt64),\n `execution_time` Nullable(Float64),\n `max_execution_time` Nullable(Float64),\n `written_bytes` Nullable(UInt64),\n `max_written_bytes` Nullable(UInt64)\n)\nENGINE = SystemQuotaUsage()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.quotas\n(\n `name` String,\n `id` UUID,\n `storage` String,\n `keys` Array(Enum8(\'user_name\' = 1, \'ip_address\' = 2, \'forwarded_ip_address\' = 3, \'client_key\' = 4)),\n `durations` Array(UInt32),\n `apply_to_all` UInt8,\n `apply_to_list` Array(String),\n `apply_to_except` Array(String)\n)\nENGINE = SystemQuotas()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.quotas_usage\n(\n `quota_name` String,\n `quota_key` String,\n `is_current` UInt8,\n `start_time` Nullable(DateTime),\n `end_time` Nullable(DateTime),\n `duration` Nullable(UInt32),\n `queries` Nullable(UInt64),\n `max_queries` Nullable(UInt64),\n `query_selects` Nullable(UInt64),\n `max_query_selects` Nullable(UInt64),\n `query_inserts` Nullable(UInt64),\n `max_query_inserts` Nullable(UInt64),\n `errors` Nullable(UInt64),\n `max_errors` Nullable(UInt64),\n `result_rows` Nullable(UInt64),\n `max_result_rows` Nullable(UInt64),\n `result_bytes` Nullable(UInt64),\n `max_result_bytes` Nullable(UInt64),\n `read_rows` Nullable(UInt64),\n `max_read_rows` Nullable(UInt64),\n `read_bytes` Nullable(UInt64),\n `max_read_bytes` Nullable(UInt64),\n `execution_time` Nullable(Float64),\n `max_execution_time` Nullable(Float64),\n `written_bytes` Nullable(UInt64),\n `max_written_bytes` Nullable(UInt64)\n)\nENGINE = SystemQuotasUsage()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.replicas\n(\n `database` String,\n `table` String,\n `engine` String,\n `is_leader` UInt8,\n `can_become_leader` UInt8,\n `is_readonly` UInt8,\n `is_session_expired` UInt8,\n `future_parts` UInt32,\n `parts_to_check` UInt32,\n `zookeeper_path` String,\n `replica_name` String,\n `replica_path` String,\n `columns_version` Int32,\n `queue_size` UInt32,\n `inserts_in_queue` UInt32,\n `merges_in_queue` UInt32,\n `part_mutations_in_queue` UInt32,\n `queue_oldest_time` DateTime,\n `inserts_oldest_time` DateTime,\n `merges_oldest_time` DateTime,\n `part_mutations_oldest_time` DateTime,\n `oldest_part_to_get` String,\n `oldest_part_to_merge_to` String,\n `oldest_part_to_mutate_to` String,\n `log_max_index` UInt64,\n `log_pointer` UInt64,\n `last_queue_update` DateTime,\n `absolute_delay` UInt64,\n `total_replicas` UInt8,\n `active_replicas` UInt8,\n `last_queue_update_exception` String,\n `zookeeper_exception` String,\n `replica_is_active` Map(String, UInt8)\n)\nENGINE = SystemReplicas()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.replicated_fetches\n(\n `database` String,\n `table` String,\n `elapsed` Float64,\n `progress` Float64,\n `result_part_name` String,\n `result_part_path` String,\n `partition_id` String,\n `total_size_bytes_compressed` UInt64,\n `bytes_read_compressed` UInt64,\n `source_replica_path` String,\n `source_replica_hostname` String,\n `source_replica_port` UInt16,\n `interserver_scheme` String,\n `URI` String,\n `to_detached` UInt8,\n `thread_id` UInt64\n)\nENGINE = SystemReplicatedFetches()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.replicated_merge_tree_settings\n(\n `name` String,\n `value` String,\n `changed` UInt8,\n `description` String,\n `type` String\n)\nENGINE = SystemReplicatedMergeTreeSettings()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.replication_queue\n(\n `database` String,\n `table` String,\n `replica_name` String,\n `position` UInt32,\n `node_name` String,\n `type` String,\n `create_time` DateTime,\n `required_quorum` UInt32,\n `source_replica` String,\n `new_part_name` String,\n `parts_to_merge` Array(String),\n `is_detach` UInt8,\n `is_currently_executing` UInt8,\n `num_tries` UInt32,\n `last_exception` String,\n `last_attempt_time` DateTime,\n `num_postponed` UInt32,\n `postpone_reason` String,\n `last_postpone_time` DateTime,\n `merge_type` String\n)\nENGINE = SystemReplicationQueue()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.role_grants\n(\n `user_name` Nullable(String),\n `role_name` Nullable(String),\n `granted_role_name` String,\n `granted_role_is_default` UInt8,\n `with_admin_option` UInt8\n)\nENGINE = SystemRoleGrants()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.roles\n(\n `name` String,\n `id` UUID,\n `storage` String\n)\nENGINE = SystemRoles()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.row_policies\n(\n `name` String,\n `short_name` String,\n `database` String,\n `table` String,\n `id` UUID,\n `storage` String,\n `select_filter` Nullable(String),\n `is_restrictive` UInt8,\n `apply_to_all` UInt8,\n `apply_to_list` Array(String),\n `apply_to_except` Array(String)\n)\nENGINE = SystemRowPolicies()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.settings\n(\n `name` String,\n `value` String,\n `changed` UInt8,\n `description` String,\n `min` Nullable(String),\n `max` Nullable(String),\n `readonly` UInt8,\n `type` String\n)\nENGINE = SystemSettings()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.settings_profile_elements\n(\n `profile_name` Nullable(String),\n `user_name` Nullable(String),\n `role_name` Nullable(String),\n `index` UInt64,\n `setting_name` Nullable(String),\n `value` Nullable(String),\n `min` Nullable(String),\n `max` Nullable(String),\n `readonly` Nullable(UInt8),\n `inherit_profile` Nullable(String)\n)\nENGINE = SystemSettingsProfileElements()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.settings_profiles\n(\n `name` String,\n `id` UUID,\n `storage` String,\n `num_elements` UInt64,\n `apply_to_all` UInt8,\n `apply_to_list` Array(String),\n `apply_to_except` Array(String)\n)\nENGINE = SystemSettingsProfiles()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.stack_trace\n(\n `thread_name` String,\n `thread_id` UInt64,\n `query_id` String,\n `trace` Array(UInt64)\n)\nENGINE = SystemStackTrace()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.storage_policies\n(\n `policy_name` String,\n `volume_name` String,\n `volume_priority` UInt64,\n `disks` Array(String),\n `volume_type` String,\n `max_data_part_size` UInt64,\n `move_factor` Float32,\n `prefer_not_to_merge` UInt8\n)\nENGINE = SystemStoragePolicies()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.table_engines\n(\n `name` String,\n `supports_settings` UInt8,\n `supports_skipping_indices` UInt8,\n `supports_projections` UInt8,\n `supports_sort_order` UInt8,\n `supports_ttl` UInt8,\n `supports_replication` UInt8,\n `supports_deduplication` UInt8,\n `supports_parallel_insert` UInt8\n)\nENGINE = SystemTableEngines()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.table_functions\n(\n `name` String\n)\nENGINE = SystemTableFunctions()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.tables\n(\n `database` String,\n `name` String,\n `uuid` UUID,\n `engine` String,\n `is_temporary` UInt8,\n `data_paths` Array(String),\n `metadata_path` String,\n `metadata_modification_time` DateTime,\n `dependencies_database` Array(String),\n `dependencies_table` Array(String),\n `create_table_query` String,\n `engine_full` String,\n `as_select` String,\n `partition_key` String,\n `sorting_key` String,\n `primary_key` String,\n `sampling_key` String,\n `storage_policy` String,\n `total_rows` Nullable(UInt64),\n `total_bytes` Nullable(UInt64),\n `lifetime_rows` Nullable(UInt64),\n `lifetime_bytes` Nullable(UInt64),\n `comment` String,\n `has_own_data` UInt8,\n `loading_dependencies_database` Array(String),\n `loading_dependencies_table` Array(String),\n `loading_dependent_database` Array(String),\n `loading_dependent_table` Array(String),\n `table` String\n)\nENGINE = SystemTables()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.time_zones\n(\n `time_zone` String\n)\nENGINE = SystemTimeZones()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.user_directories\n(\n `name` String,\n `type` String,\n `params` String,\n `precedence` UInt64\n)\nENGINE = SystemUserDirectories()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.users\n(\n `name` String,\n `id` UUID,\n `storage` String,\n `auth_type` Enum8(\'no_password\' = 0, \'plaintext_password\' = 1, \'sha256_password\' = 2, \'double_sha1_password\' = 3, \'ldap\' = 4, \'kerberos\' = 5, \'ssl_certificate\' = 6),\n `auth_params` String,\n `host_ip` Array(String),\n `host_names` Array(String),\n `host_names_regexp` Array(String),\n `host_names_like` Array(String),\n `default_roles_all` UInt8,\n `default_roles_list` Array(String),\n `default_roles_except` Array(String),\n `grantees_any` UInt8,\n `grantees_list` Array(String),\n `grantees_except` Array(String),\n `default_database` String\n)\nENGINE = SystemUsers()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.warnings\n(\n `message` String\n)\nENGINE = SystemWarnings()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.zeros\n(\n `zero` UInt8\n)\nENGINE = SystemZeros()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' -CREATE TABLE system.zeros_mt\n(\n `zero` UInt8\n)\nENGINE = SystemZeros()\nCOMMENT \'SYSTEM TABLE is built on the fly.\' +CREATE TABLE system.aggregate_function_combinators +( + `name` String, + `is_internal` UInt8 +) +ENGINE = SystemAggregateFunctionCombinators() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.asynchronous_inserts +( + `query` String, + `database` String, + `table` String, + `format` String, + `first_update` DateTime64(6), + `last_update` DateTime64(6), + `total_bytes` UInt64, + `entries.query_id` Array(String), + `entries.bytes` Array(UInt64), + `entries.finished` Array(UInt8), + `entries.exception` Array(String) +) +ENGINE = SystemAsynchronousInserts() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.asynchronous_metrics +( + `metric` String, + `value` Float64 +) +ENGINE = SystemAsynchronousMetrics() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.build_options +( + `name` String, + `value` String +) +ENGINE = SystemBuildOptions() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.clusters +( + `cluster` String, + `shard_num` UInt32, + `shard_weight` UInt32, + `replica_num` UInt32, + `host_name` String, + `host_address` String, + `port` UInt16, + `is_local` UInt8, + `user` String, + `default_database` String, + `errors_count` UInt32, + `slowdowns_count` UInt32, + `estimated_recovery_time` UInt32 +) +ENGINE = SystemClusters() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.collations +( + `name` String, + `language` Nullable(String) +) +ENGINE = SystemTableCollations() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.columns +( + `database` String, + `table` String, + `name` String, + `type` String, + `position` UInt64, + `default_kind` String, + `default_expression` String, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks_bytes` UInt64, + `comment` String, + `is_in_partition_key` UInt8, + `is_in_sorting_key` UInt8, + `is_in_primary_key` UInt8, + `is_in_sampling_key` UInt8, + `compression_codec` String, + `character_octet_length` Nullable(UInt64), + `numeric_precision` Nullable(UInt64), + `numeric_precision_radix` Nullable(UInt64), + `numeric_scale` Nullable(UInt64), + `datetime_precision` Nullable(UInt64) +) +ENGINE = SystemColumns() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.contributors +( + `name` String +) +ENGINE = SystemContributors() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.current_roles +( + `role_name` String, + `with_admin_option` UInt8, + `is_default` UInt8 +) +ENGINE = SystemCurrentRoles() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.data_skipping_indices +( + `database` String, + `table` String, + `name` String, + `type` String, + `expr` String, + `granularity` UInt64, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks` UInt64 +) +ENGINE = SystemDataSkippingIndices() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.data_type_families +( + `name` String, + `case_insensitive` UInt8, + `alias_to` String +) +ENGINE = SystemTableDataTypeFamilies() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.databases +( + `name` String, + `engine` String, + `data_path` String, + `metadata_path` String, + `uuid` UUID, + `comment` String, + `database` String +) +ENGINE = SystemDatabases() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.detached_parts +( + `database` String, + `table` String, + `partition_id` Nullable(String), + `name` String, + `disk` String, + `reason` Nullable(String), + `min_block_number` Nullable(Int64), + `max_block_number` Nullable(Int64), + `level` Nullable(UInt32) +) +ENGINE = SystemDetachedParts() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.dictionaries +( + `database` String, + `name` String, + `uuid` UUID, + `status` Enum8('NOT_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED_AND_RELOADING' = 4, 'LOADED_AND_RELOADING' = 5, 'NOT_EXIST' = 6), + `origin` String, + `type` String, + `key.names` Array(String), + `key.types` Array(String), + `attribute.names` Array(String), + `attribute.types` Array(String), + `bytes_allocated` UInt64, + `query_count` UInt64, + `hit_rate` Float64, + `found_rate` Float64, + `element_count` UInt64, + `load_factor` Float64, + `source` String, + `lifetime_min` UInt64, + `lifetime_max` UInt64, + `loading_start_time` DateTime, + `last_successful_update_time` DateTime, + `loading_duration` Float32, + `last_exception` String, + `comment` String +) +ENGINE = SystemDictionaries() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.disks +( + `name` String, + `path` String, + `free_space` UInt64, + `total_space` UInt64, + `keep_free_space` UInt64, + `type` String, + `cache_path` String +) +ENGINE = SystemDisks() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.distributed_ddl_queue +( + `entry` String, + `entry_version` Nullable(UInt8), + `initiator_host` Nullable(String), + `initiator_port` Nullable(UInt16), + `cluster` String, + `query` String, + `settings` Map(String, String), + `query_create_time` DateTime, + `host` Nullable(String), + `port` Nullable(UInt16), + `status` Nullable(Enum8('Inactive' = 0, 'Active' = 1, 'Finished' = 2, 'Removing' = 3, 'Unknown' = 4)), + `exception_code` Nullable(UInt16), + `exception_text` Nullable(String), + `query_finish_time` Nullable(DateTime), + `query_duration_ms` Nullable(UInt64) +) +ENGINE = SystemDDLWorkerQueue() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.distribution_queue +( + `database` String, + `table` String, + `data_path` String, + `is_blocked` UInt8, + `error_count` UInt64, + `data_files` UInt64, + `data_compressed_bytes` UInt64, + `broken_data_files` UInt64, + `broken_data_compressed_bytes` UInt64, + `last_exception` String +) +ENGINE = SystemDistributionQueue() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.enabled_roles +( + `role_name` String, + `with_admin_option` UInt8, + `is_current` UInt8, + `is_default` UInt8 +) +ENGINE = SystemEnabledRoles() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.errors +( + `name` String, + `code` Int32, + `value` UInt64, + `last_error_time` DateTime, + `last_error_message` String, + `last_error_trace` Array(UInt64), + `remote` UInt8 +) +ENGINE = SystemErrors() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.events +( + `event` String, + `value` UInt64, + `description` String +) +ENGINE = SystemEvents() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.formats +( + `name` String, + `is_input` UInt8, + `is_output` UInt8 +) +ENGINE = SystemFormats() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.functions +( + `name` String, + `is_aggregate` UInt8, + `case_insensitive` UInt8, + `alias_to` String, + `create_query` String, + `origin` Enum8('System' = 0, 'SQLUserDefined' = 1, 'ExecutableUserDefined' = 2) +) +ENGINE = SystemFunctions() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.grants +( + `user_name` Nullable(String), + `role_name` Nullable(String), + `access_type` Enum16('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER MATERIALIZE COLUMN' = 15, 'ALTER COLUMN' = 16, 'ALTER MODIFY COMMENT' = 17, 'ALTER ORDER BY' = 18, 'ALTER SAMPLE BY' = 19, 'ALTER ADD INDEX' = 20, 'ALTER DROP INDEX' = 21, 'ALTER MATERIALIZE INDEX' = 22, 'ALTER CLEAR INDEX' = 23, 'ALTER INDEX' = 24, 'ALTER ADD PROJECTION' = 25, 'ALTER DROP PROJECTION' = 26, 'ALTER MATERIALIZE PROJECTION' = 27, 'ALTER CLEAR PROJECTION' = 28, 'ALTER PROJECTION' = 29, 'ALTER ADD CONSTRAINT' = 30, 'ALTER DROP CONSTRAINT' = 31, 'ALTER CONSTRAINT' = 32, 'ALTER TTL' = 33, 'ALTER MATERIALIZE TTL' = 34, 'ALTER SETTINGS' = 35, 'ALTER MOVE PARTITION' = 36, 'ALTER FETCH PARTITION' = 37, 'ALTER FREEZE PARTITION' = 38, 'ALTER DATABASE SETTINGS' = 39, 'ALTER TABLE' = 40, 'ALTER DATABASE' = 41, 'ALTER VIEW REFRESH' = 42, 'ALTER VIEW MODIFY QUERY' = 43, 'ALTER VIEW' = 44, 'ALTER' = 45, 'CREATE DATABASE' = 46, 'CREATE TABLE' = 47, 'CREATE VIEW' = 48, 'CREATE DICTIONARY' = 49, 'CREATE TEMPORARY TABLE' = 50, 'CREATE FUNCTION' = 51, 'CREATE' = 52, 'DROP DATABASE' = 53, 'DROP TABLE' = 54, 'DROP VIEW' = 55, 'DROP DICTIONARY' = 56, 'DROP FUNCTION' = 57, 'DROP' = 58, 'TRUNCATE' = 59, 'OPTIMIZE' = 60, 'KILL QUERY' = 61, 'KILL TRANSACTION' = 62, 'MOVE PARTITION BETWEEN SHARDS' = 63, 'CREATE USER' = 64, 'ALTER USER' = 65, 'DROP USER' = 66, 'CREATE ROLE' = 67, 'ALTER ROLE' = 68, 'DROP ROLE' = 69, 'ROLE ADMIN' = 70, 'CREATE ROW POLICY' = 71, 'ALTER ROW POLICY' = 72, 'DROP ROW POLICY' = 73, 'CREATE QUOTA' = 74, 'ALTER QUOTA' = 75, 'DROP QUOTA' = 76, 'CREATE SETTINGS PROFILE' = 77, 'ALTER SETTINGS PROFILE' = 78, 'DROP SETTINGS PROFILE' = 79, 'SHOW USERS' = 80, 'SHOW ROLES' = 81, 'SHOW ROW POLICIES' = 82, 'SHOW QUOTAS' = 83, 'SHOW SETTINGS PROFILES' = 84, 'SHOW ACCESS' = 85, 'ACCESS MANAGEMENT' = 86, 'SYSTEM SHUTDOWN' = 87, 'SYSTEM DROP DNS CACHE' = 88, 'SYSTEM DROP MARK CACHE' = 89, 'SYSTEM DROP UNCOMPRESSED CACHE' = 90, 'SYSTEM DROP MMAP CACHE' = 91, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 92, 'SYSTEM DROP CACHE' = 93, 'SYSTEM RELOAD CONFIG' = 94, 'SYSTEM RELOAD SYMBOLS' = 95, 'SYSTEM RELOAD DICTIONARY' = 96, 'SYSTEM RELOAD MODEL' = 97, 'SYSTEM RELOAD FUNCTION' = 98, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 99, 'SYSTEM RELOAD' = 100, 'SYSTEM RESTART DISK' = 101, 'SYSTEM MERGES' = 102, 'SYSTEM TTL MERGES' = 103, 'SYSTEM FETCHES' = 104, 'SYSTEM MOVES' = 105, 'SYSTEM DISTRIBUTED SENDS' = 106, 'SYSTEM REPLICATED SENDS' = 107, 'SYSTEM SENDS' = 108, 'SYSTEM REPLICATION QUEUES' = 109, 'SYSTEM DROP REPLICA' = 110, 'SYSTEM SYNC REPLICA' = 111, 'SYSTEM RESTART REPLICA' = 112, 'SYSTEM RESTORE REPLICA' = 113, 'SYSTEM FLUSH DISTRIBUTED' = 114, 'SYSTEM FLUSH LOGS' = 115, 'SYSTEM FLUSH' = 116, 'SYSTEM THREAD FUZZER' = 117, 'SYSTEM' = 118, 'dictGet' = 119, 'addressToLine' = 120, 'addressToLineWithInlines' = 121, 'addressToSymbol' = 122, 'demangle' = 123, 'INTROSPECTION' = 124, 'FILE' = 125, 'URL' = 126, 'REMOTE' = 127, 'MONGO' = 128, 'MYSQL' = 129, 'POSTGRES' = 130, 'SQLITE' = 131, 'ODBC' = 132, 'JDBC' = 133, 'HDFS' = 134, 'S3' = 135, 'HIVE' = 136, 'SOURCES' = 137, 'ALL' = 138, 'NONE' = 139), + `database` Nullable(String), + `table` Nullable(String), + `column` Nullable(String), + `is_partial_revoke` UInt8, + `grant_option` UInt8 +) +ENGINE = SystemGrants() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.graphite_retentions +( + `config_name` String, + `rule_type` String, + `regexp` String, + `function` String, + `age` UInt64, + `precision` UInt64, + `priority` UInt16, + `is_default` UInt8, + `Tables.database` Array(String), + `Tables.table` Array(String) +) +ENGINE = SystemGraphite() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.licenses +( + `library_name` String, + `license_type` String, + `license_path` String, + `license_text` String +) +ENGINE = SystemLicenses() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.macros +( + `macro` String, + `substitution` String +) +ENGINE = SystemMacros() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.merge_tree_settings +( + `name` String, + `value` String, + `changed` UInt8, + `description` String, + `type` String +) +ENGINE = SystemMergeTreeSettings() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.merges +( + `database` String, + `table` String, + `elapsed` Float64, + `progress` Float64, + `num_parts` UInt64, + `source_part_names` Array(String), + `result_part_name` String, + `source_part_paths` Array(String), + `result_part_path` String, + `partition_id` String, + `is_mutation` UInt8, + `total_size_bytes_compressed` UInt64, + `total_size_marks` UInt64, + `bytes_read_uncompressed` UInt64, + `rows_read` UInt64, + `bytes_written_uncompressed` UInt64, + `rows_written` UInt64, + `columns_written` UInt64, + `memory_usage` UInt64, + `thread_id` UInt64, + `merge_type` String, + `merge_algorithm` String +) +ENGINE = SystemMerges() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.metrics +( + `metric` String, + `value` Int64, + `description` String +) +ENGINE = SystemMetrics() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.models +( + `name` String, + `status` Enum8('NOT_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED_AND_RELOADING' = 4, 'LOADED_AND_RELOADING' = 5, 'NOT_EXIST' = 6), + `origin` String, + `type` String, + `loading_start_time` DateTime, + `loading_duration` Float32, + `last_exception` String +) +ENGINE = SystemModels() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.mutations +( + `database` String, + `table` String, + `mutation_id` String, + `command` String, + `create_time` DateTime, + `block_numbers.partition_id` Array(String), + `block_numbers.number` Array(Int64), + `parts_to_do_names` Array(String), + `parts_to_do` Int64, + `is_done` UInt8, + `latest_failed_part` String, + `latest_fail_time` DateTime, + `latest_fail_reason` String +) +ENGINE = SystemMutations() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.numbers +( + `number` UInt64 +) +ENGINE = SystemNumbers() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.numbers_mt +( + `number` UInt64 +) +ENGINE = SystemNumbers() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.one +( + `dummy` UInt8 +) +ENGINE = SystemOne() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.part_moves_between_shards +( + `database` String, + `table` String, + `task_name` String, + `task_uuid` UUID, + `create_time` DateTime, + `part_name` String, + `part_uuid` UUID, + `to_shard` String, + `dst_part_name` String, + `update_time` DateTime, + `state` String, + `rollback` UInt8, + `num_tries` UInt32, + `last_exception` String +) +ENGINE = SystemShardMoves() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.parts +( + `partition` String, + `name` String, + `uuid` UUID, + `part_type` String, + `active` UInt8, + `marks` UInt64, + `rows` UInt64, + `bytes_on_disk` UInt64, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks_bytes` UInt64, + `secondary_indices_compressed_bytes` UInt64, + `secondary_indices_uncompressed_bytes` UInt64, + `secondary_indices_marks_bytes` UInt64, + `modification_time` DateTime, + `remove_time` DateTime, + `refcount` UInt32, + `min_date` Date, + `max_date` Date, + `min_time` DateTime, + `max_time` DateTime, + `partition_id` String, + `min_block_number` Int64, + `max_block_number` Int64, + `level` UInt32, + `data_version` UInt64, + `primary_key_bytes_in_memory` UInt64, + `primary_key_bytes_in_memory_allocated` UInt64, + `is_frozen` UInt8, + `database` String, + `table` String, + `engine` String, + `disk_name` String, + `path` String, + `hash_of_all_files` String, + `hash_of_uncompressed_files` String, + `uncompressed_hash_of_compressed_files` String, + `delete_ttl_info_min` DateTime, + `delete_ttl_info_max` DateTime, + `move_ttl_info.expression` Array(String), + `move_ttl_info.min` Array(DateTime), + `move_ttl_info.max` Array(DateTime), + `default_compression_codec` String, + `recompression_ttl_info.expression` Array(String), + `recompression_ttl_info.min` Array(DateTime), + `recompression_ttl_info.max` Array(DateTime), + `group_by_ttl_info.expression` Array(String), + `group_by_ttl_info.min` Array(DateTime), + `group_by_ttl_info.max` Array(DateTime), + `rows_where_ttl_info.expression` Array(String), + `rows_where_ttl_info.min` Array(DateTime), + `rows_where_ttl_info.max` Array(DateTime), + `projections` Array(String), + `visible` UInt8, + `creation_tid` Tuple(UInt64, UInt64, UUID), + `removal_tid` Tuple(UInt64, UInt64, UUID), + `creation_csn` UInt64, + `removal_csn` UInt64, + `bytes` UInt64, + `marks_size` UInt64 +) +ENGINE = SystemParts() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.parts_columns +( + `partition` String, + `name` String, + `uuid` UUID, + `part_type` String, + `active` UInt8, + `marks` UInt64, + `rows` UInt64, + `bytes_on_disk` UInt64, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks_bytes` UInt64, + `modification_time` DateTime, + `remove_time` DateTime, + `refcount` UInt32, + `min_date` Date, + `max_date` Date, + `min_time` DateTime, + `max_time` DateTime, + `partition_id` String, + `min_block_number` Int64, + `max_block_number` Int64, + `level` UInt32, + `data_version` UInt64, + `primary_key_bytes_in_memory` UInt64, + `primary_key_bytes_in_memory_allocated` UInt64, + `database` String, + `table` String, + `engine` String, + `disk_name` String, + `path` String, + `column` String, + `type` String, + `column_position` UInt64, + `default_kind` String, + `default_expression` String, + `column_bytes_on_disk` UInt64, + `column_data_compressed_bytes` UInt64, + `column_data_uncompressed_bytes` UInt64, + `column_marks_bytes` UInt64, + `serialization_kind` String, + `subcolumns.names` Array(String), + `subcolumns.types` Array(String), + `subcolumns.serializations` Array(String), + `subcolumns.bytes_on_disk` Array(UInt64), + `subcolumns.data_compressed_bytes` Array(UInt64), + `subcolumns.data_uncompressed_bytes` Array(UInt64), + `subcolumns.marks_bytes` Array(UInt64), + `bytes` UInt64, + `marks_size` UInt64 +) +ENGINE = SystemPartsColumns() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.privileges +( + `privilege` Enum16('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER MATERIALIZE COLUMN' = 15, 'ALTER COLUMN' = 16, 'ALTER MODIFY COMMENT' = 17, 'ALTER ORDER BY' = 18, 'ALTER SAMPLE BY' = 19, 'ALTER ADD INDEX' = 20, 'ALTER DROP INDEX' = 21, 'ALTER MATERIALIZE INDEX' = 22, 'ALTER CLEAR INDEX' = 23, 'ALTER INDEX' = 24, 'ALTER ADD PROJECTION' = 25, 'ALTER DROP PROJECTION' = 26, 'ALTER MATERIALIZE PROJECTION' = 27, 'ALTER CLEAR PROJECTION' = 28, 'ALTER PROJECTION' = 29, 'ALTER ADD CONSTRAINT' = 30, 'ALTER DROP CONSTRAINT' = 31, 'ALTER CONSTRAINT' = 32, 'ALTER TTL' = 33, 'ALTER MATERIALIZE TTL' = 34, 'ALTER SETTINGS' = 35, 'ALTER MOVE PARTITION' = 36, 'ALTER FETCH PARTITION' = 37, 'ALTER FREEZE PARTITION' = 38, 'ALTER DATABASE SETTINGS' = 39, 'ALTER TABLE' = 40, 'ALTER DATABASE' = 41, 'ALTER VIEW REFRESH' = 42, 'ALTER VIEW MODIFY QUERY' = 43, 'ALTER VIEW' = 44, 'ALTER' = 45, 'CREATE DATABASE' = 46, 'CREATE TABLE' = 47, 'CREATE VIEW' = 48, 'CREATE DICTIONARY' = 49, 'CREATE TEMPORARY TABLE' = 50, 'CREATE FUNCTION' = 51, 'CREATE' = 52, 'DROP DATABASE' = 53, 'DROP TABLE' = 54, 'DROP VIEW' = 55, 'DROP DICTIONARY' = 56, 'DROP FUNCTION' = 57, 'DROP' = 58, 'TRUNCATE' = 59, 'OPTIMIZE' = 60, 'KILL QUERY' = 61, 'KILL TRANSACTION' = 62, 'MOVE PARTITION BETWEEN SHARDS' = 63, 'CREATE USER' = 64, 'ALTER USER' = 65, 'DROP USER' = 66, 'CREATE ROLE' = 67, 'ALTER ROLE' = 68, 'DROP ROLE' = 69, 'ROLE ADMIN' = 70, 'CREATE ROW POLICY' = 71, 'ALTER ROW POLICY' = 72, 'DROP ROW POLICY' = 73, 'CREATE QUOTA' = 74, 'ALTER QUOTA' = 75, 'DROP QUOTA' = 76, 'CREATE SETTINGS PROFILE' = 77, 'ALTER SETTINGS PROFILE' = 78, 'DROP SETTINGS PROFILE' = 79, 'SHOW USERS' = 80, 'SHOW ROLES' = 81, 'SHOW ROW POLICIES' = 82, 'SHOW QUOTAS' = 83, 'SHOW SETTINGS PROFILES' = 84, 'SHOW ACCESS' = 85, 'ACCESS MANAGEMENT' = 86, 'SYSTEM SHUTDOWN' = 87, 'SYSTEM DROP DNS CACHE' = 88, 'SYSTEM DROP MARK CACHE' = 89, 'SYSTEM DROP UNCOMPRESSED CACHE' = 90, 'SYSTEM DROP MMAP CACHE' = 91, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 92, 'SYSTEM DROP CACHE' = 93, 'SYSTEM RELOAD CONFIG' = 94, 'SYSTEM RELOAD SYMBOLS' = 95, 'SYSTEM RELOAD DICTIONARY' = 96, 'SYSTEM RELOAD MODEL' = 97, 'SYSTEM RELOAD FUNCTION' = 98, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 99, 'SYSTEM RELOAD' = 100, 'SYSTEM RESTART DISK' = 101, 'SYSTEM MERGES' = 102, 'SYSTEM TTL MERGES' = 103, 'SYSTEM FETCHES' = 104, 'SYSTEM MOVES' = 105, 'SYSTEM DISTRIBUTED SENDS' = 106, 'SYSTEM REPLICATED SENDS' = 107, 'SYSTEM SENDS' = 108, 'SYSTEM REPLICATION QUEUES' = 109, 'SYSTEM DROP REPLICA' = 110, 'SYSTEM SYNC REPLICA' = 111, 'SYSTEM RESTART REPLICA' = 112, 'SYSTEM RESTORE REPLICA' = 113, 'SYSTEM FLUSH DISTRIBUTED' = 114, 'SYSTEM FLUSH LOGS' = 115, 'SYSTEM FLUSH' = 116, 'SYSTEM THREAD FUZZER' = 117, 'SYSTEM' = 118, 'dictGet' = 119, 'addressToLine' = 120, 'addressToLineWithInlines' = 121, 'addressToSymbol' = 122, 'demangle' = 123, 'INTROSPECTION' = 124, 'FILE' = 125, 'URL' = 126, 'REMOTE' = 127, 'MONGO' = 128, 'MYSQL' = 129, 'POSTGRES' = 130, 'SQLITE' = 131, 'ODBC' = 132, 'JDBC' = 133, 'HDFS' = 134, 'S3' = 135, 'HIVE' = 136, 'SOURCES' = 137, 'ALL' = 138, 'NONE' = 139), + `aliases` Array(String), + `level` Nullable(Enum8('GLOBAL' = 0, 'DATABASE' = 1, 'TABLE' = 2, 'DICTIONARY' = 3, 'VIEW' = 4, 'COLUMN' = 5)), + `parent_group` Nullable(Enum16('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER MATERIALIZE COLUMN' = 15, 'ALTER COLUMN' = 16, 'ALTER MODIFY COMMENT' = 17, 'ALTER ORDER BY' = 18, 'ALTER SAMPLE BY' = 19, 'ALTER ADD INDEX' = 20, 'ALTER DROP INDEX' = 21, 'ALTER MATERIALIZE INDEX' = 22, 'ALTER CLEAR INDEX' = 23, 'ALTER INDEX' = 24, 'ALTER ADD PROJECTION' = 25, 'ALTER DROP PROJECTION' = 26, 'ALTER MATERIALIZE PROJECTION' = 27, 'ALTER CLEAR PROJECTION' = 28, 'ALTER PROJECTION' = 29, 'ALTER ADD CONSTRAINT' = 30, 'ALTER DROP CONSTRAINT' = 31, 'ALTER CONSTRAINT' = 32, 'ALTER TTL' = 33, 'ALTER MATERIALIZE TTL' = 34, 'ALTER SETTINGS' = 35, 'ALTER MOVE PARTITION' = 36, 'ALTER FETCH PARTITION' = 37, 'ALTER FREEZE PARTITION' = 38, 'ALTER DATABASE SETTINGS' = 39, 'ALTER TABLE' = 40, 'ALTER DATABASE' = 41, 'ALTER VIEW REFRESH' = 42, 'ALTER VIEW MODIFY QUERY' = 43, 'ALTER VIEW' = 44, 'ALTER' = 45, 'CREATE DATABASE' = 46, 'CREATE TABLE' = 47, 'CREATE VIEW' = 48, 'CREATE DICTIONARY' = 49, 'CREATE TEMPORARY TABLE' = 50, 'CREATE FUNCTION' = 51, 'CREATE' = 52, 'DROP DATABASE' = 53, 'DROP TABLE' = 54, 'DROP VIEW' = 55, 'DROP DICTIONARY' = 56, 'DROP FUNCTION' = 57, 'DROP' = 58, 'TRUNCATE' = 59, 'OPTIMIZE' = 60, 'KILL QUERY' = 61, 'KILL TRANSACTION' = 62, 'MOVE PARTITION BETWEEN SHARDS' = 63, 'CREATE USER' = 64, 'ALTER USER' = 65, 'DROP USER' = 66, 'CREATE ROLE' = 67, 'ALTER ROLE' = 68, 'DROP ROLE' = 69, 'ROLE ADMIN' = 70, 'CREATE ROW POLICY' = 71, 'ALTER ROW POLICY' = 72, 'DROP ROW POLICY' = 73, 'CREATE QUOTA' = 74, 'ALTER QUOTA' = 75, 'DROP QUOTA' = 76, 'CREATE SETTINGS PROFILE' = 77, 'ALTER SETTINGS PROFILE' = 78, 'DROP SETTINGS PROFILE' = 79, 'SHOW USERS' = 80, 'SHOW ROLES' = 81, 'SHOW ROW POLICIES' = 82, 'SHOW QUOTAS' = 83, 'SHOW SETTINGS PROFILES' = 84, 'SHOW ACCESS' = 85, 'ACCESS MANAGEMENT' = 86, 'SYSTEM SHUTDOWN' = 87, 'SYSTEM DROP DNS CACHE' = 88, 'SYSTEM DROP MARK CACHE' = 89, 'SYSTEM DROP UNCOMPRESSED CACHE' = 90, 'SYSTEM DROP MMAP CACHE' = 91, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 92, 'SYSTEM DROP CACHE' = 93, 'SYSTEM RELOAD CONFIG' = 94, 'SYSTEM RELOAD SYMBOLS' = 95, 'SYSTEM RELOAD DICTIONARY' = 96, 'SYSTEM RELOAD MODEL' = 97, 'SYSTEM RELOAD FUNCTION' = 98, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 99, 'SYSTEM RELOAD' = 100, 'SYSTEM RESTART DISK' = 101, 'SYSTEM MERGES' = 102, 'SYSTEM TTL MERGES' = 103, 'SYSTEM FETCHES' = 104, 'SYSTEM MOVES' = 105, 'SYSTEM DISTRIBUTED SENDS' = 106, 'SYSTEM REPLICATED SENDS' = 107, 'SYSTEM SENDS' = 108, 'SYSTEM REPLICATION QUEUES' = 109, 'SYSTEM DROP REPLICA' = 110, 'SYSTEM SYNC REPLICA' = 111, 'SYSTEM RESTART REPLICA' = 112, 'SYSTEM RESTORE REPLICA' = 113, 'SYSTEM FLUSH DISTRIBUTED' = 114, 'SYSTEM FLUSH LOGS' = 115, 'SYSTEM FLUSH' = 116, 'SYSTEM THREAD FUZZER' = 117, 'SYSTEM' = 118, 'dictGet' = 119, 'addressToLine' = 120, 'addressToLineWithInlines' = 121, 'addressToSymbol' = 122, 'demangle' = 123, 'INTROSPECTION' = 124, 'FILE' = 125, 'URL' = 126, 'REMOTE' = 127, 'MONGO' = 128, 'MYSQL' = 129, 'POSTGRES' = 130, 'SQLITE' = 131, 'ODBC' = 132, 'JDBC' = 133, 'HDFS' = 134, 'S3' = 135, 'HIVE' = 136, 'SOURCES' = 137, 'ALL' = 138, 'NONE' = 139)) +) +ENGINE = SystemPrivileges() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.processes +( + `is_initial_query` UInt8, + `user` String, + `query_id` String, + `address` IPv6, + `port` UInt16, + `initial_user` String, + `initial_query_id` String, + `initial_address` IPv6, + `initial_port` UInt16, + `interface` UInt8, + `os_user` String, + `client_hostname` String, + `client_name` String, + `client_revision` UInt64, + `client_version_major` UInt64, + `client_version_minor` UInt64, + `client_version_patch` UInt64, + `http_method` UInt8, + `http_user_agent` String, + `http_referer` String, + `forwarded_for` String, + `quota_key` String, + `distributed_depth` UInt64, + `elapsed` Float64, + `is_cancelled` UInt8, + `is_all_data_sent` UInt8, + `read_rows` UInt64, + `read_bytes` UInt64, + `total_rows_approx` UInt64, + `written_rows` UInt64, + `written_bytes` UInt64, + `memory_usage` Int64, + `peak_memory_usage` Int64, + `query` String, + `thread_ids` Array(UInt64), + `ProfileEvents` Map(String, UInt64), + `Settings` Map(String, String), + `current_database` String, + `ProfileEvents.Names` Array(String), + `ProfileEvents.Values` Array(UInt64), + `Settings.Names` Array(String), + `Settings.Values` Array(String) +) +ENGINE = SystemProcesses() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.projection_parts +( + `partition` String, + `name` String, + `part_type` String, + `parent_name` String, + `parent_uuid` UUID, + `parent_part_type` String, + `active` UInt8, + `marks` UInt64, + `rows` UInt64, + `bytes_on_disk` UInt64, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks_bytes` UInt64, + `parent_marks` UInt64, + `parent_rows` UInt64, + `parent_bytes_on_disk` UInt64, + `parent_data_compressed_bytes` UInt64, + `parent_data_uncompressed_bytes` UInt64, + `parent_marks_bytes` UInt64, + `modification_time` DateTime, + `remove_time` DateTime, + `refcount` UInt32, + `min_date` Date, + `max_date` Date, + `min_time` DateTime, + `max_time` DateTime, + `partition_id` String, + `min_block_number` Int64, + `max_block_number` Int64, + `level` UInt32, + `data_version` UInt64, + `primary_key_bytes_in_memory` UInt64, + `primary_key_bytes_in_memory_allocated` UInt64, + `is_frozen` UInt8, + `database` String, + `table` String, + `engine` String, + `disk_name` String, + `path` String, + `hash_of_all_files` String, + `hash_of_uncompressed_files` String, + `uncompressed_hash_of_compressed_files` String, + `delete_ttl_info_min` DateTime, + `delete_ttl_info_max` DateTime, + `move_ttl_info.expression` Array(String), + `move_ttl_info.min` Array(DateTime), + `move_ttl_info.max` Array(DateTime), + `default_compression_codec` String, + `recompression_ttl_info.expression` Array(String), + `recompression_ttl_info.min` Array(DateTime), + `recompression_ttl_info.max` Array(DateTime), + `group_by_ttl_info.expression` Array(String), + `group_by_ttl_info.min` Array(DateTime), + `group_by_ttl_info.max` Array(DateTime), + `rows_where_ttl_info.expression` Array(String), + `rows_where_ttl_info.min` Array(DateTime), + `rows_where_ttl_info.max` Array(DateTime), + `bytes` UInt64, + `marks_size` UInt64 +) +ENGINE = SystemProjectionParts() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.projection_parts_columns +( + `partition` String, + `name` String, + `part_type` String, + `parent_name` String, + `parent_uuid` UUID, + `parent_part_type` String, + `active` UInt8, + `marks` UInt64, + `rows` UInt64, + `bytes_on_disk` UInt64, + `data_compressed_bytes` UInt64, + `data_uncompressed_bytes` UInt64, + `marks_bytes` UInt64, + `parent_marks` UInt64, + `parent_rows` UInt64, + `parent_bytes_on_disk` UInt64, + `parent_data_compressed_bytes` UInt64, + `parent_data_uncompressed_bytes` UInt64, + `parent_marks_bytes` UInt64, + `modification_time` DateTime, + `remove_time` DateTime, + `refcount` UInt32, + `min_date` Date, + `max_date` Date, + `min_time` DateTime, + `max_time` DateTime, + `partition_id` String, + `min_block_number` Int64, + `max_block_number` Int64, + `level` UInt32, + `data_version` UInt64, + `primary_key_bytes_in_memory` UInt64, + `primary_key_bytes_in_memory_allocated` UInt64, + `database` String, + `table` String, + `engine` String, + `disk_name` String, + `path` String, + `column` String, + `type` String, + `column_position` UInt64, + `default_kind` String, + `default_expression` String, + `column_bytes_on_disk` UInt64, + `column_data_compressed_bytes` UInt64, + `column_data_uncompressed_bytes` UInt64, + `column_marks_bytes` UInt64, + `bytes` UInt64, + `marks_size` UInt64 +) +ENGINE = SystemProjectionPartsColumns() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.quota_limits +( + `quota_name` String, + `duration` UInt32, + `is_randomized_interval` UInt8, + `max_queries` Nullable(UInt64), + `max_query_selects` Nullable(UInt64), + `max_query_inserts` Nullable(UInt64), + `max_errors` Nullable(UInt64), + `max_result_rows` Nullable(UInt64), + `max_result_bytes` Nullable(UInt64), + `max_read_rows` Nullable(UInt64), + `max_read_bytes` Nullable(UInt64), + `max_execution_time` Nullable(Float64), + `max_written_bytes` Nullable(UInt64) +) +ENGINE = SystemQuotaLimits() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.quota_usage +( + `quota_name` String, + `quota_key` String, + `start_time` Nullable(DateTime), + `end_time` Nullable(DateTime), + `duration` Nullable(UInt32), + `queries` Nullable(UInt64), + `max_queries` Nullable(UInt64), + `query_selects` Nullable(UInt64), + `max_query_selects` Nullable(UInt64), + `query_inserts` Nullable(UInt64), + `max_query_inserts` Nullable(UInt64), + `errors` Nullable(UInt64), + `max_errors` Nullable(UInt64), + `result_rows` Nullable(UInt64), + `max_result_rows` Nullable(UInt64), + `result_bytes` Nullable(UInt64), + `max_result_bytes` Nullable(UInt64), + `read_rows` Nullable(UInt64), + `max_read_rows` Nullable(UInt64), + `read_bytes` Nullable(UInt64), + `max_read_bytes` Nullable(UInt64), + `execution_time` Nullable(Float64), + `max_execution_time` Nullable(Float64), + `written_bytes` Nullable(UInt64), + `max_written_bytes` Nullable(UInt64) +) +ENGINE = SystemQuotaUsage() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.quotas +( + `name` String, + `id` UUID, + `storage` String, + `keys` Array(Enum8('user_name' = 1, 'ip_address' = 2, 'forwarded_ip_address' = 3, 'client_key' = 4)), + `durations` Array(UInt32), + `apply_to_all` UInt8, + `apply_to_list` Array(String), + `apply_to_except` Array(String) +) +ENGINE = SystemQuotas() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.quotas_usage +( + `quota_name` String, + `quota_key` String, + `is_current` UInt8, + `start_time` Nullable(DateTime), + `end_time` Nullable(DateTime), + `duration` Nullable(UInt32), + `queries` Nullable(UInt64), + `max_queries` Nullable(UInt64), + `query_selects` Nullable(UInt64), + `max_query_selects` Nullable(UInt64), + `query_inserts` Nullable(UInt64), + `max_query_inserts` Nullable(UInt64), + `errors` Nullable(UInt64), + `max_errors` Nullable(UInt64), + `result_rows` Nullable(UInt64), + `max_result_rows` Nullable(UInt64), + `result_bytes` Nullable(UInt64), + `max_result_bytes` Nullable(UInt64), + `read_rows` Nullable(UInt64), + `max_read_rows` Nullable(UInt64), + `read_bytes` Nullable(UInt64), + `max_read_bytes` Nullable(UInt64), + `execution_time` Nullable(Float64), + `max_execution_time` Nullable(Float64), + `written_bytes` Nullable(UInt64), + `max_written_bytes` Nullable(UInt64) +) +ENGINE = SystemQuotasUsage() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.replicas +( + `database` String, + `table` String, + `engine` String, + `is_leader` UInt8, + `can_become_leader` UInt8, + `is_readonly` UInt8, + `is_session_expired` UInt8, + `future_parts` UInt32, + `parts_to_check` UInt32, + `zookeeper_path` String, + `replica_name` String, + `replica_path` String, + `columns_version` Int32, + `queue_size` UInt32, + `inserts_in_queue` UInt32, + `merges_in_queue` UInt32, + `part_mutations_in_queue` UInt32, + `queue_oldest_time` DateTime, + `inserts_oldest_time` DateTime, + `merges_oldest_time` DateTime, + `part_mutations_oldest_time` DateTime, + `oldest_part_to_get` String, + `oldest_part_to_merge_to` String, + `oldest_part_to_mutate_to` String, + `log_max_index` UInt64, + `log_pointer` UInt64, + `last_queue_update` DateTime, + `absolute_delay` UInt64, + `total_replicas` UInt8, + `active_replicas` UInt8, + `last_queue_update_exception` String, + `zookeeper_exception` String, + `replica_is_active` Map(String, UInt8) +) +ENGINE = SystemReplicas() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.replicated_fetches +( + `database` String, + `table` String, + `elapsed` Float64, + `progress` Float64, + `result_part_name` String, + `result_part_path` String, + `partition_id` String, + `total_size_bytes_compressed` UInt64, + `bytes_read_compressed` UInt64, + `source_replica_path` String, + `source_replica_hostname` String, + `source_replica_port` UInt16, + `interserver_scheme` String, + `URI` String, + `to_detached` UInt8, + `thread_id` UInt64 +) +ENGINE = SystemReplicatedFetches() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.replicated_merge_tree_settings +( + `name` String, + `value` String, + `changed` UInt8, + `description` String, + `type` String +) +ENGINE = SystemReplicatedMergeTreeSettings() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.replication_queue +( + `database` String, + `table` String, + `replica_name` String, + `position` UInt32, + `node_name` String, + `type` String, + `create_time` DateTime, + `required_quorum` UInt32, + `source_replica` String, + `new_part_name` String, + `parts_to_merge` Array(String), + `is_detach` UInt8, + `is_currently_executing` UInt8, + `num_tries` UInt32, + `last_exception` String, + `last_attempt_time` DateTime, + `num_postponed` UInt32, + `postpone_reason` String, + `last_postpone_time` DateTime, + `merge_type` String +) +ENGINE = SystemReplicationQueue() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.role_grants +( + `user_name` Nullable(String), + `role_name` Nullable(String), + `granted_role_name` String, + `granted_role_is_default` UInt8, + `with_admin_option` UInt8 +) +ENGINE = SystemRoleGrants() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.roles +( + `name` String, + `id` UUID, + `storage` String +) +ENGINE = SystemRoles() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.row_policies +( + `name` String, + `short_name` String, + `database` String, + `table` String, + `id` UUID, + `storage` String, + `select_filter` Nullable(String), + `is_restrictive` UInt8, + `apply_to_all` UInt8, + `apply_to_list` Array(String), + `apply_to_except` Array(String) +) +ENGINE = SystemRowPolicies() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.settings +( + `name` String, + `value` String, + `changed` UInt8, + `description` String, + `min` Nullable(String), + `max` Nullable(String), + `readonly` UInt8, + `type` String +) +ENGINE = SystemSettings() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.settings_profile_elements +( + `profile_name` Nullable(String), + `user_name` Nullable(String), + `role_name` Nullable(String), + `index` UInt64, + `setting_name` Nullable(String), + `value` Nullable(String), + `min` Nullable(String), + `max` Nullable(String), + `readonly` Nullable(UInt8), + `inherit_profile` Nullable(String) +) +ENGINE = SystemSettingsProfileElements() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.settings_profiles +( + `name` String, + `id` UUID, + `storage` String, + `num_elements` UInt64, + `apply_to_all` UInt8, + `apply_to_list` Array(String), + `apply_to_except` Array(String) +) +ENGINE = SystemSettingsProfiles() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.stack_trace +( + `thread_name` String, + `thread_id` UInt64, + `query_id` String, + `trace` Array(UInt64) +) +ENGINE = SystemStackTrace() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.storage_policies +( + `policy_name` String, + `volume_name` String, + `volume_priority` UInt64, + `disks` Array(String), + `volume_type` String, + `max_data_part_size` UInt64, + `move_factor` Float32, + `prefer_not_to_merge` UInt8 +) +ENGINE = SystemStoragePolicies() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.table_engines +( + `name` String, + `supports_settings` UInt8, + `supports_skipping_indices` UInt8, + `supports_projections` UInt8, + `supports_sort_order` UInt8, + `supports_ttl` UInt8, + `supports_replication` UInt8, + `supports_deduplication` UInt8, + `supports_parallel_insert` UInt8 +) +ENGINE = SystemTableEngines() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.table_functions +( + `name` String +) +ENGINE = SystemTableFunctions() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.tables +( + `database` String, + `name` String, + `uuid` UUID, + `engine` String, + `is_temporary` UInt8, + `data_paths` Array(String), + `metadata_path` String, + `metadata_modification_time` DateTime, + `dependencies_database` Array(String), + `dependencies_table` Array(String), + `create_table_query` String, + `engine_full` String, + `as_select` String, + `partition_key` String, + `sorting_key` String, + `primary_key` String, + `sampling_key` String, + `storage_policy` String, + `total_rows` Nullable(UInt64), + `total_bytes` Nullable(UInt64), + `lifetime_rows` Nullable(UInt64), + `lifetime_bytes` Nullable(UInt64), + `comment` String, + `has_own_data` UInt8, + `loading_dependencies_database` Array(String), + `loading_dependencies_table` Array(String), + `loading_dependent_database` Array(String), + `loading_dependent_table` Array(String), + `table` String +) +ENGINE = SystemTables() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.time_zones +( + `time_zone` String +) +ENGINE = SystemTimeZones() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.user_directories +( + `name` String, + `type` String, + `params` String, + `precedence` UInt64 +) +ENGINE = SystemUserDirectories() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.users +( + `name` String, + `id` UUID, + `storage` String, + `auth_type` Enum8('no_password' = 0, 'plaintext_password' = 1, 'sha256_password' = 2, 'double_sha1_password' = 3, 'ldap' = 4, 'kerberos' = 5, 'ssl_certificate' = 6), + `auth_params` String, + `host_ip` Array(String), + `host_names` Array(String), + `host_names_regexp` Array(String), + `host_names_like` Array(String), + `default_roles_all` UInt8, + `default_roles_list` Array(String), + `default_roles_except` Array(String), + `grantees_any` UInt8, + `grantees_list` Array(String), + `grantees_except` Array(String), + `default_database` String +) +ENGINE = SystemUsers() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.warnings +( + `message` String +) +ENGINE = SystemWarnings() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.zeros +( + `zero` UInt8 +) +ENGINE = SystemZeros() +COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.zeros_mt +( + `zero` UInt8 +) +ENGINE = SystemZeros() +COMMENT 'SYSTEM TABLE is built on the fly.' diff --git a/tests/queries/0_stateless/02117_show_create_table_system.sql b/tests/queries/0_stateless/02117_show_create_table_system.sql index 16861cc3f8e..9a5726a0780 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.sql +++ b/tests/queries/0_stateless/02117_show_create_table_system.sql @@ -16,69 +16,69 @@ tables_with_database_column=( */ use system; -show create table aggregate_function_combinators; -show create table asynchronous_inserts; -show create table asynchronous_metrics; -show create table build_options; -show create table clusters; -show create table collations; -show create table columns; -show create table contributors; -show create table current_roles; -show create table data_skipping_indices; -show create table data_type_families; -show create table databases; -show create table detached_parts; -show create table dictionaries; -show create table disks; -show create table distributed_ddl_queue; -show create table distribution_queue; -show create table enabled_roles; -show create table errors; -show create table events; -show create table formats; -show create table functions; -show create table grants; -show create table graphite_retentions; -show create table licenses; -show create table macros; -show create table merge_tree_settings; -show create table merges; -show create table metrics; -show create table models; -show create table mutations; -show create table numbers; -show create table numbers_mt; -show create table one; -show create table part_moves_between_shards; -show create table parts; -show create table parts_columns; -show create table privileges; -show create table processes; -show create table projection_parts; -show create table projection_parts_columns; -show create table quota_limits; -show create table quota_usage; -show create table quotas; -show create table quotas_usage; -show create table replicas; -show create table replicated_fetches; -show create table replicated_merge_tree_settings; -show create table replication_queue; -show create table role_grants; -show create table roles; -show create table row_policies; -show create table settings; -show create table settings_profile_elements; -show create table settings_profiles; -show create table stack_trace; -show create table storage_policies; -show create table table_engines; -show create table table_functions; -show create table tables; -show create table time_zones; -show create table user_directories; -show create table users; -show create table warnings; -show create table zeros; -show create table zeros_mt; +show create table aggregate_function_combinators format TSVRaw; +show create table asynchronous_inserts format TSVRaw; +show create table asynchronous_metrics format TSVRaw; +show create table build_options format TSVRaw; +show create table clusters format TSVRaw; +show create table collations format TSVRaw; +show create table columns format TSVRaw; +show create table contributors format TSVRaw; +show create table current_roles format TSVRaw; +show create table data_skipping_indices format TSVRaw; +show create table data_type_families format TSVRaw; +show create table databases format TSVRaw; +show create table detached_parts format TSVRaw; +show create table dictionaries format TSVRaw; +show create table disks format TSVRaw; +show create table distributed_ddl_queue format TSVRaw; +show create table distribution_queue format TSVRaw; +show create table enabled_roles format TSVRaw; +show create table errors format TSVRaw; +show create table events format TSVRaw; +show create table formats format TSVRaw; +show create table functions format TSVRaw; +show create table grants format TSVRaw; +show create table graphite_retentions format TSVRaw; +show create table licenses format TSVRaw; +show create table macros format TSVRaw; +show create table merge_tree_settings format TSVRaw; +show create table merges format TSVRaw; +show create table metrics format TSVRaw; +show create table models format TSVRaw; +show create table mutations format TSVRaw; +show create table numbers format TSVRaw; +show create table numbers_mt format TSVRaw; +show create table one format TSVRaw; +show create table part_moves_between_shards format TSVRaw; +show create table parts format TSVRaw; +show create table parts_columns format TSVRaw; +show create table privileges format TSVRaw; +show create table processes format TSVRaw; +show create table projection_parts format TSVRaw; +show create table projection_parts_columns format TSVRaw; +show create table quota_limits format TSVRaw; +show create table quota_usage format TSVRaw; +show create table quotas format TSVRaw; +show create table quotas_usage format TSVRaw; +show create table replicas format TSVRaw; +show create table replicated_fetches format TSVRaw; +show create table replicated_merge_tree_settings format TSVRaw; +show create table replication_queue format TSVRaw; +show create table role_grants format TSVRaw; +show create table roles format TSVRaw; +show create table row_policies format TSVRaw; +show create table settings format TSVRaw; +show create table settings_profile_elements format TSVRaw; +show create table settings_profiles format TSVRaw; +show create table stack_trace format TSVRaw; +show create table storage_policies format TSVRaw; +show create table table_engines format TSVRaw; +show create table table_functions format TSVRaw; +show create table tables format TSVRaw; +show create table time_zones format TSVRaw; +show create table user_directories format TSVRaw; +show create table users format TSVRaw; +show create table warnings format TSVRaw; +show create table zeros format TSVRaw; +show create table zeros_mt format TSVRaw; From 7d95051d32d96e0d3898e519fc27d63c669bee60 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 26 Apr 2022 11:44:57 +0200 Subject: [PATCH 28/34] Fixed integer overflow in toStartOfInterval (#36546) --- src/Functions/toStartOfInterval.cpp | 14 +++++++++++--- .../02269_to_start_of_interval_overflow.reference | 0 .../02269_to_start_of_interval_overflow.sql | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 tests/queries/0_stateless/02269_to_start_of_interval_overflow.reference create mode 100644 tests/queries/0_stateless/02269_to_start_of_interval_overflow.sql diff --git a/src/Functions/toStartOfInterval.cpp b/src/Functions/toStartOfInterval.cpp index bff33f9b061..440aa2ca463 100644 --- a/src/Functions/toStartOfInterval.cpp +++ b/src/Functions/toStartOfInterval.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -20,6 +21,7 @@ namespace ErrorCodes extern const int ILLEGAL_COLUMN; extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int ARGUMENT_OUT_OF_BOUND; + extern const int DECIMAL_OVERFLOW; } @@ -217,7 +219,9 @@ namespace { if (scale_multiplier < 1000) { - Int64 t_milliseconds = t * (static_cast(1000) / scale_multiplier); + Int64 t_milliseconds = 0; + if (common::mulOverflow(t, static_cast(1000) / scale_multiplier, t_milliseconds)) + throw DB::Exception("Numeric overflow", ErrorCodes::DECIMAL_OVERFLOW); if (likely(t >= 0)) return t_milliseconds / milliseconds * milliseconds; else @@ -252,7 +256,9 @@ namespace { if (scale_multiplier < 1000000) { - Int64 t_microseconds = t * (static_cast(1000000) / scale_multiplier); + Int64 t_microseconds = 0; + if (common::mulOverflow(t, static_cast(1000000) / scale_multiplier, t_microseconds)) + throw DB::Exception("Numeric overflow", ErrorCodes::DECIMAL_OVERFLOW); if (likely(t >= 0)) return t_microseconds / microseconds * microseconds; else @@ -287,7 +293,9 @@ namespace { if (scale_multiplier < 1000000000) { - Int64 t_nanoseconds = t * (static_cast(1000000000) / scale_multiplier); + Int64 t_nanoseconds = 0; + if (common::mulOverflow(t, (static_cast(1000000000) / scale_multiplier), t_nanoseconds)) + throw DB::Exception("Numeric overflow", ErrorCodes::DECIMAL_OVERFLOW); if (likely(t >= 0)) return t_nanoseconds / nanoseconds * nanoseconds; else diff --git a/tests/queries/0_stateless/02269_to_start_of_interval_overflow.reference b/tests/queries/0_stateless/02269_to_start_of_interval_overflow.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/02269_to_start_of_interval_overflow.sql b/tests/queries/0_stateless/02269_to_start_of_interval_overflow.sql new file mode 100644 index 00000000000..84204834614 --- /dev/null +++ b/tests/queries/0_stateless/02269_to_start_of_interval_overflow.sql @@ -0,0 +1,6 @@ +select toStartOfInterval(toDateTime64('\0930-12-12 12:12:12.1234567', 3), toIntervalNanosecond(1024)); -- {serverError 407} + +SELECT + toDateTime64(-9223372036854775808, 1048575, toIntervalNanosecond(9223372036854775806), NULL), + toStartOfInterval(toDateTime64(toIntervalNanosecond(toIntervalNanosecond(257), toDateTime64(toStartOfInterval(toDateTime64(NULL)))), '', 100), toIntervalNanosecond(toStartOfInterval(toDateTime64(toIntervalNanosecond(NULL), NULL)), -1)), + toStartOfInterval(toDateTime64('\0930-12-12 12:12:12.1234567', 3), toIntervalNanosecond(1024)); -- {serverError 407} From bd1f12e5d50595728e3c6078f3ed73eaac696dfa Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Tue, 26 Apr 2022 13:04:19 +0300 Subject: [PATCH 29/34] Update 02180_group_by_lowcardinality.sql --- tests/queries/0_stateless/02180_group_by_lowcardinality.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/queries/0_stateless/02180_group_by_lowcardinality.sql b/tests/queries/0_stateless/02180_group_by_lowcardinality.sql index 463753a624e..8f9e8891890 100644 --- a/tests/queries/0_stateless/02180_group_by_lowcardinality.sql +++ b/tests/queries/0_stateless/02180_group_by_lowcardinality.sql @@ -1,3 +1,5 @@ +-- Tags: no-random-settings + create table if not exists t_group_by_lowcardinality(p_date Date, val LowCardinality(Nullable(String))) engine=MergeTree() partition by p_date order by tuple(); From a96276aa091febcfc21ba0c64c5c9b1a48172ae8 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Tue, 26 Apr 2022 10:47:39 +0000 Subject: [PATCH 30/34] Update version_date.tsv after v22.3.4.20-lts --- utils/list-versions/version_date.tsv | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/list-versions/version_date.tsv b/utils/list-versions/version_date.tsv index 32b2170fcb2..ccc1d05c90c 100644 --- a/utils/list-versions/version_date.tsv +++ b/utils/list-versions/version_date.tsv @@ -1,5 +1,6 @@ v22.4.3.3-stable 2022-04-26 v22.4.2.1-stable 2022-04-22 +v22.3.4.20-lts 2022-04-26 v22.3.3.44-lts 2022-04-06 v22.3.2.2-lts 2022-03-17 v22.2.3.5-stable 2022-02-25 From 5198eec6f75bc994643808307adad575635b11ed Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Tue, 26 Apr 2022 13:58:35 +0200 Subject: [PATCH 31/34] Update 00170_s3_cache.sql --- tests/queries/1_stateful/00170_s3_cache.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/1_stateful/00170_s3_cache.sql b/tests/queries/1_stateful/00170_s3_cache.sql index d4837a1a800..68e1c9f6c60 100644 --- a/tests/queries/1_stateful/00170_s3_cache.sql +++ b/tests/queries/1_stateful/00170_s3_cache.sql @@ -1,4 +1,4 @@ --- Tags: no-parallel +-- Tags: no-parallel, no-random-settings -- { echo } From 89892cb652eda1a38927265887a0eb45657b325c Mon Sep 17 00:00:00 2001 From: Kruglov Pavel <48961922+Avogar@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:46:25 +0200 Subject: [PATCH 32/34] Update 00061_merge_tree_alter.sql --- tests/queries/0_stateless/00061_merge_tree_alter.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/queries/0_stateless/00061_merge_tree_alter.sql b/tests/queries/0_stateless/00061_merge_tree_alter.sql index 01c9c1ffb76..822386baa47 100644 --- a/tests/queries/0_stateless/00061_merge_tree_alter.sql +++ b/tests/queries/0_stateless/00061_merge_tree_alter.sql @@ -1,3 +1,5 @@ +-- Tags: no-backward-compatibility-check + DROP TABLE IF EXISTS alter_00061; CREATE TABLE alter_00061 (d Date, k UInt64, i32 Int32) ENGINE=MergeTree(d, k, 8192); From d149ac8bd759f2e7145934aa875b24b5a9f5efd7 Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Tue, 26 Apr 2022 16:58:40 +0200 Subject: [PATCH 33/34] better logs for virtual parts --- .../MergeTree/ReplicatedMergeTreeLogEntry.cpp | 11 +++++++++++ src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.h | 2 ++ src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp | 6 +++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.cpp b/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.cpp index 89515b863ca..efaf605d7d3 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.cpp @@ -504,4 +504,15 @@ Strings ReplicatedMergeTreeLogEntryData::getVirtualPartNames(MergeTreeDataFormat return {new_part_name}; } +String ReplicatedMergeTreeLogEntryData::getDescriptionForLogs(MergeTreeDataFormatVersion format_version) const +{ + String description = fmt::format("{} with virtual parts [{}]", typeToString(), fmt::join(getVirtualPartNames(format_version), ", ")); + if (auto drop_range = getDropRange(format_version)) + { + description += " and drop range "; + description += *drop_range; + } + return description; +} + } diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.h b/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.h index 4d8f319c94a..19a463e4914 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.h +++ b/src/Storages/MergeTree/ReplicatedMergeTreeLogEntry.h @@ -144,6 +144,8 @@ struct ReplicatedMergeTreeLogEntryData /// Returns fake part for drop range (for DROP_RANGE and REPLACE_RANGE) std::optional getDropRange(MergeTreeDataFormatVersion format_version) const; + String getDescriptionForLogs(MergeTreeDataFormatVersion format_version) const; + /// This entry is DROP PART, not DROP PARTITION. They both have same /// DROP_RANGE entry type, but differs in information about drop range. bool isDropPart(MergeTreeDataFormatVersion format_version) const; diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp b/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp index b4c037f8a99..ec314bbd0ce 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp @@ -213,7 +213,7 @@ void ReplicatedMergeTreeQueue::insertUnlocked( { auto entry_virtual_parts = entry->getVirtualPartNames(format_version); - LOG_TEST(log, "Insert entry {} to queue with type {} with virtual parts [{}]", entry->znode_name, entry->typeToString(), fmt::join(entry_virtual_parts, ", ")); + LOG_TEST(log, "Insert entry {} to queue with type {}", entry->znode_name, entry->getDescriptionForLogs(format_version)); for (const String & virtual_part_name : entry_virtual_parts) { @@ -293,9 +293,9 @@ void ReplicatedMergeTreeQueue::updateStateOnQueueEntryRemoval( { auto entry_virtual_parts = entry->getVirtualPartNames(format_version); - LOG_TEST(log, "Removing {} entry {} from queue with type {} with virtual parts [{}]", + LOG_TEST(log, "Removing {} entry {} from queue with type {}", is_successful ? "successful" : "unsuccessful", - entry->znode_name, entry->typeToString(), fmt::join(entry_virtual_parts, ", ")); + entry->znode_name, entry->getDescriptionForLogs(format_version)); /// Update insert times. if (entry->type == LogEntry::GET_PART || entry->type == LogEntry::ATTACH_PART) { From c0ee49920fca04472d5f14393e8993af3b3dfdfc Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 26 Apr 2022 20:09:03 +0200 Subject: [PATCH 34/34] [docs] title doesn't need a period + make it shorter (#36678) --- docs/en/development/integrating_rust_libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/development/integrating_rust_libraries.md b/docs/en/development/integrating_rust_libraries.md index c2c5228f489..92d30d63986 100644 --- a/docs/en/development/integrating_rust_libraries.md +++ b/docs/en/development/integrating_rust_libraries.md @@ -1,4 +1,4 @@ -# Integrating Rust libraries into ClickHouse. +# Integrating Rust libraries Rust library integration will be described based on BLAKE3 hash-function integration.