From ceecb1488af0fe4413053c87d9042b9d79602371 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 22 May 2023 17:29:52 +0800 Subject: [PATCH 01/63] add function arrayJaccardIndex --- src/Functions/array/arrayJaccardIndex.cpp | 161 ++++++++++++++++++ .../02737_arrayJaccardIndex.reference | 32 ++++ .../0_stateless/02737_arrayJaccardIndex.sql | 26 +++ 3 files changed, 219 insertions(+) create mode 100644 src/Functions/array/arrayJaccardIndex.cpp create mode 100644 tests/queries/0_stateless/02737_arrayJaccardIndex.reference create mode 100644 tests/queries/0_stateless/02737_arrayJaccardIndex.sql diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp new file mode 100644 index 00000000000..8cce98ab64d --- /dev/null +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -0,0 +1,161 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace DB +{ +namespace ErrorCodes +{ + extern const int ILLEGAL_COLUMN; + extern const int ILLEGAL_TYPE_OF_ARGUMENT; + extern const int LOGICAL_ERROR; +} + +class FunctionArrayJaccardIndex : public IFunction +{ +public: + using ResultType = Float64; + static constexpr auto name = "arrayJaccardIndex"; + String getName() const override { return name; } + static FunctionPtr create(ContextPtr context_) { return std::make_shared(context_); } + explicit FunctionArrayJaccardIndex(ContextPtr context_) : context(context_) {} + size_t getNumberOfArguments() const override { return 2; } + bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo &) const override { return true; } + bool useDefaultImplementationForConstants() const override { return true; } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + DataTypes types; + for (size_t i = 0; i < 2; ++i) + { + const auto * array_type = checkAndGetDataType(arguments[i].get()); + if (!array_type) + throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Argument {} of function {} must be array, but it has type{}.", i + 1, getName(), arguments[i]->getName()); + } + return std::make_shared>(); + } + + template + static void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + { + size_t left_size; + size_t right_size; + for (size_t i = 0; i < res.size(); ++i) + { + if constexpr (is_const_left) + left_size = left_offsets[0]; + else + left_size = left_offsets[i] - left_offsets[i - 1]; + if constexpr (is_const_right) + right_size = right_offsets[0]; + else + right_size = right_offsets[i] - right_offsets[i - 1]; + + size_t intersect_size = intersect_offsets[i] - intersect_offsets[i - 1]; + res[i] = static_cast(intersect_size) / (left_size + right_size - intersect_size); + if (unlikely(isnan(res[i]))) + res[i] = 1; + } + } + + template + static void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + { + size_t left_size; + size_t right_size; + for (size_t i = 0; i < res.size(); ++i) + { + if constexpr (is_const_left) + left_size = left_offsets[0]; + else + left_size = left_offsets[i] - left_offsets[i - 1]; + if constexpr (is_const_right) + right_size = right_offsets[0]; + else + right_size = right_offsets[i] - right_offsets[i - 1]; + + res[i] = static_cast(left_size + right_size == 0); + } + } + + ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override + { + bool is_const_left; + bool is_const_right; + const ColumnArray * left_array; + const ColumnArray * right_array; + + auto cast_array = [&](const ColumnWithTypeAndName & col) + { + const ColumnArray * res; + bool is_const = false; + if (typeid_cast(col.column.get())) + { + res = checkAndGetColumn(checkAndGetColumnConst(col.column.get())->getDataColumnPtr().get()); + is_const = true; + } + else if (!(res = checkAndGetColumn(col.column.get()))) + throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Argument for function {} must be array but it has type {}.", + col.column->getName(), getName()); + return std::make_pair(res, is_const); + }; + + std::tie(left_array, is_const_left) = cast_array(arguments[0]); + std::tie(right_array, is_const_right) = cast_array(arguments[1]); + + auto intersect_array = FunctionFactory::instance().get("arrayIntersect", context)->build(arguments); + ColumnWithTypeAndName intersect_column; + intersect_column.type = intersect_array->getResultType(); + intersect_column.column = intersect_array->execute(arguments, intersect_column.type, input_rows_count); + const auto * return_type_intersect = checkAndGetDataType(intersect_column.type.get()); + if (!return_type_intersect) + throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected return type for function arrayIntersect"); + + auto col_res = ColumnVector::create(); + typename ColumnVector::Container & vec_res = col_res->getData(); + vec_res.resize(input_rows_count); + +#define EXECUTE_VECTOR(is_const_left, is_const_right) \ + if (typeid_cast(return_type_intersect->getNestedType().get())) \ + vectorWithEmptyIntersect(left_array->getOffsets(), right_array->getOffsets(), vec_res); \ + else \ + { \ + const ColumnArray * col_array = checkAndGetColumn(intersect_column.column.get()); \ + vector(col_array->getOffsets(), left_array->getOffsets(), right_array->getOffsets(), vec_res); \ + } + + if (!is_const_left && !is_const_right) + EXECUTE_VECTOR(false, false) + else if (!is_const_left && is_const_right) + EXECUTE_VECTOR(false, true) + else if (is_const_left && !is_const_right) + EXECUTE_VECTOR(true, false) + else + EXECUTE_VECTOR(true, true) + +#undef EXECUTE_VECTOR + + return col_res; + } + +private: + ContextPtr context; +}; + +REGISTER_FUNCTION(ArrayJaccardIndex) +{ + factory.registerFunction(); +} + +} diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.reference b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference new file mode 100644 index 00000000000..e6934bfe092 --- /dev/null +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference @@ -0,0 +1,32 @@ +0 +0.5 +1 +0.67 +1 +0 +0 +0 +1 +0 +0 +0 +0 +0.5 +1 +0.67 +0.5 +0.5 +0.5 +0.5 +1 +1 +1 +1 +1 +1 +1 +1 +0.33 +0.2 +1 +1 diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql new file mode 100644 index 00000000000..c3f04ba0b10 --- /dev/null +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql @@ -0,0 +1,26 @@ +drop table if exists array_jaccard_index; + +create table array_jaccard_index (arr Array(UInt8)) engine=MergeTree partition by arr order by arr; + +insert into array_jaccard_index values ([1,2,3]); +insert into array_jaccard_index values ([1,2]); +insert into array_jaccard_index values ([1]); +insert into array_jaccard_index values ([]); + +select round(arrayJaccardIndex(arr, [1,2]), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex(arr, []), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex([], arr), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex([1,2], arr), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex([1,2], [1,2,3,4]), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex([], []), 2) from array_jaccard_index order by arr; +select round(arrayJaccardIndex(arr, arr), 2) from array_jaccard_index order by arr; + +drop table if exists array_jaccard_index; + +select round(arrayJaccardIndex(['a'], ['a', 'aa', 'aaa']), 2); + +select round(arrayJaccardIndex([1, 1.1, 2.2], [2.2, 3.3, 444]), 2); + +select round(arrayJaccardIndex([], []), 2); + +select round(arrayJaccardIndex([toUInt16(1)], [toUInt32(1)]), 2); From 656d6abb2ee2d221df01367bcb53465289e4981c Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 22 May 2023 22:49:02 +0800 Subject: [PATCH 02/63] fix style --- src/Functions/array/arrayJaccardIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp index 8cce98ab64d..c1ec8b53d25 100644 --- a/src/Functions/array/arrayJaccardIndex.cpp +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -100,7 +100,7 @@ public: { const ColumnArray * res; bool is_const = false; - if (typeid_cast(col.column.get())) + if (typeid_cast(col.column.get())) { res = checkAndGetColumn(checkAndGetColumnConst(col.column.get())->getDataColumnPtr().get()); is_const = true; From b0b9f2a037918b8f745df952a9491b97de6fdada Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Tue, 23 May 2023 10:39:23 +0800 Subject: [PATCH 03/63] fix test --- .../02415_all_new_functions_must_be_documented.reference | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference b/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference index 79a6ad1fa2d..5ef83a57ecf 100644 --- a/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference +++ b/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference @@ -112,6 +112,7 @@ arrayFirstIndex arrayFirstOrNull arrayFlatten arrayIntersect +arrayJaccardIndex arrayJoin arrayLast arrayLastIndex From 7ab660acfbcbc722beabea32d45524d6294ea5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Fri, 16 Jun 2023 12:20:40 +0200 Subject: [PATCH 04/63] Extract logging functions outside of executeQueryImpl --- src/Interpreters/AsynchronousInsertQueue.cpp | 2 + src/Interpreters/executeQuery.cpp | 647 ++++++++++--------- src/Interpreters/executeQuery.h | 45 +- 3 files changed, 384 insertions(+), 310 deletions(-) diff --git a/src/Interpreters/AsynchronousInsertQueue.cpp b/src/Interpreters/AsynchronousInsertQueue.cpp index dc2310cfebf..94171298780 100644 --- a/src/Interpreters/AsynchronousInsertQueue.cpp +++ b/src/Interpreters/AsynchronousInsertQueue.cpp @@ -395,6 +395,8 @@ try SCOPE_EXIT(CurrentMetrics::sub(CurrentMetrics::PendingAsyncInsert, data->entries.size())); + /// query_start_time context + settings query_for_logging + const auto * log = &Poco::Logger::get("AsynchronousInsertQueue"); const auto & insert_query = assert_cast(*key.query); auto insert_context = Context::createCopy(global_context); diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index de2e2b9ad92..122c8e0570a 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -155,7 +155,6 @@ static void logQuery(const String & query, ContextPtr context, bool internal, Qu } } - /// Call this inside catch block. static void setExceptionStackTrace(QueryLogElement & elem) { @@ -208,7 +207,331 @@ static void logException(ContextPtr context, QueryLogElement & elem, bool log_er LOG_INFO(&Poco::Logger::get("executeQuery"), message); } -static void onExceptionBeforeStart( +static void +addStatusInfoToQueryElement(QueryLogElement & element, const QueryStatusInfo & info, const ASTPtr query_ast, const ContextPtr context_ptr) +{ + const auto time_now = std::chrono::system_clock::now(); + UInt64 elapsed_microseconds = info.elapsed_microseconds; + element.event_time = timeInSeconds(time_now); + element.event_time_microseconds = timeInMicroseconds(time_now); + element.query_duration_ms = elapsed_microseconds / 1000; + + ProfileEvents::increment(ProfileEvents::QueryTimeMicroseconds, elapsed_microseconds); + if (query_ast->as() || query_ast->as()) + { + ProfileEvents::increment(ProfileEvents::SelectQueryTimeMicroseconds, elapsed_microseconds); + } + else if (query_ast->as()) + { + ProfileEvents::increment(ProfileEvents::InsertQueryTimeMicroseconds, elapsed_microseconds); + } + else + { + ProfileEvents::increment(ProfileEvents::OtherQueryTimeMicroseconds, elapsed_microseconds); + } + + element.read_rows = info.read_rows; + element.read_bytes = info.read_bytes; + + element.written_rows = info.written_rows; + element.written_bytes = info.written_bytes; + + element.memory_usage = info.peak_memory_usage > 0 ? info.peak_memory_usage : 0; + + element.thread_ids = info.thread_ids; + element.profile_counters = info.profile_counters; + + /// We need to refresh the access info since dependent views might have added extra information, either during + /// creation of the view (PushingToViews chain) or while executing its internal SELECT + const auto & access_info = context_ptr->getQueryAccessInfo(); + element.query_databases.insert(access_info.databases.begin(), access_info.databases.end()); + element.query_tables.insert(access_info.tables.begin(), access_info.tables.end()); + element.query_columns.insert(access_info.columns.begin(), access_info.columns.end()); + element.query_partitions.insert(access_info.partitions.begin(), access_info.partitions.end()); + element.query_projections.insert(access_info.projections.begin(), access_info.projections.end()); + element.query_views.insert(access_info.views.begin(), access_info.views.end()); + + const auto & factories_info = context_ptr->getQueryFactoriesInfo(); + element.used_aggregate_functions = factories_info.aggregate_functions; + element.used_aggregate_function_combinators = factories_info.aggregate_function_combinators; + element.used_database_engines = factories_info.database_engines; + element.used_data_type_families = factories_info.data_type_families; + element.used_dictionaries = factories_info.dictionaries; + element.used_formats = factories_info.formats; + element.used_functions = factories_info.functions; + element.used_storages = factories_info.storages; + element.used_table_functions = factories_info.table_functions; + + element.async_read_counters = context_ptr->getAsyncReadCounters(); +} + + +QueryLogElement logQueryStart( + const std::chrono::time_point & query_start_time, + const ContextMutablePtr & context, + const String & query_for_logging, + const ASTPtr & query_ast, + const QueryPipeline & pipeline, + const std::unique_ptr & interpreter, + bool internal, + const String & query_database, + const String & query_table) +{ + const Settings & settings = context->getSettingsRef(); + + QueryLogElement elem; + + elem.type = QueryLogElementType::QUERY_START; + elem.event_time = timeInSeconds(query_start_time); + elem.event_time_microseconds = timeInMicroseconds(query_start_time); + elem.query_start_time = timeInSeconds(query_start_time); + elem.query_start_time_microseconds = timeInMicroseconds(query_start_time); + + elem.current_database = context->getCurrentDatabase(); + elem.query = query_for_logging; + if (settings.log_formatted_queries) + elem.formatted_query = queryToString(query_ast); + elem.normalized_query_hash = normalizedQueryHash(query_for_logging); + elem.query_kind = query_ast->getQueryKind(); + + elem.client_info = context->getClientInfo(); + + if (auto txn = context->getCurrentTransaction()) + elem.tid = txn->tid; + + bool log_queries = settings.log_queries && !internal; + + /// Log into system table start of query execution, if need. + if (log_queries) + { + /// This check is not obvious, but without it 01220_scalar_optimization_in_alter fails. + if (pipeline.initialized()) + { + const auto & info = context->getQueryAccessInfo(); + elem.query_databases = info.databases; + elem.query_tables = info.tables; + elem.query_columns = info.columns; + elem.query_partitions = info.partitions; + elem.query_projections = info.projections; + elem.query_views = info.views; + } + + if (settings.async_insert) + InterpreterInsertQuery::extendQueryLogElemImpl(elem, context); + else if (interpreter) + interpreter->extendQueryLogElem(elem, query_ast, context, query_database, query_table); + + if (settings.log_query_settings) + elem.query_settings = std::make_shared(context->getSettingsRef()); + + elem.log_comment = settings.log_comment; + if (elem.log_comment.size() > settings.max_query_size) + elem.log_comment.resize(settings.max_query_size); + + if (elem.type >= settings.log_queries_min_type && !settings.log_queries_min_query_duration_ms.totalMilliseconds()) + { + if (auto query_log = context->getQueryLog()) + query_log->add(elem); + } + } + + return elem; +} + +void logQueryFinish( + QueryLogElement & elem, + const ContextMutablePtr & context, + const ASTPtr & query_ast, + const QueryPipeline & query_pipeline, + bool pulling_pipeline, + std::shared_ptr query_span, + bool internal) +{ + const Settings & settings = context->getSettingsRef(); + auto log_queries = settings.log_queries && !internal; + auto log_queries_min_type = settings.log_queries_min_type; + auto log_queries_min_query_duration_ms = settings.log_queries_min_query_duration_ms.totalMilliseconds(); + auto log_processors_profiles = settings.log_processors_profiles; + + QueryStatusPtr process_list_elem = context->getProcessListElement(); + if (process_list_elem) + { + /// Update performance counters before logging to query_log + CurrentThread::finalizePerformanceCounters(); + + QueryStatusInfo info = process_list_elem->getInfo(true, context->getSettingsRef().log_profile_events); + elem.type = QueryLogElementType::QUERY_FINISH; + + addStatusInfoToQueryElement(elem, info, query_ast, context); + + if (pulling_pipeline) + { + query_pipeline.tryGetResultRowsAndBytes(elem.result_rows, elem.result_bytes); + } + else /// will be used only for ordinary INSERT queries + { + auto progress_out = process_list_elem->getProgressOut(); + elem.result_rows = progress_out.written_rows; + elem.result_bytes = progress_out.written_bytes; + } + + auto progress_callback = context->getProgressCallback(); + if (progress_callback) + { + Progress p; + p.incrementPiecewiseAtomically(Progress{ResultProgress{elem.result_rows, elem.result_bytes}}); + progress_callback(p); + } + + if (elem.read_rows != 0) + { + double elapsed_seconds = static_cast(info.elapsed_microseconds) / 1000000.0; + double rows_per_second = static_cast(elem.read_rows) / elapsed_seconds; + LOG_DEBUG( + &Poco::Logger::get("executeQuery"), + "Read {} rows, {} in {} sec., {} rows/sec., {}/sec.", + elem.read_rows, + ReadableSize(elem.read_bytes), + elapsed_seconds, + rows_per_second, + ReadableSize(elem.read_bytes / elapsed_seconds)); + } + + if (log_queries && elem.type >= log_queries_min_type + && static_cast(elem.query_duration_ms) >= log_queries_min_query_duration_ms) + { + if (auto query_log = context->getQueryLog()) + query_log->add(elem); + } + if (log_processors_profiles) + { + if (auto processors_profile_log = context->getProcessorsProfileLog()) + { + ProcessorProfileLogElement processor_elem; + processor_elem.event_time = elem.event_time; + processor_elem.event_time_microseconds = elem.event_time_microseconds; + processor_elem.initial_query_id = elem.client_info.initial_query_id; + processor_elem.query_id = elem.client_info.current_query_id; + + auto get_proc_id = [](const IProcessor & proc) -> UInt64 { return reinterpret_cast(&proc); }; + + for (const auto & processor : query_pipeline.getProcessors()) + { + std::vector parents; + for (const auto & port : processor->getOutputs()) + { + if (!port.isConnected()) + continue; + const IProcessor & next = port.getInputPort().getProcessor(); + parents.push_back(get_proc_id(next)); + } + + processor_elem.id = get_proc_id(*processor); + processor_elem.parent_ids = std::move(parents); + + processor_elem.plan_step = reinterpret_cast(processor->getQueryPlanStep()); + processor_elem.plan_group = processor->getQueryPlanStepGroup(); + + processor_elem.processor_name = processor->getName(); + + /// NOTE: convert this to UInt64 + processor_elem.elapsed_us = static_cast(processor->getElapsedUs()); + processor_elem.input_wait_elapsed_us = static_cast(processor->getInputWaitElapsedUs()); + processor_elem.output_wait_elapsed_us = static_cast(processor->getOutputWaitElapsedUs()); + + auto stats = processor->getProcessorDataStats(); + processor_elem.input_rows = stats.input_rows; + processor_elem.input_bytes = stats.input_bytes; + processor_elem.output_rows = stats.output_rows; + processor_elem.output_bytes = stats.output_bytes; + + processors_profile_log->add(processor_elem); + } + } + } + } + + if (query_span) + { + query_span->addAttribute("db.statement", elem.query); + query_span->addAttribute("clickhouse.query_id", elem.client_info.current_query_id); + query_span->addAttribute("clickhouse.query_status", "QueryFinish"); + query_span->addAttributeIfNotEmpty("clickhouse.tracestate", OpenTelemetry::CurrentContext().tracestate); + query_span->addAttributeIfNotZero("clickhouse.read_rows", elem.read_rows); + query_span->addAttributeIfNotZero("clickhouse.read_bytes", elem.read_bytes); + query_span->addAttributeIfNotZero("clickhouse.written_rows", elem.written_rows); + query_span->addAttributeIfNotZero("clickhouse.written_bytes", elem.written_bytes); + query_span->addAttributeIfNotZero("clickhouse.memory_usage", elem.memory_usage); + query_span->finish(); + } +} + +void logQueryException( + QueryLogElement & elem, + const ContextMutablePtr & context, + const Stopwatch & start_watch, + const ASTPtr & query_ast, + std::shared_ptr query_span, + bool internal, + bool log_error) +{ + const Settings & settings = context->getSettingsRef(); + auto log_queries = settings.log_queries && !internal; + auto log_queries_min_type = settings.log_queries_min_type; + auto log_queries_min_query_duration_ms = settings.log_queries_min_query_duration_ms.totalMilliseconds(); + + elem.type = QueryLogElementType::EXCEPTION_WHILE_PROCESSING; + elem.exception_code = getCurrentExceptionCode(); + auto exception_message = getCurrentExceptionMessageAndPattern(/* with_stacktrace */ false); + elem.exception = std::move(exception_message.text); + elem.exception_format_string = exception_message.format_string; + + QueryStatusPtr process_list_elem = context->getProcessListElement(); + + /// Update performance counters before logging to query_log + CurrentThread::finalizePerformanceCounters(); + const auto time_now = std::chrono::system_clock::now(); + elem.event_time = timeInSeconds(time_now); + elem.event_time_microseconds = timeInMicroseconds(time_now); + + if (process_list_elem) + { + QueryStatusInfo info = process_list_elem->getInfo(true, settings.log_profile_events, false); + addStatusInfoToQueryElement(elem, info, query_ast, context); + } + else + { + elem.query_duration_ms = start_watch.elapsedMilliseconds(); + } + + if (settings.calculate_text_stack_trace && log_error) + setExceptionStackTrace(elem); + logException(context, elem, log_error); + + /// In case of exception we log internal queries also + if (log_queries && elem.type >= log_queries_min_type && static_cast(elem.query_duration_ms) >= log_queries_min_query_duration_ms) + { + if (auto query_log = context->getQueryLog()) + query_log->add(elem); + } + + ProfileEvents::increment(ProfileEvents::FailedQuery); + if (query_ast->as() || query_ast->as()) + ProfileEvents::increment(ProfileEvents::FailedSelectQuery); + else if (query_ast->as()) + ProfileEvents::increment(ProfileEvents::FailedInsertQuery); + + if (query_span) + { + query_span->addAttribute("db.statement", elem.query); + query_span->addAttribute("clickhouse.query_id", elem.client_info.current_query_id); + query_span->addAttribute("clickhouse.exception", elem.exception); + query_span->addAttribute("clickhouse.exception_code", elem.exception_code); + query_span->finish(); + } +} + +void logExceptionBeforeStart( const String & query_for_logging, ContextPtr context, ASTPtr ast, @@ -431,7 +754,7 @@ static std::tuple executeQueryImpl( logQuery(query_for_logging, context, internal, stage); if (!internal) - onExceptionBeforeStart(query_for_logging, context, ast, query_span, start_watch.elapsedMilliseconds()); + logExceptionBeforeStart(query_for_logging, context, ast, query_span, start_watch.elapsedMilliseconds()); throw; } @@ -810,134 +1133,17 @@ static std::tuple executeQueryImpl( /// Everything related to query log. { - QueryLogElement elem; - - elem.type = QueryLogElementType::QUERY_START; - - elem.event_time = timeInSeconds(query_start_time); - elem.event_time_microseconds = timeInMicroseconds(query_start_time); - elem.query_start_time = timeInSeconds(query_start_time); - elem.query_start_time_microseconds = timeInMicroseconds(query_start_time); - - elem.current_database = context->getCurrentDatabase(); - elem.query = query_for_logging; - if (settings.log_formatted_queries) - elem.formatted_query = queryToString(ast); - elem.normalized_query_hash = normalizedQueryHash(query_for_logging); - elem.query_kind = ast->getQueryKind(); - - elem.client_info = client_info; - - if (auto txn = context->getCurrentTransaction()) - elem.tid = txn->tid; - - bool log_queries = settings.log_queries && !internal; - - /// Log into system table start of query execution, if need. - if (log_queries) - { - /// This check is not obvious, but without it 01220_scalar_optimization_in_alter fails. - if (pipeline.initialized()) - { - const auto & info = context->getQueryAccessInfo(); - elem.query_databases = info.databases; - elem.query_tables = info.tables; - elem.query_columns = info.columns; - elem.query_partitions = info.partitions; - elem.query_projections = info.projections; - elem.query_views = info.views; - } - - if (async_insert) - InterpreterInsertQuery::extendQueryLogElemImpl(elem, context); - else if (interpreter) - interpreter->extendQueryLogElem(elem, ast, context, query_database, query_table); - - if (settings.log_query_settings) - elem.query_settings = std::make_shared(context->getSettingsRef()); - - elem.log_comment = settings.log_comment; - if (elem.log_comment.size() > settings.max_query_size) - elem.log_comment.resize(settings.max_query_size); - - if (elem.type >= settings.log_queries_min_type && !settings.log_queries_min_query_duration_ms.totalMilliseconds()) - { - if (auto query_log = context->getQueryLog()) - query_log->add(elem); - } - } - - /// Common code for finish and exception callbacks - auto status_info_to_query_log - = [](QueryLogElement & element, const QueryStatusInfo & info, const ASTPtr query_ast, const ContextPtr context_ptr) mutable - { - const auto time_now = std::chrono::system_clock::now(); - UInt64 elapsed_microseconds = info.elapsed_microseconds; - element.event_time = timeInSeconds(time_now); - element.event_time_microseconds = timeInMicroseconds(time_now); - element.query_duration_ms = elapsed_microseconds / 1000; - - ProfileEvents::increment(ProfileEvents::QueryTimeMicroseconds, elapsed_microseconds); - if (query_ast->as() || query_ast->as()) - { - ProfileEvents::increment(ProfileEvents::SelectQueryTimeMicroseconds, elapsed_microseconds); - } - else if (query_ast->as()) - { - ProfileEvents::increment(ProfileEvents::InsertQueryTimeMicroseconds, elapsed_microseconds); - } - else - { - ProfileEvents::increment(ProfileEvents::OtherQueryTimeMicroseconds, elapsed_microseconds); - } - - element.read_rows = info.read_rows; - element.read_bytes = info.read_bytes; - - element.written_rows = info.written_rows; - element.written_bytes = info.written_bytes; - - element.memory_usage = info.peak_memory_usage > 0 ? info.peak_memory_usage : 0; - - element.thread_ids = info.thread_ids; - element.profile_counters = info.profile_counters; - - /// We need to refresh the access info since dependent views might have added extra information, either during - /// creation of the view (PushingToViews chain) or while executing its internal SELECT - const auto & access_info = context_ptr->getQueryAccessInfo(); - element.query_databases.insert(access_info.databases.begin(), access_info.databases.end()); - element.query_tables.insert(access_info.tables.begin(), access_info.tables.end()); - element.query_columns.insert(access_info.columns.begin(), access_info.columns.end()); - element.query_partitions.insert(access_info.partitions.begin(), access_info.partitions.end()); - element.query_projections.insert(access_info.projections.begin(), access_info.projections.end()); - element.query_views.insert(access_info.views.begin(), access_info.views.end()); - - const auto & factories_info = context_ptr->getQueryFactoriesInfo(); - element.used_aggregate_functions = factories_info.aggregate_functions; - element.used_aggregate_function_combinators = factories_info.aggregate_function_combinators; - element.used_database_engines = factories_info.database_engines; - element.used_data_type_families = factories_info.data_type_families; - element.used_dictionaries = factories_info.dictionaries; - element.used_formats = factories_info.formats; - element.used_functions = factories_info.functions; - element.used_storages = factories_info.storages; - element.used_table_functions = factories_info.table_functions; - - element.async_read_counters = context_ptr->getAsyncReadCounters(); - }; - + QueryLogElement elem = logQueryStart( + query_start_time, context, query_for_logging, ast, pipeline, interpreter, internal, query_database, query_table); /// Also make possible for caller to log successful query finish and exception during execution. auto finish_callback = [elem, context, ast, my_can_use_query_cache = can_use_query_cache, enable_writes_to_query_cache = settings.enable_writes_to_query_cache, - query_cache_store_results_of_queries_with_nondeterministic_functions = settings.query_cache_store_results_of_queries_with_nondeterministic_functions, - log_queries, - log_queries_min_type = settings.log_queries_min_type, - log_queries_min_query_duration_ms = settings.log_queries_min_query_duration_ms.totalMilliseconds(), - log_processors_profiles = settings.log_processors_profiles, - status_info_to_query_log, + query_cache_store_results_of_queries_with_nondeterministic_functions + = settings.query_cache_store_results_of_queries_with_nondeterministic_functions, + internal, implicit_txn_control, execute_implicit_tcl_query, pulling_pipeline = pipeline.pulling(), @@ -954,137 +1160,15 @@ static std::tuple executeQueryImpl( query_pipeline.finalizeWriteInQueryCache(); } - QueryStatusPtr process_list_elem = context->getProcessListElement(); + logQueryFinish(elem, context, ast, query_pipeline, pulling_pipeline, query_span, internal); - if (process_list_elem) - { - /// Update performance counters before logging to query_log - CurrentThread::finalizePerformanceCounters(); - - QueryStatusInfo info = process_list_elem->getInfo(true, context->getSettingsRef().log_profile_events); - elem.type = QueryLogElementType::QUERY_FINISH; - - status_info_to_query_log(elem, info, ast, context); - - if (pulling_pipeline) - { - query_pipeline.tryGetResultRowsAndBytes(elem.result_rows, elem.result_bytes); - } - else /// will be used only for ordinary INSERT queries - { - auto progress_out = process_list_elem->getProgressOut(); - elem.result_rows = progress_out.written_rows; - elem.result_bytes = progress_out.written_bytes; - } - - auto progress_callback = context->getProgressCallback(); - if (progress_callback) - { - Progress p; - p.incrementPiecewiseAtomically(Progress{ResultProgress{elem.result_rows, elem.result_bytes}}); - progress_callback(p); - } - - if (elem.read_rows != 0) - { - double elapsed_seconds = static_cast(info.elapsed_microseconds) / 1000000.0; - double rows_per_second = static_cast(elem.read_rows) / elapsed_seconds; - LOG_DEBUG( - &Poco::Logger::get("executeQuery"), - "Read {} rows, {} in {} sec., {} rows/sec., {}/sec.", - elem.read_rows, - ReadableSize(elem.read_bytes), - elapsed_seconds, - rows_per_second, - ReadableSize(elem.read_bytes / elapsed_seconds)); - } - - if (log_queries && elem.type >= log_queries_min_type && static_cast(elem.query_duration_ms) >= log_queries_min_query_duration_ms) - { - if (auto query_log = context->getQueryLog()) - query_log->add(elem); - } - if (log_processors_profiles) - { - if (auto processors_profile_log = context->getProcessorsProfileLog()) - { - ProcessorProfileLogElement processor_elem; - processor_elem.event_time = elem.event_time; - processor_elem.event_time_microseconds = elem.event_time_microseconds; - processor_elem.initial_query_id = elem.client_info.initial_query_id; - processor_elem.query_id = elem.client_info.current_query_id; - - auto get_proc_id = [](const IProcessor & proc) -> UInt64 - { - return reinterpret_cast(&proc); - }; - - for (const auto & processor : query_pipeline.getProcessors()) - { - std::vector parents; - for (const auto & port : processor->getOutputs()) - { - if (!port.isConnected()) - continue; - const IProcessor & next = port.getInputPort().getProcessor(); - parents.push_back(get_proc_id(next)); - } - - processor_elem.id = get_proc_id(*processor); - processor_elem.parent_ids = std::move(parents); - - processor_elem.plan_step = reinterpret_cast(processor->getQueryPlanStep()); - processor_elem.plan_group = processor->getQueryPlanStepGroup(); - - processor_elem.processor_name = processor->getName(); - - /// NOTE: convert this to UInt64 - processor_elem.elapsed_us = static_cast(processor->getElapsedUs()); - processor_elem.input_wait_elapsed_us = static_cast(processor->getInputWaitElapsedUs()); - processor_elem.output_wait_elapsed_us = static_cast(processor->getOutputWaitElapsedUs()); - - auto stats = processor->getProcessorDataStats(); - processor_elem.input_rows = stats.input_rows; - processor_elem.input_bytes = stats.input_bytes; - processor_elem.output_rows = stats.output_rows; - processor_elem.output_bytes = stats.output_bytes; - - processors_profile_log->add(processor_elem); - } - } - } - - if (*implicit_txn_control) - execute_implicit_tcl_query(context, ASTTransactionControl::COMMIT); - } - - if (query_span) - { - query_span->addAttribute("db.statement", elem.query); - query_span->addAttribute("clickhouse.query_id", elem.client_info.current_query_id); - query_span->addAttribute("clickhouse.query_status", "QueryFinish"); - query_span->addAttributeIfNotEmpty("clickhouse.tracestate", OpenTelemetry::CurrentContext().tracestate); - query_span->addAttributeIfNotZero("clickhouse.read_rows", elem.read_rows); - query_span->addAttributeIfNotZero("clickhouse.read_bytes", elem.read_bytes); - query_span->addAttributeIfNotZero("clickhouse.written_rows", elem.written_rows); - query_span->addAttributeIfNotZero("clickhouse.written_bytes", elem.written_bytes); - query_span->addAttributeIfNotZero("clickhouse.memory_usage", elem.memory_usage); - query_span->finish(); - } + if (*implicit_txn_control) + execute_implicit_tcl_query(context, ASTTransactionControl::COMMIT); }; - auto exception_callback = [start_watch, - elem, - context, - ast, - log_queries, - log_queries_min_type = settings.log_queries_min_type, - log_queries_min_query_duration_ms = settings.log_queries_min_query_duration_ms.totalMilliseconds(), - my_quota(quota), - status_info_to_query_log, - implicit_txn_control, - execute_implicit_tcl_query, - query_span](bool log_error) mutable + auto exception_callback = + [start_watch, elem, context, ast, internal, my_quota(quota), implicit_txn_control, execute_implicit_tcl_query, query_span]( + bool log_error) mutable { if (*implicit_txn_control) execute_implicit_tcl_query(context, ASTTransactionControl::ROLLBACK); @@ -1094,60 +1178,7 @@ static std::tuple executeQueryImpl( if (my_quota) my_quota->used(QuotaType::ERRORS, 1, /* check_exceeded = */ false); - elem.type = QueryLogElementType::EXCEPTION_WHILE_PROCESSING; - elem.exception_code = getCurrentExceptionCode(); - auto exception_message = getCurrentExceptionMessageAndPattern(/* with_stacktrace */ false); - elem.exception = std::move(exception_message.text); - elem.exception_format_string = exception_message.format_string; - - QueryStatusPtr process_list_elem = context->getProcessListElement(); - const Settings & current_settings = context->getSettingsRef(); - - /// Update performance counters before logging to query_log - CurrentThread::finalizePerformanceCounters(); - const auto time_now = std::chrono::system_clock::now(); - elem.event_time = timeInSeconds(time_now); - elem.event_time_microseconds = timeInMicroseconds(time_now); - - if (process_list_elem) - { - QueryStatusInfo info = process_list_elem->getInfo(true, current_settings.log_profile_events, false); - status_info_to_query_log(elem, info, ast, context); - } - else - { - elem.query_duration_ms = start_watch.elapsedMilliseconds(); - } - - if (current_settings.calculate_text_stack_trace && log_error) - setExceptionStackTrace(elem); - logException(context, elem, log_error); - - /// In case of exception we log internal queries also - if (log_queries && elem.type >= log_queries_min_type && static_cast(elem.query_duration_ms) >= log_queries_min_query_duration_ms) - { - if (auto query_log = context->getQueryLog()) - query_log->add(elem); - } - - ProfileEvents::increment(ProfileEvents::FailedQuery); - if (ast->as() || ast->as()) - { - ProfileEvents::increment(ProfileEvents::FailedSelectQuery); - } - else if (ast->as()) - { - ProfileEvents::increment(ProfileEvents::FailedInsertQuery); - } - - if (query_span) - { - query_span->addAttribute("db.statement", elem.query); - query_span->addAttribute("clickhouse.query_id", elem.client_info.current_query_id); - query_span->addAttribute("clickhouse.exception", elem.exception); - query_span->addAttribute("clickhouse.exception_code", elem.exception_code); - query_span->finish(); - } + logQueryException(elem, context, start_watch, ast, query_span, internal, log_error); }; res.finish_callback = std::move(finish_callback); @@ -1162,7 +1193,7 @@ static std::tuple executeQueryImpl( txn->onException(); if (!internal) - onExceptionBeforeStart(query_for_logging, context, ast, query_span, start_watch.elapsedMilliseconds()); + logExceptionBeforeStart(query_for_logging, context, ast, query_span, start_watch.elapsedMilliseconds()); throw; } diff --git a/src/Interpreters/executeQuery.h b/src/Interpreters/executeQuery.h index 93152cc1de6..3fa76dbfcb1 100644 --- a/src/Interpreters/executeQuery.h +++ b/src/Interpreters/executeQuery.h @@ -1,15 +1,21 @@ #pragma once #include -#include -#include #include +#include +#include +#include + +#include +#include namespace DB { +class IInterpreter; class ReadBuffer; class WriteBuffer; +struct QueryStatusInfo; struct QueryResultDetails { @@ -66,4 +72,39 @@ BlockIO executeQuery( /// if built pipeline does not require any input and does not produce any output. void executeTrivialBlockIO(BlockIO & streams, ContextPtr context); +/// Prepares a QueryLogElement and, if enabled, logs it to system.query_log +QueryLogElement logQueryStart( + const std::chrono::time_point & query_start_time, + const ContextMutablePtr & context, + const String & query_for_logging, + const ASTPtr & query_ast, + const QueryPipeline & pipeline, + const std::unique_ptr & interpreter, + bool internal, + const String & query_database, + const String & query_table); + +void logQueryFinish( + QueryLogElement & elem, + const ContextMutablePtr & context, + const ASTPtr & query_ast, + const QueryPipeline & query_pipeline, + bool pulling_pipeline, + std::shared_ptr query_span, + bool internal); + +void logQueryException( + QueryLogElement & elem, + const ContextMutablePtr & context, + const Stopwatch & start_watch, + const ASTPtr & query_ast, + std::shared_ptr query_span, + bool internal); + +void logExceptionBeforeStart( + const String & query_for_logging, + ContextPtr context, + ASTPtr ast, + const std::shared_ptr & query_span, + UInt64 elapsed_millliseconds); } From cf74aee6c9992a65f88a1a91f920227fa0c55bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 19 Jun 2023 13:39:30 +0200 Subject: [PATCH 05/63] Log async query flushes to query_log --- src/Interpreters/AsynchronousInsertLog.cpp | 19 +-- src/Interpreters/AsynchronousInsertLog.h | 5 +- src/Interpreters/AsynchronousInsertQueue.cpp | 133 ++++++++++++++----- src/Interpreters/ProcessList.cpp | 18 ++- src/Interpreters/ProcessList.h | 9 +- src/Interpreters/executeQuery.cpp | 13 +- src/Interpreters/executeQuery.h | 9 +- src/Parsers/IAST.h | 1 + 8 files changed, 144 insertions(+), 63 deletions(-) diff --git a/src/Interpreters/AsynchronousInsertLog.cpp b/src/Interpreters/AsynchronousInsertLog.cpp index eeccd9ad92e..d7c9059d9de 100644 --- a/src/Interpreters/AsynchronousInsertLog.cpp +++ b/src/Interpreters/AsynchronousInsertLog.cpp @@ -55,21 +55,10 @@ void AsynchronousInsertLogElement::appendToBlock(MutableColumns & columns) const columns[i++]->insert(event_time); columns[i++]->insert(event_time_microseconds); - const auto & insert_query = assert_cast(*query); - columns[i++]->insert(queryToString(insert_query)); - - if (insert_query.table_id) - { - columns[i++]->insert(insert_query.table_id.getDatabaseName()); - columns[i++]->insert(insert_query.table_id.getTableName()); - } - else - { - columns[i++]->insertDefault(); - columns[i++]->insertDefault(); - } - - columns[i++]->insert(insert_query.format); + columns[i++]->insert(query_for_logging); + columns[i++]->insert(database); + columns[i++]->insert(table); + columns[i++]->insert(format); columns[i++]->insert(query_id); columns[i++]->insert(bytes); columns[i++]->insert(rows); diff --git a/src/Interpreters/AsynchronousInsertLog.h b/src/Interpreters/AsynchronousInsertLog.h index 372d1cf5a1b..a76db78d3ea 100644 --- a/src/Interpreters/AsynchronousInsertLog.h +++ b/src/Interpreters/AsynchronousInsertLog.h @@ -21,8 +21,11 @@ struct AsynchronousInsertLogElement time_t event_time{}; Decimal64 event_time_microseconds{}; - ASTPtr query; String query_id; + String query_for_logging; + String database; + String table; + String format; UInt64 bytes{}; UInt64 rows{}; String exception; diff --git a/src/Interpreters/AsynchronousInsertQueue.cpp b/src/Interpreters/AsynchronousInsertQueue.cpp index 94171298780..996a92cef6f 100644 --- a/src/Interpreters/AsynchronousInsertQueue.cpp +++ b/src/Interpreters/AsynchronousInsertQueue.cpp @@ -1,33 +1,37 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include namespace CurrentMetrics @@ -395,11 +399,15 @@ try SCOPE_EXIT(CurrentMetrics::sub(CurrentMetrics::PendingAsyncInsert, data->entries.size())); - /// query_start_time context + settings query_for_logging - const auto * log = &Poco::Logger::get("AsynchronousInsertQueue"); const auto & insert_query = assert_cast(*key.query); auto insert_context = Context::createCopy(global_context); + DB::CurrentThread::QueryScope query_scope_holder(insert_context); + bool internal = false; // To enable logging this query + bool async_insert = true; + + /// Disabled query spans. Could be activated by initializating this to a SpanHolder + std::shared_ptr query_span{nullptr}; /// 'resetParser' doesn't work for parallel parsing. key.settings.set("input_format_parallel_parsing", false); @@ -407,12 +415,67 @@ try insert_context->setSettings(key.settings); /// Set initial_query_id, because it's used in InterpreterInsertQuery for table lock. - insert_context->getClientInfo().query_kind = ClientInfo::QueryKind::INITIAL_QUERY; insert_context->setCurrentQueryId(""); - InterpreterInsertQuery interpreter(key.query, insert_context, key.settings.insert_allow_materialized_columns, false, false, true); - auto pipeline = interpreter.execute().pipeline; - assert(pipeline.pushing()); + auto insert_query_id = insert_context->getCurrentQueryId(); + auto query_start_time = std::chrono::system_clock::now(); + Stopwatch start_watch{CLOCK_MONOTONIC}; + ClientInfo & client_info = insert_context->getClientInfo(); + client_info.query_kind = ClientInfo::QueryKind::INITIAL_QUERY; + client_info.initial_query_start_time = timeInSeconds(query_start_time); + client_info.initial_query_start_time_microseconds = timeInMicroseconds(query_start_time); + client_info.current_query_id = insert_query_id; + client_info.initial_query_id = insert_query_id; + size_t log_queries_cut_to_length = insert_context->getSettingsRef().log_queries_cut_to_length; + String query_for_logging = insert_query.hasSecretParts() + ? insert_query.formatForLogging(log_queries_cut_to_length) + : wipeSensitiveDataAndCutToLength(serializeAST(insert_query), log_queries_cut_to_length); + + /// We add it to the process list so + /// a) it appears in system.processes + /// b) can be cancelled if we want to + /// c) has an associated process list element where runtime metrics are stored + auto process_list_entry = insert_context->getProcessList().insert( + query_for_logging, key.query.get(), insert_context, start_watch.getStart(), IAST::QueryKind::AsyncInsertFlush); + auto query_status = process_list_entry->getQueryStatus(); + insert_context->setProcessListElement(std::move(query_status)); + + String query_database{}; + String query_table{}; + if (insert_query.table_id) + { + query_database = insert_query.table_id.getDatabaseName(); + query_table = insert_query.table_id.getTableName(); + insert_context->setInsertionTable(insert_query.table_id); + } + std::unique_ptr interpreter; + QueryPipeline pipeline; + QueryLogElement query_log_elem; + + try + { + interpreter = std::make_unique( + key.query, insert_context, key.settings.insert_allow_materialized_columns, false, false, true); + pipeline = interpreter->execute().pipeline; + chassert(pipeline.pushing()); + + query_log_elem = logQueryStart( + query_start_time, + insert_context, + query_for_logging, + key.query, + pipeline, + interpreter, + internal, + query_database, + query_table, + async_insert); + } + catch (...) + { + logExceptionBeforeStart(query_for_logging, insert_context, key.query, query_span, start_watch.elapsedMilliseconds(), async_insert); + throw; + } auto header = pipeline.getHeader(); auto format = getInputFormatFromASTInsertQuery(key.query, false, header, insert_context, nullptr); @@ -472,7 +535,10 @@ try AsynchronousInsertLogElement elem; elem.event_time = timeInSeconds(entry->create_time); elem.event_time_microseconds = timeInMicroseconds(entry->create_time); - elem.query = key.query; + elem.query_for_logging = query_for_logging; + elem.database = query_database; + elem.table = query_table; + elem.format = insert_query.format; elem.query_id = entry->query_id; elem.bytes = bytes_size; elem.rows = num_rows; @@ -495,7 +561,6 @@ try } format->addBuffer(std::move(last_buffer)); - auto insert_query_id = insert_context->getCurrentQueryId(); ProfileEvents::increment(ProfileEvents::AsyncInsertRows, total_rows); auto finish_entries = [&] @@ -533,9 +598,15 @@ try LOG_INFO(log, "Flushed {} rows, {} bytes for query '{}'", total_rows, total_bytes, key.query_str); + + bool pulling_pipeline = false; + /// TODO: Not working. Is the context missing its getProcessListElement ??? + logQueryFinish(query_log_elem, insert_context, key.query, pipeline, pulling_pipeline, query_span, internal); } catch (...) { + bool log_error = true; + logQueryException(query_log_elem, insert_context, start_watch, key.query, query_span, internal, log_error); if (!log_elements.empty()) { auto exception = getCurrentExceptionMessage(false); diff --git a/src/Interpreters/ProcessList.cpp b/src/Interpreters/ProcessList.cpp index aca474bf152..766bdba0cef 100644 --- a/src/Interpreters/ProcessList.cpp +++ b/src/Interpreters/ProcessList.cpp @@ -32,13 +32,13 @@ namespace ErrorCodes /// Should we execute the query even if max_concurrent_queries limit is exhausted -static bool isUnlimitedQuery(const IAST * ast) +static bool isUnlimitedQuery(const IAST * ast, IAST::QueryKind query_kind) { if (!ast) return false; - /// It is KILL QUERY - if (ast->as()) + /// It is KILL QUERY or an async insert flush query + if (ast->as() || query_kind == IAST::QueryKind::AsyncInsertFlush) return true; /// It is SELECT FROM system.processes @@ -65,8 +65,12 @@ static bool isUnlimitedQuery(const IAST * ast) } -ProcessList::EntryPtr -ProcessList::insert(const String & query_, const IAST * ast, ContextMutablePtr query_context, UInt64 watch_start_nanoseconds) +ProcessList::EntryPtr ProcessList::insert( + const String & query_, + const IAST * ast, + ContextMutablePtr query_context, + UInt64 watch_start_nanoseconds, + IAST::QueryKind force_query_kind) { EntryPtr res; @@ -76,11 +80,11 @@ ProcessList::insert(const String & query_, const IAST * ast, ContextMutablePtr q if (client_info.current_query_id.empty()) throw Exception(ErrorCodes::LOGICAL_ERROR, "Query id cannot be empty"); - bool is_unlimited_query = isUnlimitedQuery(ast); + bool is_unlimited_query = isUnlimitedQuery(ast, force_query_kind); { auto [lock, overcommit_blocker] = safeLock(); // To avoid deadlock in case of OOM - IAST::QueryKind query_kind = ast->getQueryKind(); + IAST::QueryKind query_kind = force_query_kind != IAST::QueryKind::None ? force_query_kind : ast->getQueryKind(); const auto queue_max_wait_ms = settings.queue_max_wait_ms.totalMilliseconds(); if (!is_unlimited_query && max_size && processes.size() >= max_size) diff --git a/src/Interpreters/ProcessList.h b/src/Interpreters/ProcessList.h index b593bcef395..8fb92afc8c8 100644 --- a/src/Interpreters/ProcessList.h +++ b/src/Interpreters/ProcessList.h @@ -392,9 +392,14 @@ public: /** Register running query. Returns refcounted object, that will remove element from list in destructor. * If too many running queries - wait for not more than specified (see settings) amount of time. * If timeout is passed - throw an exception. - * Don't count KILL QUERY queries. + * Don't count KILL QUERY queries or async insert flush queries */ - EntryPtr insert(const String & query_, const IAST * ast, ContextMutablePtr query_context, UInt64 watch_start_nanoseconds); + EntryPtr insert( + const String & query_, + const IAST * ast, + ContextMutablePtr query_context, + UInt64 watch_start_nanoseconds, + IAST::QueryKind force_query_kind = IAST::QueryKind::None); /// Number of currently executing queries. size_t size() const { return processes.size(); } diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index 122c8e0570a..c276842ea5e 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -275,7 +275,8 @@ QueryLogElement logQueryStart( const std::unique_ptr & interpreter, bool internal, const String & query_database, - const String & query_table) + const String & query_table, + bool async_insert) { const Settings & settings = context->getSettingsRef(); @@ -292,7 +293,7 @@ QueryLogElement logQueryStart( if (settings.log_formatted_queries) elem.formatted_query = queryToString(query_ast); elem.normalized_query_hash = normalizedQueryHash(query_for_logging); - elem.query_kind = query_ast->getQueryKind(); + elem.query_kind = async_insert ? IAST::QueryKind::AsyncInsertFlush : query_ast->getQueryKind(); elem.client_info = context->getClientInfo(); @@ -316,7 +317,7 @@ QueryLogElement logQueryStart( elem.query_views = info.views; } - if (settings.async_insert) + if (settings.async_insert || async_insert) InterpreterInsertQuery::extendQueryLogElemImpl(elem, context); else if (interpreter) interpreter->extendQueryLogElem(elem, query_ast, context, query_database, query_table); @@ -536,7 +537,8 @@ void logExceptionBeforeStart( ContextPtr context, ASTPtr ast, const std::shared_ptr & query_span, - UInt64 elapsed_millliseconds) + UInt64 elapsed_millliseconds, + bool async_insert) { auto query_end_time = std::chrono::system_clock::now(); @@ -570,6 +572,9 @@ void logExceptionBeforeStart( elem.formatted_query = queryToString(ast); } + if (async_insert) + elem.query_kind = IAST::QueryKind::AsyncInsertFlush; + // We don't calculate databases, tables and columns when the query isn't able to start elem.exception_code = getCurrentExceptionCode(); diff --git a/src/Interpreters/executeQuery.h b/src/Interpreters/executeQuery.h index 3fa76dbfcb1..f1fe6b86b79 100644 --- a/src/Interpreters/executeQuery.h +++ b/src/Interpreters/executeQuery.h @@ -82,7 +82,8 @@ QueryLogElement logQueryStart( const std::unique_ptr & interpreter, bool internal, const String & query_database, - const String & query_table); + const String & query_table, + bool async_insert = false); void logQueryFinish( QueryLogElement & elem, @@ -99,12 +100,14 @@ void logQueryException( const Stopwatch & start_watch, const ASTPtr & query_ast, std::shared_ptr query_span, - bool internal); + bool internal, + bool log_error); void logExceptionBeforeStart( const String & query_for_logging, ContextPtr context, ASTPtr ast, const std::shared_ptr & query_span, - UInt64 elapsed_millliseconds); + UInt64 elapsed_millliseconds, + bool async_insert = false); } diff --git a/src/Parsers/IAST.h b/src/Parsers/IAST.h index aa5302a15b9..7a8ab36518d 100644 --- a/src/Parsers/IAST.h +++ b/src/Parsers/IAST.h @@ -305,6 +305,7 @@ public: Commit, Rollback, SetTransactionSnapshot, + AsyncInsertFlush }; /// Return QueryKind of this AST query. virtual QueryKind getQueryKind() const { return QueryKind::None; } From e60f0e96cc9e59fe20679780ec42d7302536b2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 19 Jun 2023 17:06:32 +0200 Subject: [PATCH 06/63] Add tests for async insert flush queries in query_log --- ...02790_async_queries_in_query_log.reference | 135 ++++++++++++++++++ .../02790_async_queries_in_query_log.sh | 74 ++++++++++ 2 files changed, 209 insertions(+) create mode 100644 tests/queries/0_stateless/02790_async_queries_in_query_log.reference create mode 100755 tests/queries/0_stateless/02790_async_queries_in_query_log.sh diff --git a/tests/queries/0_stateless/02790_async_queries_in_query_log.reference b/tests/queries/0_stateless/02790_async_queries_in_query_log.reference new file mode 100644 index 00000000000..e202a38f068 --- /dev/null +++ b/tests/queries/0_stateless/02790_async_queries_in_query_log.reference @@ -0,0 +1,135 @@ + +system.query_log +Row 1: +────── +type: QueryStart +read_rows: 0 +read_bytes: 0 +written_rows: 0 +written_bytes: 0 +result_rows: 0 +result_bytes: 0 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing'] +columns: [] +views: [] +exception_code: 0 + +Row 2: +────── +type: QueryFinish +read_rows: 0 +read_bytes: 0 +written_rows: 4 +written_bytes: 16 +result_rows: 4 +result_bytes: 16 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing'] +columns: [] +views: [] +exception_code: 0 + +system.query_views_log + +system.query_log +Row 1: +────── +type: QueryStart +read_rows: 0 +read_bytes: 0 +written_rows: 0 +written_bytes: 0 +result_rows: 0 +result_bytes: 0 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing','default.async_insert_target'] +columns: [] +views: ['default.async_insert_mv'] +exception_code: 0 + +Row 2: +────── +type: QueryFinish +read_rows: 3 +read_bytes: 12 +written_rows: 6 +written_bytes: 12 +result_rows: 6 +result_bytes: 12 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing','default.async_insert_target'] +columns: ['default.async_insert_landing.id'] +views: ['default.async_insert_mv'] +exception_code: 0 + +system.query_views_log +Row 1: +────── +view_name: default.async_insert_mv +view_type: Materialized +view_query: SELECT id + throwIf(id = 42) FROM default.async_insert_landing +view_target: default.async_insert_target +read_rows: 3 +read_bytes: 12 +written_rows: 3 +written_bytes: 0 +status: QueryFinish +exception_code: 0 + +system.query_log +Row 1: +────── +type: QueryStart +read_rows: 0 +read_bytes: 0 +written_rows: 0 +written_bytes: 0 +result_rows: 0 +result_bytes: 0 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing','default.async_insert_target'] +columns: [] +views: ['default.async_insert_mv'] +exception_code: 0 + +Row 2: +────── +type: Exc*****onWhileProcessing +read_rows: 3 +read_bytes: 12 +written_rows: 3 +written_bytes: 12 +result_rows: 0 +result_bytes: 0 +query: INSERT INTO default.async_insert_landing SETTINGS wait_for_async_insert = 1, async_insert = 1 FORMAT Values +query_kind: AsyncInsertFlush +databases: ['default'] +tables: ['default.async_insert_landing','default.async_insert_target'] +columns: ['default.async_insert_landing.id'] +views: ['default.async_insert_mv'] +exception_code: 395 + +system.query_views_log +Row 1: +────── +view_name: default.async_insert_mv +view_type: Materialized +view_query: SELECT id + throwIf(id = 42) FROM default.async_insert_landing +view_target: default.async_insert_target +read_rows: 3 +read_bytes: 12 +written_rows: 0 +written_bytes: 0 +status: Exc*****onWhileProcessing +exception_code: 395 diff --git a/tests/queries/0_stateless/02790_async_queries_in_query_log.sh b/tests/queries/0_stateless/02790_async_queries_in_query_log.sh new file mode 100755 index 00000000000..f5553f16e7a --- /dev/null +++ b/tests/queries/0_stateless/02790_async_queries_in_query_log.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CUR_DIR"/../shell_config.sh + +function print_flush_query_logs() +{ + ${CLICKHOUSE_CLIENT} -q "SYSTEM FLUSH LOGS" + echo "" + echo "system.query_log" + ${CLICKHOUSE_CLIENT} -q " + SELECT + replace(type::String, 'Exception', 'Exc*****on') as type, + read_rows, + read_bytes, + written_rows, + written_bytes, + result_rows, + result_bytes, + query, + query_kind, + databases, + tables, + columns, + views, + exception_code + FROM system.query_log + WHERE + event_date >= yesterday() + AND initial_query_id = (SELECT flush_query_id FROM system.asynchronous_insert_log WHERE query_id = '$1') + ORDER BY type DESC + FORMAT Vertical" + + echo "" + echo "system.query_views_log" + ${CLICKHOUSE_CLIENT} -q " + SELECT + view_name, + view_type, + view_query, + view_target, + read_rows, + read_bytes, + written_rows, + written_bytes, + replace(status::String, 'Exception', 'Exc*****on') as status, + exception_code + FROM system.query_views_log + WHERE + event_date >= yesterday() + AND initial_query_id = (SELECT flush_query_id FROM system.asynchronous_insert_log WHERE query_id = '$1') + FORMAT Vertical" +} + + +${CLICKHOUSE_CLIENT} -q "CREATE TABLE async_insert_landing (id UInt32) ENGINE = MergeTree ORDER BY id" + +query_id="$(random_str 10)" +${CLICKHOUSE_CLIENT} --query_id="${query_id}" -q "INSERT INTO async_insert_landing SETTINGS wait_for_async_insert=1, async_insert=1 values (1), (2), (3), (4);" +print_flush_query_logs ${query_id} + + +${CLICKHOUSE_CLIENT} -q "CREATE TABLE async_insert_target (id UInt32) ENGINE = MergeTree ORDER BY id" +${CLICKHOUSE_CLIENT} -q "CREATE MATERIALIZED VIEW async_insert_mv TO async_insert_target AS SELECT id + throwIf(id = 42) FROM async_insert_landing" + +query_id="$(random_str 10)" +${CLICKHOUSE_CLIENT} --query_id="${query_id}" -q "INSERT INTO async_insert_landing SETTINGS wait_for_async_insert=1, async_insert=1 values (11), (12), (13);" +print_flush_query_logs ${query_id} + + +query_id="$(random_str 10)" +${CLICKHOUSE_CLIENT} --query_id="${query_id}" -q "INSERT INTO async_insert_landing SETTINGS wait_for_async_insert=1, async_insert=1 values (42), (12), (13)" 2>/dev/null || true +print_flush_query_logs ${query_id} From 5ac7d95bafd61e7720f55ca5d7cd7c8b006ccec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 19 Jun 2023 17:12:33 +0200 Subject: [PATCH 07/63] Cleanup --- src/Interpreters/AsynchronousInsertQueue.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Interpreters/AsynchronousInsertQueue.cpp b/src/Interpreters/AsynchronousInsertQueue.cpp index 996a92cef6f..590632c77f0 100644 --- a/src/Interpreters/AsynchronousInsertQueue.cpp +++ b/src/Interpreters/AsynchronousInsertQueue.cpp @@ -600,7 +600,6 @@ try total_rows, total_bytes, key.query_str); bool pulling_pipeline = false; - /// TODO: Not working. Is the context missing its getProcessListElement ??? logQueryFinish(query_log_elem, insert_context, key.query, pipeline, pulling_pipeline, query_span, internal); } catch (...) From 5ee813b8d037e55edea54aead2074658cc7b8aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 19 Jun 2023 17:37:11 +0200 Subject: [PATCH 08/63] Fix style --- src/Interpreters/AsynchronousInsertQueue.cpp | 2 +- tests/queries/0_stateless/02790_async_queries_in_query_log.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Interpreters/AsynchronousInsertQueue.cpp b/src/Interpreters/AsynchronousInsertQueue.cpp index 590632c77f0..9a4ba0d2793 100644 --- a/src/Interpreters/AsynchronousInsertQueue.cpp +++ b/src/Interpreters/AsynchronousInsertQueue.cpp @@ -406,7 +406,7 @@ try bool internal = false; // To enable logging this query bool async_insert = true; - /// Disabled query spans. Could be activated by initializating this to a SpanHolder + /// Disabled query spans. Could be activated by initializing this to a SpanHolder std::shared_ptr query_span{nullptr}; /// 'resetParser' doesn't work for parallel parsing. diff --git a/tests/queries/0_stateless/02790_async_queries_in_query_log.sh b/tests/queries/0_stateless/02790_async_queries_in_query_log.sh index f5553f16e7a..d1c8fe122cb 100755 --- a/tests/queries/0_stateless/02790_async_queries_in_query_log.sh +++ b/tests/queries/0_stateless/02790_async_queries_in_query_log.sh @@ -29,6 +29,7 @@ function print_flush_query_logs() WHERE event_date >= yesterday() AND initial_query_id = (SELECT flush_query_id FROM system.asynchronous_insert_log WHERE query_id = '$1') + -- AND current_database = currentDatabase() -- Just to silence style check: this is not ok for this test since the query uses default values ORDER BY type DESC FORMAT Vertical" From 9b899b935158a074e744b6cce095d249c9f437fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Tue, 20 Jun 2023 09:52:11 +0200 Subject: [PATCH 09/63] Fix async insert logs with setting on mergetree --- src/Interpreters/executeQuery.cpp | 17 +++++++++++++---- src/Interpreters/executeQuery.h | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index c276842ea5e..77c8a6f1bf4 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -317,7 +317,7 @@ QueryLogElement logQueryStart( elem.query_views = info.views; } - if (settings.async_insert || async_insert) + if (async_insert) InterpreterInsertQuery::extendQueryLogElemImpl(elem, context); else if (interpreter) interpreter->extendQueryLogElem(elem, query_ast, context, query_database, query_table); @@ -538,7 +538,7 @@ void logExceptionBeforeStart( ASTPtr ast, const std::shared_ptr & query_span, UInt64 elapsed_millliseconds, - bool async_insert) + bool async_insert_flush) { auto query_end_time = std::chrono::system_clock::now(); @@ -572,7 +572,7 @@ void logExceptionBeforeStart( elem.formatted_query = queryToString(ast); } - if (async_insert) + if (async_insert_flush) elem.query_kind = IAST::QueryKind::AsyncInsertFlush; // We don't calculate databases, tables and columns when the query isn't able to start @@ -1139,7 +1139,16 @@ static std::tuple executeQueryImpl( /// Everything related to query log. { QueryLogElement elem = logQueryStart( - query_start_time, context, query_for_logging, ast, pipeline, interpreter, internal, query_database, query_table); + query_start_time, + context, + query_for_logging, + ast, + pipeline, + interpreter, + internal, + query_database, + query_table, + async_insert); /// Also make possible for caller to log successful query finish and exception during execution. auto finish_callback = [elem, context, diff --git a/src/Interpreters/executeQuery.h b/src/Interpreters/executeQuery.h index f1fe6b86b79..94b106bb5d8 100644 --- a/src/Interpreters/executeQuery.h +++ b/src/Interpreters/executeQuery.h @@ -83,7 +83,7 @@ QueryLogElement logQueryStart( bool internal, const String & query_database, const String & query_table, - bool async_insert = false); + bool async_insert); void logQueryFinish( QueryLogElement & elem, @@ -109,5 +109,5 @@ void logExceptionBeforeStart( ASTPtr ast, const std::shared_ptr & query_span, UInt64 elapsed_millliseconds, - bool async_insert = false); + bool async_insert_flush = false); } From b1cedf0e42548011e95c3ec09e8245fb44d3e1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Tue, 20 Jun 2023 11:37:56 +0200 Subject: [PATCH 10/63] Simplify handling of AsyncInsertFlush --- src/Interpreters/AsynchronousInsertQueue.cpp | 7 ++++--- src/Interpreters/ProcessList.cpp | 16 ++++++---------- src/Interpreters/ProcessList.h | 7 +------ src/Interpreters/executeQuery.cpp | 8 ++------ src/Interpreters/executeQuery.h | 3 +-- src/Parsers/ASTInsertQuery.h | 4 +++- 6 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/Interpreters/AsynchronousInsertQueue.cpp b/src/Interpreters/AsynchronousInsertQueue.cpp index 9a4ba0d2793..eae9c925bc2 100644 --- a/src/Interpreters/AsynchronousInsertQueue.cpp +++ b/src/Interpreters/AsynchronousInsertQueue.cpp @@ -206,6 +206,7 @@ AsynchronousInsertQueue::push(ASTPtr query, ContextPtr query_context) query = query->clone(); const auto & settings = query_context->getSettingsRef(); auto & insert_query = query->as(); + insert_query.async_insert_flush = true; InterpreterInsertQuery interpreter(query, query_context, settings.insert_allow_materialized_columns); auto table = interpreter.getTable(insert_query); @@ -435,8 +436,8 @@ try /// a) it appears in system.processes /// b) can be cancelled if we want to /// c) has an associated process list element where runtime metrics are stored - auto process_list_entry = insert_context->getProcessList().insert( - query_for_logging, key.query.get(), insert_context, start_watch.getStart(), IAST::QueryKind::AsyncInsertFlush); + auto process_list_entry + = insert_context->getProcessList().insert(query_for_logging, key.query.get(), insert_context, start_watch.getStart()); auto query_status = process_list_entry->getQueryStatus(); insert_context->setProcessListElement(std::move(query_status)); @@ -473,7 +474,7 @@ try } catch (...) { - logExceptionBeforeStart(query_for_logging, insert_context, key.query, query_span, start_watch.elapsedMilliseconds(), async_insert); + logExceptionBeforeStart(query_for_logging, insert_context, key.query, query_span, start_watch.elapsedMilliseconds()); throw; } diff --git a/src/Interpreters/ProcessList.cpp b/src/Interpreters/ProcessList.cpp index 766bdba0cef..dfac92ecc1e 100644 --- a/src/Interpreters/ProcessList.cpp +++ b/src/Interpreters/ProcessList.cpp @@ -32,13 +32,13 @@ namespace ErrorCodes /// Should we execute the query even if max_concurrent_queries limit is exhausted -static bool isUnlimitedQuery(const IAST * ast, IAST::QueryKind query_kind) +static bool isUnlimitedQuery(const IAST * ast) { if (!ast) return false; /// It is KILL QUERY or an async insert flush query - if (ast->as() || query_kind == IAST::QueryKind::AsyncInsertFlush) + if (ast->as() || ast->getQueryKind() == IAST::QueryKind::AsyncInsertFlush) return true; /// It is SELECT FROM system.processes @@ -65,12 +65,8 @@ static bool isUnlimitedQuery(const IAST * ast, IAST::QueryKind query_kind) } -ProcessList::EntryPtr ProcessList::insert( - const String & query_, - const IAST * ast, - ContextMutablePtr query_context, - UInt64 watch_start_nanoseconds, - IAST::QueryKind force_query_kind) +ProcessList::EntryPtr +ProcessList::insert(const String & query_, const IAST * ast, ContextMutablePtr query_context, UInt64 watch_start_nanoseconds) { EntryPtr res; @@ -80,11 +76,11 @@ ProcessList::EntryPtr ProcessList::insert( if (client_info.current_query_id.empty()) throw Exception(ErrorCodes::LOGICAL_ERROR, "Query id cannot be empty"); - bool is_unlimited_query = isUnlimitedQuery(ast, force_query_kind); + bool is_unlimited_query = isUnlimitedQuery(ast); { auto [lock, overcommit_blocker] = safeLock(); // To avoid deadlock in case of OOM - IAST::QueryKind query_kind = force_query_kind != IAST::QueryKind::None ? force_query_kind : ast->getQueryKind(); + IAST::QueryKind query_kind = ast->getQueryKind(); const auto queue_max_wait_ms = settings.queue_max_wait_ms.totalMilliseconds(); if (!is_unlimited_query && max_size && processes.size() >= max_size) diff --git a/src/Interpreters/ProcessList.h b/src/Interpreters/ProcessList.h index 8fb92afc8c8..829457ed578 100644 --- a/src/Interpreters/ProcessList.h +++ b/src/Interpreters/ProcessList.h @@ -394,12 +394,7 @@ public: * If timeout is passed - throw an exception. * Don't count KILL QUERY queries or async insert flush queries */ - EntryPtr insert( - const String & query_, - const IAST * ast, - ContextMutablePtr query_context, - UInt64 watch_start_nanoseconds, - IAST::QueryKind force_query_kind = IAST::QueryKind::None); + EntryPtr insert(const String & query_, const IAST * ast, ContextMutablePtr query_context, UInt64 watch_start_nanoseconds); /// Number of currently executing queries. size_t size() const { return processes.size(); } diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index 77c8a6f1bf4..09aa0b7900b 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -293,7 +293,7 @@ QueryLogElement logQueryStart( if (settings.log_formatted_queries) elem.formatted_query = queryToString(query_ast); elem.normalized_query_hash = normalizedQueryHash(query_for_logging); - elem.query_kind = async_insert ? IAST::QueryKind::AsyncInsertFlush : query_ast->getQueryKind(); + elem.query_kind = query_ast->getQueryKind(); elem.client_info = context->getClientInfo(); @@ -537,8 +537,7 @@ void logExceptionBeforeStart( ContextPtr context, ASTPtr ast, const std::shared_ptr & query_span, - UInt64 elapsed_millliseconds, - bool async_insert_flush) + UInt64 elapsed_millliseconds) { auto query_end_time = std::chrono::system_clock::now(); @@ -572,9 +571,6 @@ void logExceptionBeforeStart( elem.formatted_query = queryToString(ast); } - if (async_insert_flush) - elem.query_kind = IAST::QueryKind::AsyncInsertFlush; - // We don't calculate databases, tables and columns when the query isn't able to start elem.exception_code = getCurrentExceptionCode(); diff --git a/src/Interpreters/executeQuery.h b/src/Interpreters/executeQuery.h index 94b106bb5d8..53624f8c812 100644 --- a/src/Interpreters/executeQuery.h +++ b/src/Interpreters/executeQuery.h @@ -108,6 +108,5 @@ void logExceptionBeforeStart( ContextPtr context, ASTPtr ast, const std::shared_ptr & query_span, - UInt64 elapsed_millliseconds, - bool async_insert_flush = false); + UInt64 elapsed_millliseconds); } diff --git a/src/Parsers/ASTInsertQuery.h b/src/Parsers/ASTInsertQuery.h index 43780e27114..45fd3d97950 100644 --- a/src/Parsers/ASTInsertQuery.h +++ b/src/Parsers/ASTInsertQuery.h @@ -35,6 +35,8 @@ public: /// Data from buffer to insert after inlined one - may be nullptr. ReadBuffer * tail = nullptr; + bool async_insert_flush = false; + String getDatabase() const; String getTable() const; @@ -66,7 +68,7 @@ public: return res; } - QueryKind getQueryKind() const override { return QueryKind::Insert; } + QueryKind getQueryKind() const override { return async_insert_flush ? QueryKind::AsyncInsertFlush : QueryKind::Insert; } protected: void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; From 7d4e7e320d44cc067c9142596209c9139454d1af Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 26 Jun 2023 12:03:25 +0000 Subject: [PATCH 11/63] Impelement support for function range of Nullable argument --- .../gtest_DataType_deserializeAsText.cpp | 1 - src/Functions/array/arrayDotProduct.cpp | 1 - src/Functions/array/arrayNorm.cpp | 1 - src/Functions/array/range.cpp | 37 +++++++++++++++++-- src/Functions/concat.cpp | 1 - src/Functions/ifNotFinite.cpp | 1 - .../02790_range_nullable.reference | 3 ++ .../0_stateless/02790_range_nullable.sql | 7 ++++ 8 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 tests/queries/0_stateless/02790_range_nullable.reference create mode 100644 tests/queries/0_stateless/02790_range_nullable.sql diff --git a/src/DataTypes/tests/gtest_DataType_deserializeAsText.cpp b/src/DataTypes/tests/gtest_DataType_deserializeAsText.cpp index 2c0feab6d86..b755bd109d0 100644 --- a/src/DataTypes/tests/gtest_DataType_deserializeAsText.cpp +++ b/src/DataTypes/tests/gtest_DataType_deserializeAsText.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Functions/array/arrayDotProduct.cpp b/src/Functions/array/arrayDotProduct.cpp index d17c223cc2f..47e865785d4 100644 --- a/src/Functions/array/arrayDotProduct.cpp +++ b/src/Functions/array/arrayDotProduct.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include diff --git a/src/Functions/array/arrayNorm.cpp b/src/Functions/array/arrayNorm.cpp index e14133f931f..027a33d094c 100644 --- a/src/Functions/array/arrayNorm.cpp +++ b/src/Functions/array/arrayNorm.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include diff --git a/src/Functions/array/range.cpp b/src/Functions/array/range.cpp index f1f0fef8fd9..b638bc3c5b7 100644 --- a/src/Functions/array/range.cpp +++ b/src/Functions/array/range.cpp @@ -5,7 +5,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -21,6 +23,7 @@ namespace ErrorCodes extern const int ILLEGAL_COLUMN; extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; + extern const int BAD_ARGUMENTS; } @@ -43,6 +46,7 @@ private: size_t getNumberOfArguments() const override { return 0; } bool isVariadic() const override { return true; } + bool useDefaultImplementationForNulls() const override { return false; } bool useDefaultImplementationForConstants() const override { return true; } bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return true; } @@ -58,10 +62,12 @@ private: DataTypes arg_types; for (size_t i = 0, size = arguments.size(); i < size; ++i) { - if (i < 2 && WhichDataType(arguments[i]).isIPv4()) + DataTypePtr type_no_nullable = removeNullable(arguments[i]); + + if (i < 2 && WhichDataType(type_no_nullable).isIPv4()) arg_types.emplace_back(std::make_shared()); - else if (isInteger(arguments[i])) - arg_types.push_back(arguments[i]); + else if (isInteger(type_no_nullable)) + arg_types.push_back(type_no_nullable); else throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of argument of function {}", arguments[i]->getName(), getName()); @@ -386,10 +392,32 @@ private: "for unsigned/signed integers up to 64 bit", getName()); } + auto throwIfNullValue = [&](const ColumnWithTypeAndName & col) + { + if (!col.type->isNullable()) + { + return; + } + const auto & nullable_col = assert_cast(*col.column); + const auto & null_map = nullable_col.getNullMapData(); + + if (!memoryIsZero(null_map.data(), 0, null_map.size())) + { + throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName()); + } + }; + ColumnPtr res; if (arguments.size() == 1) { - const auto * col = arguments[0].column.get(); + throwIfNullValue(arguments[0]); + auto * col = arguments[0].column.get(); + if (arguments[0].type->isNullable()) + { + const auto * nullable = checkAndGetColumn(*arguments[0].column); + col= nullable->getNestedColumnPtr().get(); + } + if (!((res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)))) @@ -404,6 +432,7 @@ private: for (size_t i = 0; i < arguments.size(); ++i) { + throwIfNullValue(arguments[i]); if (i == 1) columns_holder[i] = castColumn(arguments[i], elem_type)->convertToFullColumnIfConst(); else diff --git a/src/Functions/concat.cpp b/src/Functions/concat.cpp index 8fefc2d5b8a..8288d872f18 100644 --- a/src/Functions/concat.cpp +++ b/src/Functions/concat.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include diff --git a/src/Functions/ifNotFinite.cpp b/src/Functions/ifNotFinite.cpp index 5ce5d0ede70..d7af10eec44 100644 --- a/src/Functions/ifNotFinite.cpp +++ b/src/Functions/ifNotFinite.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include diff --git a/tests/queries/0_stateless/02790_range_nullable.reference b/tests/queries/0_stateless/02790_range_nullable.reference new file mode 100644 index 00000000000..7a98702e98c --- /dev/null +++ b/tests/queries/0_stateless/02790_range_nullable.reference @@ -0,0 +1,3 @@ +[0] +[0,2,4,6,8] +[0,2,4,6,8] diff --git a/tests/queries/0_stateless/02790_range_nullable.sql b/tests/queries/0_stateless/02790_range_nullable.sql new file mode 100644 index 00000000000..16e16512fc5 --- /dev/null +++ b/tests/queries/0_stateless/02790_range_nullable.sql @@ -0,0 +1,7 @@ +SELECT range(toNullable(1)); +SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); +SELECT range(0::Nullable(Int64), 10::Nullable(Int64), 2::Nullable(Int64)); +SELECT range(null); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } +SELECT range(Null::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } +SELECT range(0::Nullable(UInt64), Null::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } +SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), Null::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } From 5521bf3f3570d910d3123f8839f78f99f9292051 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 26 Jun 2023 20:19:34 +0000 Subject: [PATCH 12/63] Fix null constant case --- src/Functions/array/range.cpp | 16 +++++++++++++++- ....reference => 02797_range_nullable.reference} | 4 ++++ ...nge_nullable.sql => 02797_range_nullable.sql} | 5 ++++- 3 files changed, 23 insertions(+), 2 deletions(-) rename tests/queries/0_stateless/{02790_range_nullable.reference => 02797_range_nullable.reference} (70%) rename tests/queries/0_stateless/{02790_range_nullable.sql => 02797_range_nullable.sql} (83%) diff --git a/src/Functions/array/range.cpp b/src/Functions/array/range.cpp index b638bc3c5b7..8c524566110 100644 --- a/src/Functions/array/range.cpp +++ b/src/Functions/array/range.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,14 @@ private: getName(), arguments.size()); } + for (size_t i = 0, size = arguments.size(); i < size; ++i) + { + if (arguments[i]->onlyNull()) + { + return makeNullable(std::make_shared()); + } + } + DataTypes arg_types; for (size_t i = 0, size = arguments.size(); i < size; ++i) { @@ -382,6 +391,12 @@ private: ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override { + NullPresence null_presence = getNullPresense(arguments); + if (null_presence.has_null_constant) + { + return result_type->createColumnConstWithDefaultValue(input_rows_count); + } + DataTypePtr elem_type = checkAndGetDataType(result_type.get())->getNestedType(); WhichDataType which(elem_type); @@ -400,7 +415,6 @@ private: } const auto & nullable_col = assert_cast(*col.column); const auto & null_map = nullable_col.getNullMapData(); - if (!memoryIsZero(null_map.data(), 0, null_map.size())) { throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName()); diff --git a/tests/queries/0_stateless/02790_range_nullable.reference b/tests/queries/0_stateless/02797_range_nullable.reference similarity index 70% rename from tests/queries/0_stateless/02790_range_nullable.reference rename to tests/queries/0_stateless/02797_range_nullable.reference index 7a98702e98c..a082a71f4ec 100644 --- a/tests/queries/0_stateless/02790_range_nullable.reference +++ b/tests/queries/0_stateless/02797_range_nullable.reference @@ -1,3 +1,7 @@ +\N +\N +\N +\N [0] [0,2,4,6,8] [0,2,4,6,8] diff --git a/tests/queries/0_stateless/02790_range_nullable.sql b/tests/queries/0_stateless/02797_range_nullable.sql similarity index 83% rename from tests/queries/0_stateless/02790_range_nullable.sql rename to tests/queries/0_stateless/02797_range_nullable.sql index 16e16512fc5..2b0fe69b123 100644 --- a/tests/queries/0_stateless/02790_range_nullable.sql +++ b/tests/queries/0_stateless/02797_range_nullable.sql @@ -1,7 +1,10 @@ +SELECT range(null); +SELECT range(10, null); +SELECT range(10, 2, null); +select range('string', Null); SELECT range(toNullable(1)); SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); SELECT range(0::Nullable(Int64), 10::Nullable(Int64), 2::Nullable(Int64)); -SELECT range(null); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } SELECT range(Null::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } SELECT range(0::Nullable(UInt64), Null::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), Null::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } From 5a4a774db7e961133dd124c5d337a402cb2ee9ee Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Tue, 27 Jun 2023 06:06:56 +0000 Subject: [PATCH 13/63] Style fix --- src/Functions/array/range.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Functions/array/range.cpp b/src/Functions/array/range.cpp index 8c524566110..47e90de2e2b 100644 --- a/src/Functions/array/range.cpp +++ b/src/Functions/array/range.cpp @@ -60,13 +60,8 @@ private: getName(), arguments.size()); } - for (size_t i = 0, size = arguments.size(); i < size; ++i) - { - if (arguments[i]->onlyNull()) - { - return makeNullable(std::make_shared()); - } - } + if (std::find_if (arguments.cbegin(), arguments.cend(), [](const auto & arg) { return arg->onlyNull(); }) != arguments.cend()) + return makeNullable(std::make_shared()); DataTypes arg_types; for (size_t i = 0, size = arguments.size(); i < size; ++i) @@ -393,9 +388,7 @@ private: { NullPresence null_presence = getNullPresense(arguments); if (null_presence.has_null_constant) - { return result_type->createColumnConstWithDefaultValue(input_rows_count); - } DataTypePtr elem_type = checkAndGetDataType(result_type.get())->getNestedType(); WhichDataType which(elem_type); @@ -410,15 +403,11 @@ private: auto throwIfNullValue = [&](const ColumnWithTypeAndName & col) { if (!col.type->isNullable()) - { return; - } const auto & nullable_col = assert_cast(*col.column); const auto & null_map = nullable_col.getNullMapData(); if (!memoryIsZero(null_map.data(), 0, null_map.size())) - { throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName()); - } }; ColumnPtr res; @@ -429,7 +418,7 @@ private: if (arguments[0].type->isNullable()) { const auto * nullable = checkAndGetColumn(*arguments[0].column); - col= nullable->getNestedColumnPtr().get(); + col = nullable->getNestedColumnPtr().get(); } if (!((res = executeInternal(col)) || (res = executeInternal(col)) || (res = executeInternal(col)) From 8af96f7a177c02edc8425bc7bcd1aa9dad6f086c Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Fri, 30 Jun 2023 09:49:29 +0000 Subject: [PATCH 14/63] Add uuid to uint128 converting --- src/Functions/FunctionsConversion.h | 15 +++++++++++++++ .../02810_convert_uuid_to_uint128.reference | 6 ++++++ .../0_stateless/02810_convert_uuid_to_uint128.sql | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/queries/0_stateless/02810_convert_uuid_to_uint128.reference create mode 100644 tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql diff --git a/src/Functions/FunctionsConversion.h b/src/Functions/FunctionsConversion.h index 00c4cfe7284..a79fd6c2e1b 100644 --- a/src/Functions/FunctionsConversion.h +++ b/src/Functions/FunctionsConversion.h @@ -203,6 +203,21 @@ struct ConvertImpl } } + if constexpr (std::is_same_v && std::is_same_v) + { + static_assert(std::is_same_v, "Can be used only to serialize to ColumnString or ColumnFixedString"); + if constexpr (std::endian::native == std::endian::little) + { + vec_to[i].items[1] = vec_from[i].toUnderType().items[0]; + vec_to[i].items[0] = vec_from[i].toUnderType().items[1]; + } + else + { + vec_to[i] = vec_from[i].toUnderType(); + } + continue; + } + if constexpr (std::is_same_v != std::is_same_v) { throw Exception(ErrorCodes::NOT_IMPLEMENTED, diff --git a/tests/queries/0_stateless/02810_convert_uuid_to_uint128.reference b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.reference new file mode 100644 index 00000000000..3b44d4ba086 --- /dev/null +++ b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.reference @@ -0,0 +1,6 @@ +0 +329871470813054077831677335124932328170 +340282366920938463463374607431768211455 +329871470813054077831677335124932328170 +329871470813054077831677335124932328170 +329871470813054077831677335124932328170 diff --git a/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql new file mode 100644 index 00000000000..5350ef99ed3 --- /dev/null +++ b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql @@ -0,0 +1,8 @@ +SELECT toUInt128(toUUID('00000000-0000-0000-0000-000000000000')); +SELECT toUInt128(toUUID('f82aef31-279e-431f-8b00-2899ad387aea')); +SELECT toUInt128(toUUID('ffffffff-ffff-ffff-ffff-ffffffffffff')); +SELECT toUInt64(toUUID('00000000-0000-0000-0000-000000000000')); -- { serverError NOT_IMPLEMENTED } +SELECT toInt128(toUUID('00000000-0000-0000-0000-000000000000')); -- { serverError NOT_IMPLEMENTED } +SELECT cast(toUUID('f82aef31-279e-431f-8b00-2899ad387aea'), 'UInt128'); +select accurateCast(toUUID('f82aef31-279e-431f-8b00-2899ad387aea'), 'UInt128'); +select toUUID('f82aef31-279e-431f-8b00-2899ad387aea')::UInt128; \ No newline at end of file From 407a7e3cc50633f6ac73cbda6412db0ec28286f5 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Fri, 30 Jun 2023 09:55:55 +0000 Subject: [PATCH 15/63] Edit assert message --- src/Functions/FunctionsConversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Functions/FunctionsConversion.h b/src/Functions/FunctionsConversion.h index a79fd6c2e1b..b272e88d17d 100644 --- a/src/Functions/FunctionsConversion.h +++ b/src/Functions/FunctionsConversion.h @@ -205,7 +205,7 @@ struct ConvertImpl if constexpr (std::is_same_v && std::is_same_v) { - static_assert(std::is_same_v, "Can be used only to serialize to ColumnString or ColumnFixedString"); + static_assert(std::is_same_v, "UInt128 and UUID types must be same"); if constexpr (std::endian::native == std::endian::little) { vec_to[i].items[1] = vec_from[i].toUnderType().items[0]; From 1cf021c0b11ef1f24312a98bb8e443067a4ad497 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Fri, 30 Jun 2023 13:11:06 +0000 Subject: [PATCH 16/63] Add initcap prototype / tests --- .../functions/string-functions.md | 4 + .../functions/string-functions.md | 4 + src/Functions/initcap.cpp | 78 +++++++++++++++++++ .../0_stateless/02810_initcap.reference | 6 ++ tests/queries/0_stateless/02810_initcap.sql | 6 ++ 5 files changed, 98 insertions(+) create mode 100644 src/Functions/initcap.cpp create mode 100644 tests/queries/0_stateless/02810_initcap.reference create mode 100644 tests/queries/0_stateless/02810_initcap.sql diff --git a/docs/en/sql-reference/functions/string-functions.md b/docs/en/sql-reference/functions/string-functions.md index 5175bbf0615..d2180c9f3ea 100644 --- a/docs/en/sql-reference/functions/string-functions.md +++ b/docs/en/sql-reference/functions/string-functions.md @@ -1253,3 +1253,7 @@ Result: │ A240 │ └──────────────────┘ ``` + +## initcap + +Convert the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters. \ No newline at end of file diff --git a/docs/ru/sql-reference/functions/string-functions.md b/docs/ru/sql-reference/functions/string-functions.md index 9638e25d488..bd104b27bed 100644 --- a/docs/ru/sql-reference/functions/string-functions.md +++ b/docs/ru/sql-reference/functions/string-functions.md @@ -1113,3 +1113,7 @@ A text with tags . The content within CDATA Do Nothing for 2 Minutes 2:00   ``` + +## initcap {#initcap} + +Переводит первую букву каждого слова в строке в верхний регистр, а остальные — в нижний. Словами считаются последовательности алфавитно-цифровых символов, разделённые любыми другими символами. \ No newline at end of file diff --git a/src/Functions/initcap.cpp b/src/Functions/initcap.cpp new file mode 100644 index 00000000000..70c332d191d --- /dev/null +++ b/src/Functions/initcap.cpp @@ -0,0 +1,78 @@ +#include +#include + +namespace DB +{ +namespace +{ + +struct InitcapImpl +{ + static void vector(const ColumnString::Chars & data, + const ColumnString::Offsets & offsets, + ColumnString::Chars & res_data, + ColumnString::Offsets & res_offsets) + { + res_data.resize(data.size()); + res_offsets.assign(offsets); + array(data.data(), data.data() + data.size(), res_data.data()); + } + + static void vectorFixed(const ColumnString::Chars & data, size_t /*n*/, ColumnString::Chars & res_data) + { + res_data.resize(data.size()); + array(data.data(), data.data() + data.size(), res_data.data()); + } + +private: + static void array(const UInt8 * src, const UInt8 * src_end, UInt8 * dst) + { + const auto flip_case_mask = 'A' ^ 'a'; + + auto is_lower_alpha = [](UInt8 c) { return c >= 'a' && c <= 'z'; }; + auto is_upper_alpha = [](UInt8 c) { return c >= 'A' && c <= 'Z'; }; + //auto is_digit = [](UInt8 c) { return c >= '0' && c <= '9'; }; + + bool prev_is_alpha = false; + + for (; src < src_end; ++src, ++dst) + { + bool lower = is_lower_alpha(*src); + bool is_alpha = lower || is_upper_alpha(*src); + if (!is_alpha) + { + *dst = *src; + } + else if (!prev_is_alpha) + { + if (lower) + *dst = *src ^ flip_case_mask; + else + *dst = *src; + } + else + { + if (!lower) + *dst = *src ^ flip_case_mask; + else + *dst = *src; + } + prev_is_alpha = is_alpha; + } + } +}; + +struct NameInitcap +{ + static constexpr auto name = "initcap"; +}; +using FunctionInitcap = FunctionStringToString; + +} + +REGISTER_FUNCTION(Initcap) +{ + factory.registerFunction({}, FunctionFactory::CaseInsensitive); +} + +} diff --git a/tests/queries/0_stateless/02810_initcap.reference b/tests/queries/0_stateless/02810_initcap.reference new file mode 100644 index 00000000000..9fda79e4afb --- /dev/null +++ b/tests/queries/0_stateless/02810_initcap.reference @@ -0,0 +1,6 @@ + +Hello +Hello +Hello World +Yeah, Well, I`M Gonna Go Build My Own Theme Park +Crc32ieee Is Best Function diff --git a/tests/queries/0_stateless/02810_initcap.sql b/tests/queries/0_stateless/02810_initcap.sql new file mode 100644 index 00000000000..810ea52dd6a --- /dev/null +++ b/tests/queries/0_stateless/02810_initcap.sql @@ -0,0 +1,6 @@ +select initcap(''); +select initcap('Hello'); +select initcap('hello'); +select initcap('hello world'); +select initcap('yeah, well, i`m gonna go build my own theme park'); +select initcap('CRC32IEEE is best function'); From d6dacd3ccfe340410ead90ffcadd769716a61ec7 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Fri, 30 Jun 2023 13:53:20 +0000 Subject: [PATCH 17/63] Fix test with num --- src/Functions/initcap.cpp | 38 ++++++------------- .../0_stateless/02810_initcap.reference | 1 + tests/queries/0_stateless/02810_initcap.sql | 1 + 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/Functions/initcap.cpp b/src/Functions/initcap.cpp index 70c332d191d..7d0749ecb12 100644 --- a/src/Functions/initcap.cpp +++ b/src/Functions/initcap.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace DB { @@ -27,37 +28,22 @@ struct InitcapImpl private: static void array(const UInt8 * src, const UInt8 * src_end, UInt8 * dst) { - const auto flip_case_mask = 'A' ^ 'a'; - - auto is_lower_alpha = [](UInt8 c) { return c >= 'a' && c <= 'z'; }; - auto is_upper_alpha = [](UInt8 c) { return c >= 'A' && c <= 'Z'; }; - //auto is_digit = [](UInt8 c) { return c >= '0' && c <= '9'; }; - - bool prev_is_alpha = false; + bool prev_alphanum = false; for (; src < src_end; ++src, ++dst) { - bool lower = is_lower_alpha(*src); - bool is_alpha = lower || is_upper_alpha(*src); - if (!is_alpha) - { - *dst = *src; - } - else if (!prev_is_alpha) - { - if (lower) - *dst = *src ^ flip_case_mask; + char c = *src; + bool alphanum = isAlphaNumericASCII(c); + if (alphanum && !prev_alphanum) + if (isAlphaASCII(c)) + *dst = toUpperIfAlphaASCII(c); else - *dst = *src; - } + *dst = c; + else if (isAlphaASCII(c)) + *dst = toLowerIfAlphaASCII(c); else - { - if (!lower) - *dst = *src ^ flip_case_mask; - else - *dst = *src; - } - prev_is_alpha = is_alpha; + *dst = c; + prev_alphanum = alphanum; } } }; diff --git a/tests/queries/0_stateless/02810_initcap.reference b/tests/queries/0_stateless/02810_initcap.reference index 9fda79e4afb..4caa57e5ac0 100644 --- a/tests/queries/0_stateless/02810_initcap.reference +++ b/tests/queries/0_stateless/02810_initcap.reference @@ -4,3 +4,4 @@ Hello Hello World Yeah, Well, I`M Gonna Go Build My Own Theme Park Crc32ieee Is Best Function +42ok diff --git a/tests/queries/0_stateless/02810_initcap.sql b/tests/queries/0_stateless/02810_initcap.sql index 810ea52dd6a..f61fcddf4c1 100644 --- a/tests/queries/0_stateless/02810_initcap.sql +++ b/tests/queries/0_stateless/02810_initcap.sql @@ -4,3 +4,4 @@ select initcap('hello'); select initcap('hello world'); select initcap('yeah, well, i`m gonna go build my own theme park'); select initcap('CRC32IEEE is best function'); +select initcap('42oK'); \ No newline at end of file From 8c0463fdd4bb99f707bcbb7b61b86ab8984ec6b7 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Sun, 2 Jul 2023 16:14:08 +0800 Subject: [PATCH 18/63] fix --- src/Functions/array/arrayJaccardIndex.cpp | 80 ++++++++++------------- 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp index c1ec8b53d25..211680092b3 100644 --- a/src/Functions/array/arrayJaccardIndex.cpp +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -34,85 +34,75 @@ public: bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo &) const override { return true; } bool useDefaultImplementationForConstants() const override { return true; } - DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { - DataTypes types; - for (size_t i = 0; i < 2; ++i) - { - const auto * array_type = checkAndGetDataType(arguments[i].get()); - if (!array_type) - throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Argument {} of function {} must be array, but it has type{}.", i + 1, getName(), arguments[i]->getName()); - } + FunctionArgumentDescriptors args{ + {"array_1", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, + {"array_2", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, + }; + validateFunctionArgumentTypes(*this, arguments, args); return std::make_shared>(); } template - static void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + static inline void getArraySize(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, size_t & left_size, size_t & right_size, const size_t & i) + { + if constexpr (is_const_left) + left_size = left_offsets[0]; + else + left_size = left_offsets[i] - left_offsets[i - 1]; + if constexpr (is_const_right) + right_size = right_offsets[0]; + else + right_size = right_offsets[i] - right_offsets[i - 1]; + } + + template + static inline void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) { size_t left_size; size_t right_size; for (size_t i = 0; i < res.size(); ++i) { - if constexpr (is_const_left) - left_size = left_offsets[0]; - else - left_size = left_offsets[i] - left_offsets[i - 1]; - if constexpr (is_const_right) - right_size = right_offsets[0]; - else - right_size = right_offsets[i] - right_offsets[i - 1]; - + getArraySize(left_offsets, right_offsets, left_size, right_size, i); size_t intersect_size = intersect_offsets[i] - intersect_offsets[i - 1]; res[i] = static_cast(intersect_size) / (left_size + right_size - intersect_size); - if (unlikely(isnan(res[i]))) - res[i] = 1; } } - template - static void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + template + static inline void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) { size_t left_size; size_t right_size; for (size_t i = 0; i < res.size(); ++i) { - if constexpr (is_const_left) - left_size = left_offsets[0]; - else - left_size = left_offsets[i] - left_offsets[i - 1]; - if constexpr (is_const_right) - right_size = right_offsets[0]; - else - right_size = right_offsets[i] - right_offsets[i - 1]; - - res[i] = static_cast(left_size + right_size == 0); + getArraySize(left_offsets, right_offsets, left_size, right_size, i); + if (unlikely(!left_size && !right_size)) + throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "array aggregate functions cannot be performed on two empty arrays"); + res[i] = 0; } } ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override { - bool is_const_left; - bool is_const_right; - const ColumnArray * left_array; - const ColumnArray * right_array; - - auto cast_array = [&](const ColumnWithTypeAndName & col) + auto cast_array = [&](const ColumnWithTypeAndName & col) -> std::pair { const ColumnArray * res; bool is_const = false; - if (typeid_cast(col.column.get())) + if (const ColumnConst * col_const = typeid_cast(col.column.get())) { - res = checkAndGetColumn(checkAndGetColumnConst(col.column.get())->getDataColumnPtr().get()); + res = checkAndGetColumn(col_const->getDataColumnPtr().get()); is_const = true; } else if (!(res = checkAndGetColumn(col.column.get()))) throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Argument for function {} must be array but it has type {}.", col.column->getName(), getName()); - return std::make_pair(res, is_const); + return {res, is_const}; }; - std::tie(left_array, is_const_left) = cast_array(arguments[0]); - std::tie(right_array, is_const_right) = cast_array(arguments[1]); + const auto & [left_array, is_const_left] = cast_array(arguments[0]); + const auto & [right_array, is_const_right] = cast_array(arguments[1]); auto intersect_array = FunctionFactory::instance().get("arrayIntersect", context)->build(arguments); ColumnWithTypeAndName intersect_column; @@ -131,8 +121,8 @@ public: vectorWithEmptyIntersect(left_array->getOffsets(), right_array->getOffsets(), vec_res); \ else \ { \ - const ColumnArray * col_array = checkAndGetColumn(intersect_column.column.get()); \ - vector(col_array->getOffsets(), left_array->getOffsets(), right_array->getOffsets(), vec_res); \ + const ColumnArray * intersect_column_array = checkAndGetColumn(intersect_column.column.get()); \ + vector(intersect_column_array->getOffsets(), left_array->getOffsets(), right_array->getOffsets(), vec_res); \ } if (!is_const_left && !is_const_right) From 309fbc45a23a5132be56e6b71c87955b05d0db7c Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Sun, 2 Jul 2023 16:14:53 +0800 Subject: [PATCH 19/63] fix test --- .../02737_arrayJaccardIndex.reference | 52 +++++++------------ .../0_stateless/02737_arrayJaccardIndex.sql | 33 +++++++----- ...2737_arrayJaccardIndex_exception.reference | 2 + .../02737_arrayJaccardIndex_exception.sh | 14 +++++ 4 files changed, 55 insertions(+), 46 deletions(-) create mode 100644 tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference create mode 100644 tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.reference b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference index e6934bfe092..0b7969889c0 100644 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex.reference +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference @@ -1,32 +1,20 @@ -0 -0.5 -1 -0.67 -1 -0 -0 -0 -1 -0 -0 -0 -0 -0.5 -1 -0.67 -0.5 -0.5 -0.5 -0.5 -1 -1 -1 -1 -1 -1 -1 -1 -0.33 -0.2 -1 -1 +[1] [1,2] 0.5 +[1,2] [1,2] 1 +[1,2,3] [1,2] 0.67 +[1] [] 0 +[1,2] [] 0 +[1,2,3] [] 0 +[] [1] 0 +[] [1,2] 0 +[] [1,2,3] 0 +[1,2] [1] 0.5 +[1,2] [1,2] 1 +[1,2] [1,2,3] 0.67 +[1] [1] 1 +[1,2] [1,2] 1 +[1,2,3] [1,2,3] 1 +['a'] ['a','aa','aaa'] 0.33 +[1,1.1,2.2] [2.2,3.3,444] 0.2 +[1] [1] 1 +[1,2] [1,2,3,4] 0.5 +[[1,2],[3,4]] [[1,2],[3,5]] 0.33 diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql index c3f04ba0b10..000106e93b7 100644 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql @@ -1,26 +1,31 @@ drop table if exists array_jaccard_index; -create table array_jaccard_index (arr Array(UInt8)) engine=MergeTree partition by arr order by arr; +create table array_jaccard_index (arr Array(UInt8)) engine = MergeTree order by arr; insert into array_jaccard_index values ([1,2,3]); + insert into array_jaccard_index values ([1,2]); + insert into array_jaccard_index values ([1]); -insert into array_jaccard_index values ([]); -select round(arrayJaccardIndex(arr, [1,2]), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex(arr, []), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([], arr), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([1,2], arr), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([1,2], [1,2,3,4]), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([], []), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex(arr, arr), 2) from array_jaccard_index order by arr; +select arr as arr_1, [1,2] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; -drop table if exists array_jaccard_index; +select arr as arr_1, [] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex(['a'], ['a', 'aa', 'aaa']), 2); +select [] as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([1, 1.1, 2.2], [2.2, 3.3, 444]), 2); +select [1,2] as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([], []), 2); +select arr as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; -select round(arrayJaccardIndex([toUInt16(1)], [toUInt32(1)]), 2); +drop table array_jaccard_index; + +select ['a'] as arr_1, ['a', 'aa', 'aaa'] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); + +select [1, 1.1, 2.2] as arr_1, [2.2, 3.3, 444] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); + +select [toUInt16(1)] as arr_1, [toUInt32(1)] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); + +select [1,2] as arr_1, [1,2,3,4] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); + +select [[1,2], [3,4]] as arr_1, [[1,2], [3,5]] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference new file mode 100644 index 00000000000..307d9a195b0 --- /dev/null +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference @@ -0,0 +1,2 @@ +Code: 43 +Code: 386 diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh new file mode 100644 index 00000000000..c36700c6e0f --- /dev/null +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CURDIR"/../shell_config.sh + +echo ${CLICKHOUSE_CLIENT} + +# Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: array aggregate functions cannot be performed on two empty arrays: While processing arrayJaccardIndex([], []). (ILLEGAL_TYPE_OF_ARGUMENT) +$CLICKHOUSE_CLIENT -q "SELECT arrayJaccardIndex([], [])" |& grep -o "Code: 43" + + +# Code: 386. DB::Exception: Received from localhost:9000. DB::Exception: There is no subtype for types UInt8, String because some of them are String/FixedString and some of them are not: While processing [1, 2] AS arr_1, ['1', '2'] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2). (NO_COMMON_TYPE) +$CLICKHOUSE_CLIENT -q "select [1,2] as arr_1, ['1','2'] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2)" |& grep -o "Code: 386" From 85053ef008295ec48e66a42a4d1dafa41ff22e6c Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Sun, 2 Jul 2023 16:39:55 +0800 Subject: [PATCH 20/63] fix permission --- tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh old mode 100644 new mode 100755 From 2c09ea04048d664fad9c70de49c0ceff10c9ec22 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Sun, 2 Jul 2023 17:09:52 +0800 Subject: [PATCH 21/63] add doc --- .../sql-reference/functions/array-functions.md | 18 ++++++++++++++++++ .../02737_arrayJaccardIndex_exception.sh | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/en/sql-reference/functions/array-functions.md b/docs/en/sql-reference/functions/array-functions.md index 7f2b8f3c605..921e9765080 100644 --- a/docs/en/sql-reference/functions/array-functions.md +++ b/docs/en/sql-reference/functions/array-functions.md @@ -996,6 +996,24 @@ SELECT └──────────────┴───────────┘ ``` +## arrayJaccardIndex + +Returns the jaccard similarity between two arrays. + +**Example** + +Query: +``` sql +SELECT arrayJaccardIndex([1, 2], [2, 3]) AS res +``` + +Result: +``` text +┌─res────────────────┐ +│ 0.3333333333333333 │ +└────────────────────┘ +``` + ## arrayReduce Applies an aggregate function to array elements and returns its result. The name of the aggregation function is passed as a string in single quotes `'max'`, `'sum'`. When using parametric aggregate functions, the parameter is indicated after the function name in parentheses `'uniqUpTo(6)'`. diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh index c36700c6e0f..49e80e06cba 100755 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh @@ -4,11 +4,8 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CURDIR"/../shell_config.sh -echo ${CLICKHOUSE_CLIENT} - # Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: array aggregate functions cannot be performed on two empty arrays: While processing arrayJaccardIndex([], []). (ILLEGAL_TYPE_OF_ARGUMENT) $CLICKHOUSE_CLIENT -q "SELECT arrayJaccardIndex([], [])" |& grep -o "Code: 43" - # Code: 386. DB::Exception: Received from localhost:9000. DB::Exception: There is no subtype for types UInt8, String because some of them are String/FixedString and some of them are not: While processing [1, 2] AS arr_1, ['1', '2'] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2). (NO_COMMON_TYPE) $CLICKHOUSE_CLIENT -q "select [1,2] as arr_1, ['1','2'] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2)" |& grep -o "Code: 386" From 91d091a80607a8c9c9e9edbc02392172825f5299 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Sun, 2 Jul 2023 18:58:58 +0800 Subject: [PATCH 22/63] fix style --- utils/check-style/aspell-ignore/en/aspell-dict.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/check-style/aspell-ignore/en/aspell-dict.txt b/utils/check-style/aspell-ignore/en/aspell-dict.txt index 2802e52c288..6231e8a07f3 100644 --- a/utils/check-style/aspell-ignore/en/aspell-dict.txt +++ b/utils/check-style/aspell-ignore/en/aspell-dict.txt @@ -1034,6 +1034,7 @@ arrayFirst arrayFirstIndex arrayFlatten arrayIntersect +arrayJaccardIndex arrayJoin arrayLast arrayLastIndex @@ -1607,6 +1608,7 @@ isNull isValidJSON isValidUTF iteratively +jaccard javaHash javaHashUTF jbod From 1a40e30797fcfb65885beb0630e9605bd46d0b64 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 3 Jul 2023 11:37:55 +0000 Subject: [PATCH 23/63] Add initcapUtf8: impl + tests --- .../functions/string-functions.md | 10 +- .../functions/string-functions.md | 9 +- src/Functions/LowerUpperUTF8Impl.h | 2 - src/Functions/initcapUTF8.cpp | 114 ++++++++++++++++++ .../0_stateless/02810_initcap.reference | 8 +- tests/queries/0_stateless/02810_initcap.sql | 11 +- .../aspell-ignore/en/aspell-dict.txt | 1 + 7 files changed, 148 insertions(+), 7 deletions(-) create mode 100644 src/Functions/initcapUTF8.cpp diff --git a/docs/en/sql-reference/functions/string-functions.md b/docs/en/sql-reference/functions/string-functions.md index d2180c9f3ea..cab6764c041 100644 --- a/docs/en/sql-reference/functions/string-functions.md +++ b/docs/en/sql-reference/functions/string-functions.md @@ -1256,4 +1256,12 @@ Result: ## initcap -Convert the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters. \ No newline at end of file +Convert the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters. + +## initcapUTF8 + +Like [initcap](#initcap), assuming that the string contains valid UTF-8 encoded text. If this assumption is violated, no exception is thrown and the result is undefined. + +Does not detect the language, e.g. for Turkish the result might not be exactly correct (i/İ vs. i/I). + +If the length of the UTF-8 byte sequence is different for upper and lower case of a code point, the result may be incorrect for this code point. \ No newline at end of file diff --git a/docs/ru/sql-reference/functions/string-functions.md b/docs/ru/sql-reference/functions/string-functions.md index bd104b27bed..ecb36bf4f65 100644 --- a/docs/ru/sql-reference/functions/string-functions.md +++ b/docs/ru/sql-reference/functions/string-functions.md @@ -1116,4 +1116,11 @@ Do Nothing for 2 Minutes 2:00   ## initcap {#initcap} -Переводит первую букву каждого слова в строке в верхний регистр, а остальные — в нижний. Словами считаются последовательности алфавитно-цифровых символов, разделённые любыми другими символами. \ No newline at end of file +Переводит первую букву каждого слова в строке в верхний регистр, а остальные — в нижний. Словами считаются последовательности алфавитно-цифровых символов, разделённые любыми другими символами. + +## initcapUTF8 {#initcapUTF8} + +Как [initcap](#initcap), предпологая, что строка содержит набор байтов, представляющий текст в кодировке UTF-8. +Не учитывает язык. То есть, для турецкого языка, результат может быть не совсем верным. +Если длина UTF-8 последовательности байтов различна для верхнего и нижнего регистра кодовой точки, то для этой кодовой точки результат работы может быть некорректным. +Если строка содержит набор байтов, не являющийся UTF-8, то поведение не определено. \ No newline at end of file diff --git a/src/Functions/LowerUpperUTF8Impl.h b/src/Functions/LowerUpperUTF8Impl.h index f6b18439fd1..460f75f9bde 100644 --- a/src/Functions/LowerUpperUTF8Impl.h +++ b/src/Functions/LowerUpperUTF8Impl.h @@ -133,8 +133,6 @@ struct LowerUpperUTF8Impl } else { - static const Poco::UTF8Encoding utf8; - size_t src_sequence_length = UTF8::seqLength(*src); /// In case partial buffer was passed (due to SSE optimization) /// we cannot convert it with current src_end, but we may have more diff --git a/src/Functions/initcapUTF8.cpp b/src/Functions/initcapUTF8.cpp new file mode 100644 index 00000000000..333ebe266d3 --- /dev/null +++ b/src/Functions/initcapUTF8.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include + + +namespace DB +{ + +namespace ErrorCodes +{ + extern const int BAD_ARGUMENTS; +} + +namespace +{ + +struct InitcapUTF8Impl +{ + static void vector( + const ColumnString::Chars & data, + const ColumnString::Offsets & offsets, + ColumnString::Chars & res_data, + ColumnString::Offsets & res_offsets) + { + if (data.empty()) + return; + res_data.resize(data.size()); + res_offsets.assign(offsets); + array(data.data(), data.data() + data.size(), offsets, res_data.data()); + } + + [[noreturn]] static void vectorFixed(const ColumnString::Chars &, size_t, ColumnString::Chars &) + { + throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function initcapUTF8 cannot work with FixedString argument"); + } + + static void processCodePoint(const UInt8 *& src, const UInt8 * src_end, UInt8 *& dst, bool& prev_alphanum) + { + size_t src_sequence_length = UTF8::seqLength(*src); + auto src_code_point = UTF8::convertUTF8ToCodePoint(src, src_end - src); + + if (src_code_point) + { + bool alpha = Poco::Unicode::isAlpha(*src_code_point); + bool alphanum = alpha || Poco::Unicode::isDigit(*src_code_point); + + int dst_code_point = *src_code_point; + if (alphanum && !prev_alphanum) + { + if (alpha) + dst_code_point = Poco::Unicode::toUpper(*src_code_point); + } + else if (alpha) + { + dst_code_point = Poco::Unicode::toLower(*src_code_point); + } + prev_alphanum = alphanum; + if (dst_code_point > 0) + { + size_t dst_sequence_length = UTF8::convertCodePointToUTF8(dst_code_point, dst, src_end - src); + assert(dst_sequence_length <= 4); + + if (dst_sequence_length == src_sequence_length) + { + src += dst_sequence_length; + dst += dst_sequence_length; + return; + } + } + } + + *dst = *src; + ++dst; + ++src; + prev_alphanum = false; + } + +private: + + static void array(const UInt8 * src, const UInt8 * src_end, const ColumnString::Offsets & offsets, UInt8 * dst) + { + auto offset_it = offsets.begin(); + const UInt8 * begin = src; + + /// handle remaining symbols, row by row (to avoid influence of bad UTF8 symbols from one row, to another) + while (src < src_end) + { + const UInt8 * row_end = begin + *offset_it; + chassert(row_end >= src); + bool prev_alphanum = false; + while (src < row_end) + processCodePoint(src, row_end, dst, prev_alphanum); + ++offset_it; + } + } +}; + +struct NameInitcapUTF8 +{ + static constexpr auto name = "initcapUTF8"; +}; + +using FunctionInitcapUTF8 = FunctionStringToString; + +} + +REGISTER_FUNCTION(InitcapUTF8) +{ + factory.registerFunction(); +} + +} diff --git a/tests/queries/0_stateless/02810_initcap.reference b/tests/queries/0_stateless/02810_initcap.reference index 4caa57e5ac0..0d24e14c445 100644 --- a/tests/queries/0_stateless/02810_initcap.reference +++ b/tests/queries/0_stateless/02810_initcap.reference @@ -3,5 +3,11 @@ Hello Hello Hello World Yeah, Well, I`M Gonna Go Build My Own Theme Park -Crc32ieee Is Best Function +Crc32ieee Is The Best Function 42ok + +Hello +Yeah, Well, I`M Gonna Go Build My Own Theme Park +Привет, Как Дела? +Ätsch, Bätsch +We Dont Support Cases When Lowercase And Uppercase Characters Occupy Different Number Of Bytes In Utf-8. As An Example, This Happens For ß And ẞ. diff --git a/tests/queries/0_stateless/02810_initcap.sql b/tests/queries/0_stateless/02810_initcap.sql index f61fcddf4c1..1a730003604 100644 --- a/tests/queries/0_stateless/02810_initcap.sql +++ b/tests/queries/0_stateless/02810_initcap.sql @@ -3,5 +3,12 @@ select initcap('Hello'); select initcap('hello'); select initcap('hello world'); select initcap('yeah, well, i`m gonna go build my own theme park'); -select initcap('CRC32IEEE is best function'); -select initcap('42oK'); \ No newline at end of file +select initcap('CRC32IEEE is the best function'); +select initcap('42oK'); + +select initcapUTF8(''); +select initcapUTF8('Hello'); +select initcapUTF8('yeah, well, i`m gonna go build my own theme park'); +select initcapUTF8('привет, как дела?'); +select initcapUTF8('ätsch, bätsch'); +select initcapUTF8('We dont support cases when lowercase and uppercase characters occupy different number of bytes in UTF-8. As an example, this happens for ß and ẞ.'); \ No newline at end of file diff --git a/utils/check-style/aspell-ignore/en/aspell-dict.txt b/utils/check-style/aspell-ignore/en/aspell-dict.txt index f25d082e5a6..835de91c0d8 100644 --- a/utils/check-style/aspell-ignore/en/aspell-dict.txt +++ b/utils/check-style/aspell-ignore/en/aspell-dict.txt @@ -1580,6 +1580,7 @@ indexOf infi initialQueryID initializeAggregation +initcap injective innogames inodes From 16ab84d8040e92c0b1a258cf554195371469344b Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 3 Jul 2023 11:50:26 +0000 Subject: [PATCH 24/63] Style fix --- docs/en/sql-reference/functions/string-functions.md | 2 +- docs/ru/sql-reference/functions/string-functions.md | 2 +- utils/check-style/aspell-ignore/en/aspell-dict.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/sql-reference/functions/string-functions.md b/docs/en/sql-reference/functions/string-functions.md index cab6764c041..cbbd32328bd 100644 --- a/docs/en/sql-reference/functions/string-functions.md +++ b/docs/en/sql-reference/functions/string-functions.md @@ -1264,4 +1264,4 @@ Like [initcap](#initcap), assuming that the string contains valid UTF-8 encoded Does not detect the language, e.g. for Turkish the result might not be exactly correct (i/İ vs. i/I). -If the length of the UTF-8 byte sequence is different for upper and lower case of a code point, the result may be incorrect for this code point. \ No newline at end of file +If the length of the UTF-8 byte sequence is different for upper and lower case of a code point, the result may be incorrect for this code point. diff --git a/docs/ru/sql-reference/functions/string-functions.md b/docs/ru/sql-reference/functions/string-functions.md index ecb36bf4f65..62697e5e197 100644 --- a/docs/ru/sql-reference/functions/string-functions.md +++ b/docs/ru/sql-reference/functions/string-functions.md @@ -1123,4 +1123,4 @@ Do Nothing for 2 Minutes 2:00   Как [initcap](#initcap), предпологая, что строка содержит набор байтов, представляющий текст в кодировке UTF-8. Не учитывает язык. То есть, для турецкого языка, результат может быть не совсем верным. Если длина UTF-8 последовательности байтов различна для верхнего и нижнего регистра кодовой точки, то для этой кодовой точки результат работы может быть некорректным. -Если строка содержит набор байтов, не являющийся UTF-8, то поведение не определено. \ No newline at end of file +Если строка содержит набор байтов, не являющийся UTF-8, то поведение не определено. diff --git a/utils/check-style/aspell-ignore/en/aspell-dict.txt b/utils/check-style/aspell-ignore/en/aspell-dict.txt index 835de91c0d8..79c34360584 100644 --- a/utils/check-style/aspell-ignore/en/aspell-dict.txt +++ b/utils/check-style/aspell-ignore/en/aspell-dict.txt @@ -1581,6 +1581,7 @@ infi initialQueryID initializeAggregation initcap +initcapUTF injective innogames inodes From d9d98d6286f1bef423167ef35f0278c08426b3a6 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 3 Jul 2023 13:18:54 +0000 Subject: [PATCH 25/63] Fix all_new_function... test --- .../02415_all_new_functions_must_be_documented.reference | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference b/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference index b5c133988e6..7eb0c57b362 100644 --- a/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference +++ b/tests/queries/0_stateless/02415_all_new_functions_must_be_documented.reference @@ -363,6 +363,8 @@ in inIgnoreSet indexHint indexOf +initcap +initcapUTF8 initialQueryID initializeAggregation intDiv From fe1cf294fb9fd239d449b4ed464bf7e1c3e2c207 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 3 Jul 2023 13:25:16 +0000 Subject: [PATCH 26/63] Fix ru docs --- docs/ru/sql-reference/functions/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/sql-reference/functions/string-functions.md b/docs/ru/sql-reference/functions/string-functions.md index 62697e5e197..b872200f99b 100644 --- a/docs/ru/sql-reference/functions/string-functions.md +++ b/docs/ru/sql-reference/functions/string-functions.md @@ -1120,7 +1120,7 @@ Do Nothing for 2 Minutes 2:00   ## initcapUTF8 {#initcapUTF8} -Как [initcap](#initcap), предпологая, что строка содержит набор байтов, представляющий текст в кодировке UTF-8. +Как [initcap](#initcap), предполагая, что строка содержит набор байтов, представляющий текст в кодировке UTF-8. Не учитывает язык. То есть, для турецкого языка, результат может быть не совсем верным. Если длина UTF-8 последовательности байтов различна для верхнего и нижнего регистра кодовой точки, то для этой кодовой точки результат работы может быть некорректным. Если строка содержит набор байтов, не являющийся UTF-8, то поведение не определено. From af603c2cc6455b31aba1a70c967c35b083fe6c0a Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Mon, 3 Jul 2023 16:40:04 +0200 Subject: [PATCH 27/63] Fixed stack overflow on Field destruction --- ..._function_state_deserialization_fuzzer.cpp | 1 + .../fuzzers/delta_decompress_fuzzer.cpp | 2 +- .../double_delta_decompress_fuzzer.cpp | 2 +- .../fuzzers/encrypted_decompress_fuzzer.cpp | 4 +-- .../fuzzers/lz4_decompress_fuzzer.cpp | 4 +-- src/Core/Field.h | 33 ++++++++++++++++++- src/DataTypes/DataTypeFactory.cpp | 2 +- src/Functions/DateTimeTransforms.h | 4 ++- 8 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp b/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp index 2ea01e1d5bc..3db1afb7a92 100644 --- a/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp +++ b/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp @@ -8,6 +8,7 @@ #include #include +#include #include diff --git a/src/Compression/fuzzers/delta_decompress_fuzzer.cpp b/src/Compression/fuzzers/delta_decompress_fuzzer.cpp index b039777da15..451606843e2 100644 --- a/src/Compression/fuzzers/delta_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/delta_decompress_fuzzer.cpp @@ -34,7 +34,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + codec->getAdditionalSizeAtTheEndOfBuffer()); - codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); + codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); return 0; } diff --git a/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp b/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp index f9822daa3bd..f7e685d68ad 100644 --- a/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp @@ -34,7 +34,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + codec->getAdditionalSizeAtTheEndOfBuffer()); - codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); + codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); return 0; } diff --git a/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp b/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp index 3e3d0e164fe..207cce21e3b 100644 --- a/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp @@ -292,10 +292,10 @@ try DB::Memory<> memory; memory.resize(input.size() + codec_128->getAdditionalSizeAtTheEndOfBuffer()); - codec_128->doDecompressData(input.data(), input.size(), memory.data(), input.size() - 31); + codec_128->doDecompressData(input.data(), static_cast(input.size()), memory.data(), static_cast(input.size() - 31)); memory.resize(input.size() + codec_128->getAdditionalSizeAtTheEndOfBuffer()); - codec_256->doDecompressData(input.data(), input.size(), memory.data(), input.size() - 31); + codec_256->doDecompressData(input.data(), static_cast(input.size()), memory.data(), static_cast(input.size() - 31)); return 0; } catch (...) diff --git a/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp b/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp index 85c4c9bd329..f6d4c51f18b 100644 --- a/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp @@ -24,7 +24,7 @@ try return 0; const auto * p = reinterpret_cast(data); - auto codec = DB::getCompressionCodecLZ4(p->level); + auto codec = DB::getCompressionCodecLZ4(static_cast(p->level)); size_t output_buffer_size = p->decompressed_size % 65536; size -= sizeof(AuxiliaryRandomData); @@ -37,7 +37,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + LZ4::ADDITIONAL_BYTES_AT_END_OF_BUFFER); - codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); + codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); return 0; } diff --git a/src/Core/Field.h b/src/Core/Field.h index ef1bd9a895d..8ee93d08411 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -28,6 +28,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int LOGICAL_ERROR; extern const int ILLEGAL_TYPE_OF_ARGUMENT; + extern const int TOO_DEEP_RECURSION; } constexpr Null NEGATIVE_INFINITY{Null::Value::NegativeInfinity}; @@ -291,6 +292,11 @@ decltype(auto) castToNearestFieldType(T && x) */ #define DBMS_MIN_FIELD_SIZE 32 +#if defined(SANITIZER) || !defined(NDEBUG) + #define DBMS_MAX_NESTED_FIELD_DEPTH 64 +#else + #define DBMS_MAX_NESTED_FIELD_DEPTH 256 +#endif /** Discriminated union of several types. * Made for replacement of `boost::variant` @@ -671,6 +677,27 @@ private: Types::Which which; + /// Field may contain a Field inside in case when Field stores Array, Tuple, Map or Object. + /// As the result stack overflow on destruction is possible + /// and to avoid it we need to count the depth and have a threshold. + size_t nested_field_depth = 0; + + /// Check whether T is already a Field with composite underlying type. + template + size_t calculateAndCheckFieldDepth(Original && x) + { + size_t result = 0; + + if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) + std::for_each(x.begin(), x.end(), [this, &x](auto & elem){ nested_field_depth = std::max(nested_field_depth, elem.nested_field_depth); }); + else if constexpr (std::is_same_v) + std::for_each(x.begin(), x.end(), [this, &x](auto & elem){ nested_field_depth = std::max(nested_field_depth, elem.second.nested_field_depth); }); + + if (result >= DBMS_MAX_NESTED_FIELD_DEPTH) + throw Exception(ErrorCodes::TOO_DEEP_RECURSION, "Too deep Field"); + + return result; + } /// Assuming there was no allocated state or it was deallocated (see destroy). template @@ -686,6 +713,8 @@ private: using StorageType = NearestFieldType; new (&storage) StorageType(std::forward(x)); which = TypeToEnum::value; + /// Incrementing the depth since we create a new Field. + nested_field_depth = calculateAndCheckFieldDepth(x) + 1; } /// Assuming same types. @@ -696,6 +725,8 @@ private: assert(which == TypeToEnum::value); JustT * MAY_ALIAS ptr = reinterpret_cast(&storage); *ptr = std::forward(x); + /// Do not increment the depth, because it is an assignment. + nested_field_depth = calculateAndCheckFieldDepth(x); } template @@ -781,7 +812,7 @@ private: } template - void destroy() + ALWAYS_INLINE void destroy() { T * MAY_ALIAS ptr = reinterpret_cast(&storage); ptr->~T(); diff --git a/src/DataTypes/DataTypeFactory.cpp b/src/DataTypes/DataTypeFactory.cpp index 415f24d8151..89dacae59ff 100644 --- a/src/DataTypes/DataTypeFactory.cpp +++ b/src/DataTypes/DataTypeFactory.cpp @@ -62,7 +62,7 @@ DataTypePtr DataTypeFactory::getImpl(const String & full_name) const } else { - ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", false, data_type_max_parse_depth); + ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", DBMS_DEFAULT_MAX_QUERY_SIZE, data_type_max_parse_depth); } return getImpl(ast); diff --git a/src/Functions/DateTimeTransforms.h b/src/Functions/DateTimeTransforms.h index 019e0c42cde..0aa495dace2 100644 --- a/src/Functions/DateTimeTransforms.h +++ b/src/Functions/DateTimeTransforms.h @@ -1449,8 +1449,10 @@ struct Transformer if constexpr (std::is_same_v || std::is_same_v) { +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion" bool is_valid_input = vec_from[i] >= 0 && vec_from[i] <= 0xFFFFFFFFL; - +# pragma clang diagnostic pop if (!is_valid_input) { if constexpr (std::is_same_v) From 9941b29fd3031bc12e055d17f18ad2b31ba7973d Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Mon, 3 Jul 2023 18:18:14 +0200 Subject: [PATCH 28/63] Better --- src/Core/Field.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Field.h b/src/Core/Field.h index 8ee93d08411..0b3c5b7f48d 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -689,9 +689,9 @@ private: size_t result = 0; if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) - std::for_each(x.begin(), x.end(), [this, &x](auto & elem){ nested_field_depth = std::max(nested_field_depth, elem.nested_field_depth); }); + std::for_each(x.begin(), x.end(), [this, &result](auto & elem){ result = std::max(result, elem.nested_field_depth); }); else if constexpr (std::is_same_v) - std::for_each(x.begin(), x.end(), [this, &x](auto & elem){ nested_field_depth = std::max(nested_field_depth, elem.second.nested_field_depth); }); + std::for_each(x.begin(), x.end(), [this, &result](auto & elem){ result = std::max(result, elem.second.nested_field_depth); }); if (result >= DBMS_MAX_NESTED_FIELD_DEPTH) throw Exception(ErrorCodes::TOO_DEEP_RECURSION, "Too deep Field"); @@ -711,10 +711,10 @@ private: // we must initialize the entire wide stored type, and not just the // nominal type. using StorageType = NearestFieldType; - new (&storage) StorageType(std::forward(x)); - which = TypeToEnum::value; /// Incrementing the depth since we create a new Field. nested_field_depth = calculateAndCheckFieldDepth(x) + 1; + new (&storage) StorageType(std::forward(x)); + which = TypeToEnum::value; } /// Assuming same types. @@ -724,9 +724,9 @@ private: using JustT = std::decay_t; assert(which == TypeToEnum::value); JustT * MAY_ALIAS ptr = reinterpret_cast(&storage); - *ptr = std::forward(x); /// Do not increment the depth, because it is an assignment. nested_field_depth = calculateAndCheckFieldDepth(x); + *ptr = std::forward(x); } template From 5b85e1ce8aa6c79ac8cb74be492ed06060ec2e73 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Mon, 3 Jul 2023 18:09:08 +0000 Subject: [PATCH 29/63] Special build check fix --- src/Functions/initcap.cpp | 2 ++ src/Functions/initcapUTF8.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Functions/initcap.cpp b/src/Functions/initcap.cpp index 7d0749ecb12..5460ee06792 100644 --- a/src/Functions/initcap.cpp +++ b/src/Functions/initcap.cpp @@ -14,6 +14,8 @@ struct InitcapImpl ColumnString::Chars & res_data, ColumnString::Offsets & res_offsets) { + if (data.empty()) + return; res_data.resize(data.size()); res_offsets.assign(offsets); array(data.data(), data.data() + data.size(), res_data.data()); diff --git a/src/Functions/initcapUTF8.cpp b/src/Functions/initcapUTF8.cpp index 333ebe266d3..076dcff6622 100644 --- a/src/Functions/initcapUTF8.cpp +++ b/src/Functions/initcapUTF8.cpp @@ -81,7 +81,7 @@ private: static void array(const UInt8 * src, const UInt8 * src_end, const ColumnString::Offsets & offsets, UInt8 * dst) { - auto offset_it = offsets.begin(); + const auto * offset_it = offsets.begin(); const UInt8 * begin = src; /// handle remaining symbols, row by row (to avoid influence of bad UTF8 symbols from one row, to another) From 9660291ab312ad0639ffc3058ad28015d76d08aa Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 3 Jul 2023 18:33:59 +0000 Subject: [PATCH 30/63] my fixes --- .../functions/array-functions.md | 2 +- src/Functions/array/arrayJaccardIndex.cpp | 9 ++-- .../0_stateless/02737_arrayJaccardIndex.sql | 41 +++++++------------ 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/docs/en/sql-reference/functions/array-functions.md b/docs/en/sql-reference/functions/array-functions.md index 921e9765080..862ecc42158 100644 --- a/docs/en/sql-reference/functions/array-functions.md +++ b/docs/en/sql-reference/functions/array-functions.md @@ -998,7 +998,7 @@ SELECT ## arrayJaccardIndex -Returns the jaccard similarity between two arrays. +Returns the [Jaccard index](https://en.wikipedia.org/wiki/Jaccard_index) of two arrays. **Example** diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp index 211680092b3..078687a6431 100644 --- a/src/Functions/array/arrayJaccardIndex.cpp +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -37,6 +37,7 @@ public: DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { FunctionArgumentDescriptors args{ + // XXX {"array_1", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, {"array_2", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, }; @@ -45,7 +46,7 @@ public: } template - static inline void getArraySize(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, size_t & left_size, size_t & right_size, const size_t & i) + static void getArraySize(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, size_t & left_size, size_t & right_size, const size_t & i) { if constexpr (is_const_left) left_size = left_offsets[0]; @@ -58,7 +59,7 @@ public: } template - static inline void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + static void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) { size_t left_size; size_t right_size; @@ -71,14 +72,14 @@ public: } template - static inline void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + static void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) { size_t left_size; size_t right_size; for (size_t i = 0; i < res.size(); ++i) { getArraySize(left_offsets, right_offsets, left_size, right_size, i); - if (unlikely(!left_size && !right_size)) + if ((!left_size && !right_size)) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "array aggregate functions cannot be performed on two empty arrays"); res[i] = 0; } diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql index 000106e93b7..ba5a93f1658 100644 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql @@ -1,31 +1,20 @@ -drop table if exists array_jaccard_index; +SELECT ['a'] AS arr_1, ['a', 'aa', 'aaa'] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); +SELECT [1, 1.1, 2.2] AS arr_1, [2.2, 3.3, 444] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); +SELECT [toUInt16(1)] AS arr_1, [toUInt32(1)] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); +SELECT [1,2] AS arr_1, [1,2,3,4] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); +SELECT [[1,2], [3,4]] AS arr_1, [[1,2], [3,5]] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); -create table array_jaccard_index (arr Array(UInt8)) engine = MergeTree order by arr; +DROP TABLE IF EXISTS array_jaccard_index; -insert into array_jaccard_index values ([1,2,3]); +CREATE TABLE array_jaccard_index (arr Array(UInt8)) engine = MergeTree ORDER BY arr; +INSERT INTO array_jaccard_index values ([1,2,3]); +INSERT INTO array_jaccard_index values ([1,2]); +INSERT INTO array_jaccard_index values ([1]); -insert into array_jaccard_index values ([1,2]); - -insert into array_jaccard_index values ([1]); - -select arr as arr_1, [1,2] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; - -select arr as arr_1, [] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; - -select [] as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; - -select [1,2] as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; - -select arr as arr_1, arr as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) from array_jaccard_index order by arr; +SELECT arr AS arr_1, [1,2] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; +SELECT arr AS arr_1, [] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; +SELECT [] AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; +SELECT [1,2] AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; +SELECT arr AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; drop table array_jaccard_index; - -select ['a'] as arr_1, ['a', 'aa', 'aaa'] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); - -select [1, 1.1, 2.2] as arr_1, [2.2, 3.3, 444] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); - -select [toUInt16(1)] as arr_1, [toUInt32(1)] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); - -select [1,2] as arr_1, [1,2,3,4] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); - -select [[1,2], [3,4]] as arr_1, [[1,2], [3,5]] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); From 29f93bd06dc7cb7ba6a768644bc5a0eda79126d4 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 3 Jul 2023 20:25:51 +0000 Subject: [PATCH 31/63] More fixes, pt. II --- src/DataTypes/IDataType.h | 34 +++-- src/Functions/array/arrayJaccardIndex.cpp | 137 ++++++++++-------- .../02737_arrayJaccardIndex.reference | 19 ++- .../0_stateless/02737_arrayJaccardIndex.sql | 32 ++-- ...2737_arrayJaccardIndex_exception.reference | 2 - .../02737_arrayJaccardIndex_exception.sh | 11 -- 6 files changed, 126 insertions(+), 109 deletions(-) delete mode 100644 tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference delete mode 100755 tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh diff --git a/src/DataTypes/IDataType.h b/src/DataTypes/IDataType.h index bfc4a71083d..4adafe5d212 100644 --- a/src/DataTypes/IDataType.h +++ b/src/DataTypes/IDataType.h @@ -410,21 +410,29 @@ inline bool isDateTime(const T & data_type) { return WhichDataType(data_type).is template inline bool isDateTime64(const T & data_type) { return WhichDataType(data_type).isDateTime64(); } -inline bool isEnum(const DataTypePtr & data_type) { return WhichDataType(data_type).isEnum(); } -inline bool isDecimal(const DataTypePtr & data_type) { return WhichDataType(data_type).isDecimal(); } -inline bool isTuple(const DataTypePtr & data_type) { return WhichDataType(data_type).isTuple(); } -inline bool isArray(const DataTypePtr & data_type) { return WhichDataType(data_type).isArray(); } -inline bool isMap(const DataTypePtr & data_type) {return WhichDataType(data_type).isMap(); } -inline bool isInterval(const DataTypePtr & data_type) {return WhichDataType(data_type).isInterval(); } -inline bool isNothing(const DataTypePtr & data_type) { return WhichDataType(data_type).isNothing(); } -inline bool isUUID(const DataTypePtr & data_type) { return WhichDataType(data_type).isUUID(); } -inline bool isIPv4(const DataTypePtr & data_type) { return WhichDataType(data_type).isIPv4(); } -inline bool isIPv6(const DataTypePtr & data_type) { return WhichDataType(data_type).isIPv6(); } +template +inline bool isEnum(const T & data_type) { return WhichDataType(data_type).isEnum(); } +template +inline bool isDecimal(const T & data_type) { return WhichDataType(data_type).isDecimal(); } +template +inline bool isTuple(const T & data_type) { return WhichDataType(data_type).isTuple(); } +template +inline bool isArray(const T & data_type) { return WhichDataType(data_type).isArray(); } +template +inline bool isMap(const T & data_type) {return WhichDataType(data_type).isMap(); } +template +inline bool isInterval(const T & data_type) {return WhichDataType(data_type).isInterval(); } +template +inline bool isNothing(const T & data_type) { return WhichDataType(data_type).isNothing(); } +template +inline bool isUUID(const T & data_type) { return WhichDataType(data_type).isUUID(); } +template +inline bool isIPv4(const T & data_type) { return WhichDataType(data_type).isIPv4(); } +template +inline bool isIPv6(const T & data_type) { return WhichDataType(data_type).isIPv6(); } template -inline bool isObject(const T & data_type) -{ - return WhichDataType(data_type).isObject(); +inline bool isObject(const T & data_type) { return WhichDataType(data_type).isObject(); } template diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp index 078687a6431..755e0f8278f 100644 --- a/src/Functions/array/arrayJaccardIndex.cpp +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -24,8 +24,58 @@ namespace ErrorCodes class FunctionArrayJaccardIndex : public IFunction { -public: +private: using ResultType = Float64; + + struct LeftAndRightSizes + { + size_t left_size; + size_t right_size; + }; + + template + static LeftAndRightSizes getArraySizes(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, size_t i) + { + size_t left_size; + size_t right_size; + + if constexpr (left_is_const) + left_size = left_offsets[0]; + else + left_size = left_offsets[i] - left_offsets[i - 1]; + + if constexpr (right_is_const) + right_size = right_offsets[0]; + else + right_size = right_offsets[i] - right_offsets[i - 1]; + + return {left_size, right_size}; + } + + template + static void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + { + for (size_t i = 0; i < res.size(); ++i) + { + LeftAndRightSizes sizes = getArraySizes(left_offsets, right_offsets, i); + size_t intersect_size = intersect_offsets[i] - intersect_offsets[i - 1]; + res[i] = static_cast(intersect_size) / (sizes.left_size + sizes.right_size - intersect_size); + } + } + + template + static void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) + { + for (size_t i = 0; i < res.size(); ++i) + { + LeftAndRightSizes sizes = getArraySizes(left_offsets, right_offsets, i); + if (sizes.left_size == 0 && sizes.right_size == 0) + throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "array aggregate functions cannot be performed on two empty arrays"); + res[i] = 0; + } + } + +public: static constexpr auto name = "arrayJaccardIndex"; String getName() const override { return name; } static FunctionPtr create(ContextPtr context_) { return std::make_shared(context_); } @@ -37,100 +87,59 @@ public: DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { FunctionArgumentDescriptors args{ - // XXX - {"array_1", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, - {"array_2", [](const IDataType & type) { return isArray(type.getPtr()); }, nullptr, "Array"}, + {"array_1", &isArray, nullptr, "Array"}, + {"array_2", &isArray, nullptr, "Array"}, }; validateFunctionArgumentTypes(*this, arguments, args); return std::make_shared>(); } - template - static void getArraySize(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, size_t & left_size, size_t & right_size, const size_t & i) - { - if constexpr (is_const_left) - left_size = left_offsets[0]; - else - left_size = left_offsets[i] - left_offsets[i - 1]; - if constexpr (is_const_right) - right_size = right_offsets[0]; - else - right_size = right_offsets[i] - right_offsets[i - 1]; - } - - template - static void vector(const ColumnArray::Offsets & intersect_offsets, const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) - { - size_t left_size; - size_t right_size; - for (size_t i = 0; i < res.size(); ++i) - { - getArraySize(left_offsets, right_offsets, left_size, right_size, i); - size_t intersect_size = intersect_offsets[i] - intersect_offsets[i - 1]; - res[i] = static_cast(intersect_size) / (left_size + right_size - intersect_size); - } - } - - template - static void vectorWithEmptyIntersect(const ColumnArray::Offsets & left_offsets, const ColumnArray::Offsets & right_offsets, PaddedPODArray & res) - { - size_t left_size; - size_t right_size; - for (size_t i = 0; i < res.size(); ++i) - { - getArraySize(left_offsets, right_offsets, left_size, right_size, i); - if ((!left_size && !right_size)) - throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "array aggregate functions cannot be performed on two empty arrays"); - res[i] = 0; - } - } - ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override { - auto cast_array = [&](const ColumnWithTypeAndName & col) -> std::pair + auto cast_to_array = [&](const ColumnWithTypeAndName & col) -> std::pair { - const ColumnArray * res; - bool is_const = false; if (const ColumnConst * col_const = typeid_cast(col.column.get())) { - res = checkAndGetColumn(col_const->getDataColumnPtr().get()); - is_const = true; + const ColumnArray * col_const_array = checkAndGetColumn(col_const->getDataColumnPtr().get()); + return {col_const_array, true}; } - else if (!(res = checkAndGetColumn(col.column.get()))) - throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Argument for function {} must be array but it has type {}.", - col.column->getName(), getName()); - return {res, is_const}; + else if (const ColumnArray * col_non_const_array = checkAndGetColumn(col.column.get())) + return {col_non_const_array, false}; + else + throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Argument for function {} must be array but it has type {}.", col.column->getName(), getName()); }; - const auto & [left_array, is_const_left] = cast_array(arguments[0]); - const auto & [right_array, is_const_right] = cast_array(arguments[1]); + const auto & [left_array, left_is_const] = cast_to_array(arguments[0]); + const auto & [right_array, right_is_const] = cast_to_array(arguments[1]); auto intersect_array = FunctionFactory::instance().get("arrayIntersect", context)->build(arguments); + ColumnWithTypeAndName intersect_column; intersect_column.type = intersect_array->getResultType(); intersect_column.column = intersect_array->execute(arguments, intersect_column.type, input_rows_count); - const auto * return_type_intersect = checkAndGetDataType(intersect_column.type.get()); - if (!return_type_intersect) + + const auto * intersect_column_type = checkAndGetDataType(intersect_column.type.get()); + if (!intersect_column_type) throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected return type for function arrayIntersect"); auto col_res = ColumnVector::create(); typename ColumnVector::Container & vec_res = col_res->getData(); vec_res.resize(input_rows_count); -#define EXECUTE_VECTOR(is_const_left, is_const_right) \ - if (typeid_cast(return_type_intersect->getNestedType().get())) \ - vectorWithEmptyIntersect(left_array->getOffsets(), right_array->getOffsets(), vec_res); \ +#define EXECUTE_VECTOR(left_is_const, right_is_const) \ + if (typeid_cast(intersect_column_type->getNestedType().get())) \ + vectorWithEmptyIntersect(left_array->getOffsets(), right_array->getOffsets(), vec_res); \ else \ { \ const ColumnArray * intersect_column_array = checkAndGetColumn(intersect_column.column.get()); \ - vector(intersect_column_array->getOffsets(), left_array->getOffsets(), right_array->getOffsets(), vec_res); \ + vector(intersect_column_array->getOffsets(), left_array->getOffsets(), right_array->getOffsets(), vec_res); \ } - if (!is_const_left && !is_const_right) + if (!left_is_const && !right_is_const) EXECUTE_VECTOR(false, false) - else if (!is_const_left && is_const_right) + else if (!left_is_const && right_is_const) EXECUTE_VECTOR(false, true) - else if (is_const_left && !is_const_right) + else if (left_is_const && !right_is_const) EXECUTE_VECTOR(true, false) else EXECUTE_VECTOR(true, true) diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.reference b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference index 0b7969889c0..62a51ec0ab2 100644 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex.reference +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.reference @@ -1,20 +1,23 @@ +negative tests +const arguments +[1,2] [1,2,3,4] 0.5 +[1,1.1,2.2] [2.2,3.3,444] 0.2 +[1] [1] 1 +['a'] ['a','aa','aaa'] 0.33 +[[1,2],[3,4]] [[1,2],[3,5]] 0.33 +non-const arguments [1] [1,2] 0.5 [1,2] [1,2] 1 [1,2,3] [1,2] 0.67 [1] [] 0 [1,2] [] 0 [1,2,3] [] 0 -[] [1] 0 -[] [1,2] 0 -[] [1,2,3] 0 [1,2] [1] 0.5 [1,2] [1,2] 1 [1,2] [1,2,3] 0.67 +[] [1] 0 +[] [1,2] 0 +[] [1,2,3] 0 [1] [1] 1 [1,2] [1,2] 1 [1,2,3] [1,2,3] 1 -['a'] ['a','aa','aaa'] 0.33 -[1,1.1,2.2] [2.2,3.3,444] 0.2 -[1] [1] 1 -[1,2] [1,2,3,4] 0.5 -[[1,2],[3,4]] [[1,2],[3,5]] 0.33 diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql index ba5a93f1658..499debd94b7 100644 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex.sql +++ b/tests/queries/0_stateless/02737_arrayJaccardIndex.sql @@ -1,8 +1,18 @@ -SELECT ['a'] AS arr_1, ['a', 'aa', 'aaa'] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); -SELECT [1, 1.1, 2.2] AS arr_1, [2.2, 3.3, 444] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); -SELECT [toUInt16(1)] AS arr_1, [toUInt32(1)] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); -SELECT [1,2] AS arr_1, [1,2,3,4] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); -SELECT [[1,2], [3,4]] AS arr_1, [[1,2], [3,5]] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2); +SELECT 'negative tests'; + +SELECT 'a' AS arr1, 2 AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } +SELECT [] AS arr1, [] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT } +SELECT ['1', '2'] AS arr1, [1,2] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); -- { serverError NO_COMMON_TYPE } + +SELECT 'const arguments'; + +SELECT [1,2] AS arr1, [1,2,3,4] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); +SELECT [1, 1.1, 2.2] AS arr1, [2.2, 3.3, 444] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); +SELECT [toUInt16(1)] AS arr1, [toUInt32(1)] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); +SELECT ['a'] AS arr1, ['a', 'aa', 'aaa'] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); +SELECT [[1,2], [3,4]] AS arr1, [[1,2], [3,5]] AS arr2, round(arrayJaccardIndex(arr1, arr2), 2); + +SELECT 'non-const arguments'; DROP TABLE IF EXISTS array_jaccard_index; @@ -11,10 +21,10 @@ INSERT INTO array_jaccard_index values ([1,2,3]); INSERT INTO array_jaccard_index values ([1,2]); INSERT INTO array_jaccard_index values ([1]); -SELECT arr AS arr_1, [1,2] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; -SELECT arr AS arr_1, [] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; -SELECT [] AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; -SELECT [1,2] AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; -SELECT arr AS arr_1, arr AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2) FROM array_jaccard_index ORDER BY arr; +SELECT arr, [1,2] AS other, round(arrayJaccardIndex(arr, other), 2) FROM array_jaccard_index ORDER BY arr; +SELECT arr, [] AS other, round(arrayJaccardIndex(arr, other), 2) FROM array_jaccard_index ORDER BY arr; +SELECT [1,2] AS other, arr, round(arrayJaccardIndex(other, arr), 2) FROM array_jaccard_index ORDER BY arr; +SELECT [] AS other, arr, round(arrayJaccardIndex(other, arr), 2) FROM array_jaccard_index ORDER BY arr; +SELECT arr, arr, round(arrayJaccardIndex(arr, arr), 2) FROM array_jaccard_index ORDER BY arr; -drop table array_jaccard_index; +DROP TABLE array_jaccard_index; diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference deleted file mode 100644 index 307d9a195b0..00000000000 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.reference +++ /dev/null @@ -1,2 +0,0 @@ -Code: 43 -Code: 386 diff --git a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh b/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh deleted file mode 100755 index 49e80e06cba..00000000000 --- a/tests/queries/0_stateless/02737_arrayJaccardIndex_exception.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -# shellcheck source=../shell_config.sh -. "$CURDIR"/../shell_config.sh - -# Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: array aggregate functions cannot be performed on two empty arrays: While processing arrayJaccardIndex([], []). (ILLEGAL_TYPE_OF_ARGUMENT) -$CLICKHOUSE_CLIENT -q "SELECT arrayJaccardIndex([], [])" |& grep -o "Code: 43" - -# Code: 386. DB::Exception: Received from localhost:9000. DB::Exception: There is no subtype for types UInt8, String because some of them are String/FixedString and some of them are not: While processing [1, 2] AS arr_1, ['1', '2'] AS arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2). (NO_COMMON_TYPE) -$CLICKHOUSE_CLIENT -q "select [1,2] as arr_1, ['1','2'] as arr_2, round(arrayJaccardIndex(arr_1, arr_2), 2)" |& grep -o "Code: 386" From 2e245f4a438544f2270ef2be9336c8fb6e4aa6ed Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 4 Jul 2023 00:23:00 +0200 Subject: [PATCH 32/63] Even better --- src/Core/Field.h | 58 +- .../fuzzers/codegen_fuzzer/CMakeLists.txt | 2 +- .../fuzzers/codegen_fuzzer/clickhouse.g | 1592 ++++ src/Parsers/fuzzers/codegen_fuzzer/out.cpp | 6461 +++++++++++++++++ src/Parsers/fuzzers/codegen_fuzzer/out.proto | 1587 ++++ 5 files changed, 9686 insertions(+), 14 deletions(-) create mode 100644 src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g create mode 100644 src/Parsers/fuzzers/codegen_fuzzer/out.cpp create mode 100644 src/Parsers/fuzzers/codegen_fuzzer/out.proto diff --git a/src/Core/Field.h b/src/Core/Field.h index 0b3c5b7f48d..97a32ab5bb1 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -42,10 +42,13 @@ using FieldVector = std::vector>; /// construct a Field of Array or a Tuple type. An alternative approach would be /// to construct both of these types from FieldVector, and have the caller /// specify the desired Field type explicitly. +/// As the result stack overflow on destruction is possible +/// and to avoid it we need to count the depth and have a threshold. #define DEFINE_FIELD_VECTOR(X) \ struct X : public FieldVector \ { \ using FieldVector::FieldVector; \ + size_t nested_field_depth = 0; \ } DEFINE_FIELD_VECTOR(Array); @@ -62,6 +65,7 @@ using FieldMap = std::map, AllocatorWithMemoryTrackin struct X : public FieldMap \ { \ using FieldMap::FieldMap; \ + size_t nested_field_depth = 0; \ } DEFINE_FIELD_MAP(Object); @@ -677,21 +681,43 @@ private: Types::Which which; - /// Field may contain a Field inside in case when Field stores Array, Tuple, Map or Object. - /// As the result stack overflow on destruction is possible - /// and to avoid it we need to count the depth and have a threshold. - size_t nested_field_depth = 0; - - /// Check whether T is already a Field with composite underlying type. + /// StorageType and Original are the same for Array, Tuple, Map, Object template size_t calculateAndCheckFieldDepth(Original && x) { size_t result = 0; - if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) - std::for_each(x.begin(), x.end(), [this, &result](auto & elem){ result = std::max(result, elem.nested_field_depth); }); - else if constexpr (std::is_same_v) - std::for_each(x.begin(), x.end(), [this, &result](auto & elem){ result = std::max(result, elem.second.nested_field_depth); }); + if constexpr (std::is_same_v + || std::is_same_v + || std::is_same_v + || std::is_same_v) + { + result = x.nested_field_depth; + + auto calculate_max = [](const Field & elem, size_t result) + { + switch (elem.which) + { + case Types::Array: + return std::max(result, elem.template get().nested_field_depth); + case Types::Tuple: + return std::max(result, elem.template get().nested_field_depth); + case Types::Map: + return std::max(result, elem.template get().nested_field_depth); + case Types::Object: + return std::max(result, elem.template get().nested_field_depth); + default: + return result; + } + }; + + if constexpr (std::is_same_v) + for (auto & [_, value] : x) + result = calculate_max(value, result); + else + for (auto & value : x) + result = calculate_max(value, result); + } if (result >= DBMS_MAX_NESTED_FIELD_DEPTH) throw Exception(ErrorCodes::TOO_DEEP_RECURSION, "Too deep Field"); @@ -711,9 +737,17 @@ private: // we must initialize the entire wide stored type, and not just the // nominal type. using StorageType = NearestFieldType; + /// Incrementing the depth since we create a new Field. - nested_field_depth = calculateAndCheckFieldDepth(x) + 1; + auto depth = calculateAndCheckFieldDepth(x) + 1; new (&storage) StorageType(std::forward(x)); + + if constexpr (std::is_same_v + || std::is_same_v + || std::is_same_v + || std::is_same_v) + reinterpret_cast(&storage)->nested_field_depth = depth + 1; + which = TypeToEnum::value; } @@ -724,8 +758,6 @@ private: using JustT = std::decay_t; assert(which == TypeToEnum::value); JustT * MAY_ALIAS ptr = reinterpret_cast(&storage); - /// Do not increment the depth, because it is an assignment. - nested_field_depth = calculateAndCheckFieldDepth(x); *ptr = std::forward(x); } diff --git a/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt b/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt index 727c49cfc4d..30f0e91a75b 100644 --- a/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt +++ b/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt @@ -42,4 +42,4 @@ clickhouse_add_executable(codegen_select_fuzzer ${FUZZER_SRCS}) set_source_files_properties("${PROTO_SRCS}" "out.cpp" PROPERTIES COMPILE_FLAGS "-Wno-reserved-identifier") target_include_directories(codegen_select_fuzzer SYSTEM BEFORE PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") -target_link_libraries(codegen_select_fuzzer PRIVATE ch_contrib::protobuf_mutator ch_contrib::protoc dbms ${LIB_FUZZING_ENGINE}) +target_link_libraries(codegen_select_fuzzer PRIVATE ch_contrib::protobuf ch_contrib::protobuf_mutator ch_contrib::protoc dbms ${LIB_FUZZING_ENGINE}) diff --git a/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g b/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g new file mode 100644 index 00000000000..0ae74055eda --- /dev/null +++ b/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g @@ -0,0 +1,1592 @@ +" "; +" "; +" "; +";"; + + +"(" $1 ")"; +"(" $1 ", " $2 ")"; +"(" $1 ", " $2 ", " $3 ")"; + +$1 ", " $2 ; +$1 ", " $2 ", " $3 ; +$1 ", " $2 ", " $3 ", " $4 ; +$1 ", " $2 ", " $3 ", " $4 ", " $5 ; + +"[" $1 ", " $2 "]"; +"[" $1 ", " $2 ", " $3 "]"; +"[" $1 ", " $2 ", " $3 ", " $4 "]"; +"[" $1 ", " $2 ", " $3 ", " $4 ", " $5 "]"; + +$0 "(" $1 ")"; +$0 "(" $1 ", " $2 ")"; +$0 "(" $1 ", " $2 ", " $3 ")"; + +$1 " as " $2 ; + + +// TODO: add more clickhouse specific stuff +"SELECT " $1 " FROM " $2 " WHERE " $3 ; +"SELECT " $1 " FROM " $2 " GROUP BY " $3 ; +"SELECT " $1 " FROM " $2 " SORT BY " $3 ; +"SELECT " $1 " FROM " $2 " LIMIT " $3 ; +"SELECT " $1 " FROM " $2 " JOIN " $3 ; +"SELECT " $1 " FROM " $2 " ARRAY JOIN " $3 ; +"SELECT " $1 " FROM " $2 " JOIN " $3 " ON " $4 ; +"SELECT " $1 " FROM " $2 " JOIN " $3 " USING " $5 ; +"SELECT " $1 " INTO OUTFILE " $2 ; + +"WITH " $1 " AS " $2 ; + +"{" $1 ":" $2 "}"; +"[" $1 "," $2 "]"; +"[]"; + + +" x "; +"x"; +" `x` "; +"`x`"; + +" \"value\" "; +"\"value\""; +" 0 "; +"0"; +"1"; +"2"; +"123123123123123123"; +"182374019873401982734091873420923123123123123123"; +"1e-1"; +"1.1"; +"\"\""; +" '../../../../../../../../../etc/passwd' "; + +"/"; +"="; +"=="; +"!="; +"<>"; +"<"; +"<="; +">"; +">="; +"<<"; +"|<<"; +"&"; +"|"; +"||"; +"<|"; +"|>"; +"+"; +"-"; +"~"; +"*"; +"/"; +"\\"; +"%"; +""; +"."; +","; +","; +","; +","; +","; +","; +"("; +")"; +"("; +")"; +"("; +")"; +"("; +")"; +"("; +")"; +"("; +")"; +"?"; +":"; +"@"; +"@@"; +"$"; +"\""; +"`"; +"{"; +"}"; +"^"; +"::"; +"->"; +"]"; +"["; + +" abs "; +" accurate_Cast "; +" accurateCast "; +" accurate_CastOrNull "; +" accurateCastOrNull "; +" acos "; +" acosh "; +" ADD "; +" ADD COLUMN "; +" ADD CONSTRAINT "; +" addDays "; +" addHours "; +" ADD INDEX "; +" addMinutes "; +" addMonths "; +" addQuarters "; +" addressToLine "; +" addressToSymbol "; +" addSeconds "; +" addWeeks "; +" addYears "; +" aes_decrypt_mysql "; +" aes_encrypt_mysql "; +" AFTER "; +" AggregateFunction "; +" aggThrow "; +" ALIAS "; +" ALL "; +" alphaTokens "; +" ALTER "; +" ALTER LIVE VIEW "; +" ALTER TABLE "; +" and "; +" AND "; +" ANTI "; +" any "; +" ANY "; +" anyHeavy "; +" anyLast "; +" appendTrailingCharIfAbsent "; +" argMax "; +" argMin "; +" array "; +" Array "; +" ARRAY "; +" arrayAll "; +" arrayAUC "; +" arrayAvg "; +" arrayCompact "; +" arrayConcat "; +" arrayCount "; +" arrayCumSum "; +" arrayCumSumNonNegative "; +" arrayDifference "; +" arrayDistinct "; +" arrayElement "; +" arrayEnumerate "; +" arrayEnumerateDense "; +" arrayEnumerateDenseRanked "; +" arrayEnumerateUniq "; +" arrayEnumerateUniqRanked "; +" arrayExists "; +" arrayFill "; +" arrayFilter "; +" arrayFirst "; +" arrayFirstIndex "; +" arrayFlatten "; +" arrayIntersect "; +" arrayJoin "; +" ARRAY JOIN "; +" arrayMap "; +" arrayMax "; +" arrayMin "; +" arrayPartialReverseSort "; +" arrayPartialShuffle "; +" arrayPartialSort "; +" arrayPopBack "; +" arrayPopFront "; +" arrayProduct "; +" arrayPushBack "; +" arrayPushFront "; +" arrayReduce "; +" arrayReduceInRanges "; +" arrayResize "; +" arrayReverse "; +" arrayReverseFill "; +" arrayReverseSort "; +" arrayReverseSplit "; +" arrayShuffle "; +" arraySlice "; +" arraySort "; +" arraySplit "; +" arrayStringConcat "; +" arraySum "; +" arrayUniq "; +" arrayWithConstant "; +" arrayZip "; +" AS "; +" ASC "; +" ASCENDING "; +" asin "; +" asinh "; +" ASOF "; +" assumeNotNull "; +" AST "; +" ASYNC "; +" atan "; +" atan2 "; +" atanh "; +" ATTACH "; +" ATTACH PART "; +" ATTACH PARTITION "; +" avg "; +" avgWeighted "; +" bar "; +" base64Decode "; +" base64Encode "; +" basename "; +" bayesAB "; +" BETWEEN "; +" BIGINT "; +" BIGINT SIGNED "; +" BIGINT UNSIGNED "; +" bin "; +" BINARY "; +" BINARY LARGE OBJECT "; +" BINARY VARYING "; +" bitAnd "; +" BIT_AND "; +" __bitBoolMaskAnd "; +" __bitBoolMaskOr "; +" bitCount "; +" bitHammingDistance "; +" bitmapAnd "; +" bitmapAndCardinality "; +" bitmapAndnot "; +" bitmapAndnotCardinality "; +" bitmapBuild "; +" bitmapCardinality "; +" bitmapContains "; +" bitmapHasAll "; +" bitmapHasAny "; +" bitmapMax "; +" bitmapMin "; +" bitmapOr "; +" bitmapOrCardinality "; +" bitmapSubsetInRange "; +" bitmapSubsetLimit "; +" bitmapToArray "; +" bitmapTransform "; +" bitmapXor "; +" bitmapXorCardinality "; +" bitmaskToArray "; +" bitmaskToList "; +" bitNot "; +" bitOr "; +" BIT_OR "; +" bitPositionsToArray "; +" bitRotateLeft "; +" bitRotateRight "; +" bitShiftLeft "; +" bitShiftRight "; +" __bitSwapLastTwo "; +" bitTest "; +" bitTestAll "; +" bitTestAny "; +" __bitWrapperFunc "; +" bitXor "; +" BIT_XOR "; +" BLOB "; +" blockNumber "; +" blockSerializedSize "; +" blockSize "; +" BOOL "; +" BOOLEAN "; +" BOTH "; +" boundingRatio "; +" buildId "; +" BY "; +" BYTE "; +" BYTEA "; +" byteSize "; +" CASE "; +" caseWithExpr "; +" caseWithExpression "; +" caseWithoutExpr "; +" caseWithoutExpression "; +" _CAST "; +" CAST "; +" categoricalInformationValue "; +" cbrt "; +" ceil "; +" ceiling "; +" char "; +" CHAR "; +" CHARACTER "; +" CHARACTER LARGE OBJECT "; +" CHARACTER_LENGTH "; +" CHARACTER VARYING "; +" CHAR LARGE OBJECT "; +" CHAR_LENGTH "; +" CHAR VARYING "; +" CHECK "; +" CHECK TABLE "; +" cityHash64 "; +" CLEAR "; +" CLEAR COLUMN "; +" CLEAR INDEX "; +" CLOB "; +" CLUSTER "; +" coalesce "; +" CODEC "; +" COLLATE "; +" COLUMN "; +" COLUMNS "; +" COMMENT "; +" COMMENT COLUMN "; +" concat "; +" concatAssumeInjective "; +" connection_id "; +" connectionid "; +" connectionId "; +" CONSTRAINT "; +" convertCharset "; +" corr "; +" corrStable "; +" cos "; +" cosh "; +" count "; +" countDigits "; +" countEqual "; +" countMatches "; +" countMatchesCaseInsensitive "; +" countSubstrings "; +" countSubstringsCaseInsensitive "; +" countSubstringsCaseInsensitiveUTF8 "; +" covarPop "; +" COVAR_POP "; +" covarPopStable "; +" covarSamp "; +" COVAR_SAMP "; +" covarSampStable "; +" CRC32 "; +" CRC32IEEE "; +" CRC64 "; +" CREATE "; +" CROSS "; +" CUBE "; +" currentDatabase "; +" currentProfiles "; +" currentRoles "; +" currentUser "; +" cutFragment "; +" cutIPv6 "; +" cutQueryString "; +" cutQueryStringAndFragment "; +" cutToFirstSignificantSubdomain "; +" cutToFirstSignificantSubdomainCustom "; +" cutToFirstSignificantSubdomainCustomWithWWW "; +" cutToFirstSignificantSubdomainWithWWW "; +" cutURLParameter "; +" cutWWW "; +" D "; +" DATABASE "; +" DATABASES "; +" Date "; +" DATE "; +" Date32 "; +" DATE_ADD "; +" DATEADD "; +" dateDiff "; +" DATE_DIFF "; +" DATEDIFF "; +" dateName "; +" DATE_SUB "; +" DATESUB "; +" DateTime "; +" DateTime32 "; +" DateTime64 "; +" dateTime64ToSnowflake "; +" dateTimeToSnowflake "; +" date_trunc "; +" dateTrunc "; +" DAY "; +" DAYOFMONTH "; +" DAYOFWEEK "; +" DAYOFYEAR "; +" DD "; +" DEC "; +" Decimal "; +" Decimal128 "; +" Decimal256 "; +" Decimal32 "; +" Decimal64 "; +" decodeURLComponent "; +" decodeXMLComponent "; +" decrypt "; +" DEDUPLICATE "; +" DEFAULT "; +" defaultProfiles "; +" defaultRoles "; +" defaultValueOfArgumentType "; +" defaultValueOfTypeName "; +" DELAY "; +" DELETE "; +" DELETE WHERE "; +" deltaSum "; +" deltaSumTimestamp "; +" demangle "; +" dense_rank "; +" DESC "; +" DESCENDING "; +" DESCRIBE "; +" DETACH "; +" DETACH PARTITION "; +" dictGet "; +" dictGetChildren "; +" dictGetDate "; +" dictGetDateOrDefault "; +" dictGetDateTime "; +" dictGetDateTimeOrDefault "; +" dictGetDescendants "; +" dictGetFloat32 "; +" dictGetFloat32OrDefault "; +" dictGetFloat64 "; +" dictGetFloat64OrDefault "; +" dictGetHierarchy "; +" dictGetInt16 "; +" dictGetInt16OrDefault "; +" dictGetInt32 "; +" dictGetInt32OrDefault "; +" dictGetInt64 "; +" dictGetInt64OrDefault "; +" dictGetInt8 "; +" dictGetInt8OrDefault "; +" dictGetOrDefault "; +" dictGetOrNull "; +" dictGetString "; +" dictGetStringOrDefault "; +" dictGetUInt16 "; +" dictGetUInt16OrDefault "; +" dictGetUInt32 "; +" dictGetUInt32OrDefault "; +" dictGetUInt64 "; +" dictGetUInt64OrDefault "; +" dictGetUInt8 "; +" dictGetUInt8OrDefault "; +" dictGetUUID "; +" dictGetUUIDOrDefault "; +" dictHas "; +" DICTIONARIES "; +" DICTIONARY "; +" dictIsIn "; +" DISK "; +" DISTINCT "; +" DISTRIBUTED "; +" divide "; +" domain "; +" domainWithoutWWW "; +" DOUBLE "; +" DOUBLE PRECISION "; +" DROP "; +" DROP COLUMN "; +" DROP CONSTRAINT "; +" DROP DETACHED PART "; +" DROP DETACHED PARTITION "; +" DROP INDEX "; +" DROP PARTITION "; +" dumpColumnStructure "; +" e "; +" ELSE "; +" empty "; +" emptyArrayDate "; +" emptyArrayDateTime "; +" emptyArrayFloat32 "; +" emptyArrayFloat64 "; +" emptyArrayInt16 "; +" emptyArrayInt32 "; +" emptyArrayInt64 "; +" emptyArrayInt8 "; +" emptyArrayString "; +" emptyArrayToSingle "; +" emptyArrayUInt16 "; +" emptyArrayUInt32 "; +" emptyArrayUInt64 "; +" emptyArrayUInt8 "; +" enabledProfiles "; +" enabledRoles "; +" encodeXMLComponent "; +" encrypt "; +" END "; +" endsWith "; +" ENGINE "; +" entropy "; +" Enum "; +" ENUM "; +" Enum16 "; +" Enum8 "; +" equals "; +" erf "; +" erfc "; +" errorCodeToName "; +" evalMLMethod "; +" EVENTS "; +" EXCHANGE TABLES "; +" EXISTS "; +" exp "; +" exp10 "; +" exp2 "; +" EXPLAIN "; +" exponentialMovingAverage "; +" EXPRESSION "; +" extract "; +" EXTRACT "; +" extractAll "; +" extractAllGroups "; +" extractAllGroupsHorizontal "; +" extractAllGroupsVertical "; +" extractGroups "; +" extractTextFromHTML "; +" extractURLParameter "; +" extractURLParameterNames "; +" extractURLParameters "; +" farmFingerprint64 "; +" farmHash64 "; +" FETCHES "; +" FETCH PART "; +" FETCH PARTITION "; +" file "; +" filesystemAvailable "; +" filesystemCapacity "; +" filesystemFree "; +" FINAL "; +" finalizeAggregation "; +" FIRST "; +" firstSignificantSubdomain "; +" firstSignificantSubdomainCustom "; +" first_value "; +" FIXED "; +" FixedString "; +" flatten "; +" FLOAT "; +" Float32 "; +" Float64 "; +" floor "; +" FLUSH "; +" FOR "; +" ForEach "; +" format "; +" FORMAT "; +" formatDateTime "; +" formatReadableQuantity "; +" formatReadableDecimalSize "; +" formatReadableSize "; +" formatReadableTimeDelta "; +" formatRow "; +" formatRowNoNewline "; +" FQDN "; +" fragment "; +" FREEZE "; +" FROM "; +" FROM_BASE64 "; +" fromModifiedJulianDay "; +" fromModifiedJulianDayOrNull "; +" FROM_UNIXTIME "; +" fromUnixTimestamp "; +" fromUnixTimestamp64Micro "; +" fromUnixTimestamp64Milli "; +" fromUnixTimestamp64Nano "; +" FULL "; +" fullHostName "; +" FUNCTION "; +" fuzzBits "; +" gccMurmurHash "; +" gcd "; +" generateUUIDv4 "; +" geoDistance "; +" geohashDecode "; +" geohashEncode "; +" geohashesInBox "; +" geoToH3 "; +" geoToS2 "; +" getMacro "; +" __getScalar "; +" getServerPort "; +" getSetting "; +" getSizeOfEnumType "; +" GLOBAL "; +" globalIn "; +" globalInIgnoreSet "; +" globalNotIn "; +" globalNotInIgnoreSet "; +" globalNotNullIn "; +" globalNotNullInIgnoreSet "; +" globalNullIn "; +" globalNullInIgnoreSet "; +" globalVariable "; +" GRANULARITY "; +" greatCircleAngle "; +" greatCircleDistance "; +" greater "; +" greaterOrEquals "; +" greatest "; +" GROUP "; +" groupArray "; +" groupArrayInsertAt "; +" groupArrayMovingAvg "; +" groupArrayMovingSum "; +" groupArraySample "; +" groupBitAnd "; +" groupBitmap "; +" groupBitmapAnd "; +" groupBitmapOr "; +" groupBitmapXor "; +" groupBitOr "; +" groupBitXor "; +" GROUP BY "; +" groupUniqArray "; +" h3EdgeAngle "; +" h3EdgeLengthM "; +" h3GetBaseCell "; +" h3GetFaces "; +" h3GetResolution "; +" h3HexAreaM2 "; +" h3IndexesAreNeighbors "; +" h3IsPentagon "; +" h3IsResClassIII "; +" h3IsValid "; +" h3kRing "; +" h3ToChildren "; +" h3ToGeo "; +" h3ToGeoBoundary "; +" h3ToParent "; +" h3ToString "; +" halfMD5 "; +" has "; +" hasAll "; +" hasAny "; +" hasColumnInTable "; +" hasSubstr "; +" hasThreadFuzzer "; +" hasToken "; +" hasTokenCaseInsensitive "; +" HAVING "; +" hex "; +" HH "; +" HIERARCHICAL "; +" histogram "; +" hiveHash "; +" hostname "; +" hostName "; +" HOUR "; +" hypot "; +" ID "; +" identity "; +" if "; +" IF "; +" IF EXISTS "; +" IF NOT EXISTS "; +" ifNotFinite "; +" ifNull "; +" ignore "; +" ilike "; +" ILIKE "; +" in "; +" IN "; +" INDEX "; +" indexHint "; +" indexOf "; +" INET4 "; +" INET6 "; +" INET6_ATON "; +" INET6_NTOA "; +" INET_ATON "; +" INET_NTOA "; +" INF "; +" inIgnoreSet "; +" initializeAggregation "; +" initial_query_id "; +" initialQueryID "; +" INJECTIVE "; +" INNER "; +" IN PARTITION "; +" INSERT "; +" INSERT INTO "; +" INT "; +" INT1 "; +" Int128 "; +" Int16 "; +" INT1 SIGNED "; +" INT1 UNSIGNED "; +" Int256 "; +" Int32 "; +" Int64 "; +" Int8 "; +" intDiv "; +" intDivOrZero "; +" INTEGER "; +" INTEGER SIGNED "; +" INTEGER UNSIGNED "; +" INTERVAL "; +" IntervalDay "; +" IntervalHour "; +" intervalLengthSum "; +" IntervalMinute "; +" IntervalMonth "; +" IntervalQuarter "; +" IntervalSecond "; +" IntervalWeek "; +" IntervalYear "; +" intExp10 "; +" intExp2 "; +" intHash32 "; +" intHash64 "; +" INTO "; +" INTO OUTFILE "; +" INT SIGNED "; +" INT UNSIGNED "; +" IPv4 "; +" IPv4CIDRToRange "; +" IPv4NumToString "; +" IPv4NumToStringClassC "; +" IPv4StringToNum "; +" IPv4ToIPv6 "; +" IPv6 "; +" IPv6CIDRToRange "; +" IPv6NumToString "; +" IPv6StringToNum "; +" IS "; +" isConstant "; +" isDecimalOverflow "; +" isFinite "; +" isInfinite "; +" isIPAddressInRange "; +" isIPv4String "; +" isIPv6String "; +" isNaN "; +" isNotNull "; +" isNull "; +" IS_OBJECT_ID "; +" isValidJSON "; +" isValidUTF8 "; +" isZeroOrNull "; +" javaHash "; +" javaHashUTF16LE "; +" JOIN "; +" joinGet "; +" joinGetOrNull "; +" JSON_EXISTS "; +" JSONExtract "; +" JSONExtractArrayRaw "; +" JSONExtractBool "; +" JSONExtractFloat "; +" JSONExtractInt "; +" JSONExtractKeysAndValues "; +" JSONExtractKeysAndValuesRaw "; +" JSONExtractKeys "; +" JSONExtractRaw "; +" JSONExtractString "; +" JSONExtractUInt "; +" JSONHas "; +" JSONKey "; +" JSONLength "; +" JSON_QUERY "; +" JSONType "; +" JSON_VALUE "; +" jumpConsistentHash "; +" KEY "; +" KILL "; +" kurtPop "; +" kurtSamp "; +" lagInFrame "; +" LAST "; +" last_value "; +" LAYOUT "; +" lcase "; +" lcm "; +" leadInFrame "; +" LEADING "; +" least "; +" LEFT "; +" LEFT ARRAY JOIN "; +" leftPad "; +" leftPadUTF8 "; +" lemmatize "; +" length "; +" lengthUTF8 "; +" less "; +" lessOrEquals "; +" lgamma "; +" LIFETIME "; +" like "; +" LIKE "; +" LIMIT "; +" LIVE "; +" ln "; +" LOCAL "; +" locate "; +" log "; +" log10 "; +" log1p "; +" log2 "; +" LOGS "; +" logTrace "; +" LONGBLOB "; +" LONGTEXT "; +" LowCardinality "; +" lowCardinalityIndices "; +" lowCardinalityKeys "; +" lower "; +" lowerUTF8 "; +" lpad "; +" LTRIM "; +" M "; +" MACNumToString "; +" MACStringToNum "; +" MACStringToOUI "; +" mannWhitneyUTest "; +" map "; +" Map "; +" mapAdd "; +" mapContains "; +" mapKeys "; +" mapPopulateSeries "; +" mapSubtract "; +" mapValues "; +" match "; +" materialize "; +" MATERIALIZE "; +" MATERIALIZED "; +" MATERIALIZE INDEX "; +" MATERIALIZE TTL "; +" max "; +" MAX "; +" maxIntersections "; +" maxIntersectionsPosition "; +" maxMap "; +" MD4 "; +" MD5 "; +" median "; +" medianBFloat16 "; +" medianBFloat16Weighted "; +" medianDeterministic "; +" medianExact "; +" medianExactHigh "; +" medianExactLow "; +" medianExactWeighted "; +" medianTDigest "; +" medianTDigestWeighted "; +" medianTiming "; +" medianTimingWeighted "; +" MEDIUMBLOB "; +" MEDIUMINT "; +" MEDIUMINT SIGNED "; +" MEDIUMINT UNSIGNED "; +" MEDIUMTEXT "; +" Merge "; +" MERGES "; +" metroHash64 "; +" MI "; +" mid "; +" min "; +" MIN "; +" minMap "; +" minus "; +" MINUTE "; +" MM "; +" mod "; +" MODIFY "; +" MODIFY COLUMN "; +" MODIFY ORDER BY "; +" MODIFY QUERY "; +" MODIFY SETTING "; +" MODIFY TTL "; +" modulo "; +" moduloLegacy "; +" moduloOrZero "; +" MONTH "; +" MOVE "; +" MOVE PART "; +" MOVE PARTITION "; +" movingXXX "; +" multiFuzzyMatchAllIndices "; +" multiFuzzyMatchAny "; +" multiFuzzyMatchAnyIndex "; +" multiIf "; +" multiMatchAllIndices "; +" multiMatchAny "; +" multiMatchAnyIndex "; +" multiply "; +" MultiPolygon "; +" multiSearchAllPositions "; +" multiSearchAllPositionsCaseInsensitive "; +" multiSearchAllPositionsCaseInsensitiveUTF8 "; +" multiSearchAllPositionsUTF8 "; +" multiSearchAny "; +" multiSearchAnyCaseInsensitive "; +" multiSearchAnyCaseInsensitiveUTF8 "; +" multiSearchAnyUTF8 "; +" multiSearchFirstIndex "; +" multiSearchFirstIndexCaseInsensitive "; +" multiSearchFirstIndexCaseInsensitiveUTF8 "; +" multiSearchFirstIndexUTF8 "; +" multiSearchFirstPosition "; +" multiSearchFirstPositionCaseInsensitive "; +" multiSearchFirstPositionCaseInsensitiveUTF8 "; +" multiSearchFirstPositionUTF8 "; +" murmurHash2_32 "; +" murmurHash2_64 "; +" murmurHash3_128 "; +" murmurHash3_32 "; +" murmurHash3_64 "; +" MUTATION "; +" N "; +" NAME "; +" NAN_SQL "; +" NATIONAL CHAR "; +" NATIONAL CHARACTER "; +" NATIONAL CHARACTER LARGE OBJECT "; +" NATIONAL CHARACTER VARYING "; +" NATIONAL CHAR VARYING "; +" NCHAR "; +" NCHAR LARGE OBJECT "; +" NCHAR VARYING "; +" negate "; +" neighbor "; +" Nested "; +" netloc "; +" ngramDistance "; +" ngramDistanceCaseInsensitive "; +" ngramDistanceCaseInsensitiveUTF8 "; +" ngramDistanceUTF8 "; +" ngramMinHash "; +" ngramMinHashArg "; +" ngramMinHashArgCaseInsensitive "; +" ngramMinHashArgCaseInsensitiveUTF8 "; +" ngramMinHashArgUTF8 "; +" ngramMinHashCaseInsensitive "; +" ngramMinHashCaseInsensitiveUTF8 "; +" ngramMinHashUTF8 "; +" ngramSearch "; +" ngramSearchCaseInsensitive "; +" ngramSearchCaseInsensitiveUTF8 "; +" ngramSearchUTF8 "; +" ngramSimHash "; +" ngramSimHashCaseInsensitive "; +" ngramSimHashCaseInsensitiveUTF8 "; +" ngramSimHashUTF8 "; +" NO "; +" NO DELAY "; +" NONE "; +" normalizedQueryHash "; +" normalizedQueryHashKeepNames "; +" normalizeQuery "; +" normalizeQueryKeepNames "; +" not "; +" NOT "; +" notEmpty "; +" notEquals "; +" nothing "; +" Nothing "; +" notILike "; +" notIn "; +" notInIgnoreSet "; +" notLike "; +" notNullIn "; +" notNullInIgnoreSet "; +" now "; +" now64 "; +" Null "; +" Nullable "; +" nullIf "; +" nullIn "; +" nullInIgnoreSet "; +" NULLS "; +" NULL_SQL "; +" NUMERIC "; +" NVARCHAR "; +" OFFSET "; +" ON "; +" ONLY "; +" OPTIMIZE "; +" OPTIMIZE TABLE "; +" or "; +" OR "; +" ORDER "; +" ORDER BY "; +" OR REPLACE "; +" OUTER "; +" OUTFILE "; +" parseDateTime32BestEffort "; +" parseDateTime32BestEffortOrNull "; +" parseDateTime32BestEffortOrZero "; +" parseDateTime64BestEffort "; +" parseDateTime64BestEffortOrNull "; +" parseDateTime64BestEffortOrZero "; +" parseDateTimeBestEffort "; +" parseDateTimeBestEffortOrNull "; +" parseDateTimeBestEffortOrZero "; +" parseDateTimeBestEffortUS "; +" parseDateTimeBestEffortUSOrNull "; +" parseDateTimeBestEffortUSOrZero "; +" parseTimeDelta "; +" PARTITION "; +" PARTITION BY "; +" partitionId "; +" path "; +" pathFull "; +" pi "; +" plus "; +" Point "; +" pointInEllipses "; +" pointInPolygon "; +" Polygon "; +" polygonAreaCartesian "; +" polygonAreaSpherical "; +" polygonConvexHullCartesian "; +" polygonPerimeterCartesian "; +" polygonPerimeterSpherical "; +" polygonsDistanceCartesian "; +" polygonsDistanceSpherical "; +" polygonsEqualsCartesian "; +" polygonsIntersectionCartesian "; +" polygonsIntersectionSpherical "; +" polygonsSymDifferenceCartesian "; +" polygonsSymDifferenceSpherical "; +" polygonsUnionCartesian "; +" polygonsUnionSpherical "; +" polygonsWithinCartesian "; +" polygonsWithinSpherical "; +" POPULATE "; +" port "; +" position "; +" positionCaseInsensitive "; +" positionCaseInsensitiveUTF8 "; +" positionUTF8 "; +" pow "; +" power "; +" PREWHERE "; +" PRIMARY "; +" PRIMARY KEY "; +" PROJECTION "; +" protocol "; +" Q "; +" QQ "; +" quantile "; +" quantileBFloat16 "; +" quantileBFloat16Weighted "; +" quantileDeterministic "; +" quantileExact "; +" quantileExactExclusive "; +" quantileExactHigh "; +" quantileExactInclusive "; +" quantileExactLow "; +" quantileExactWeighted "; +" quantiles "; +" quantilesBFloat16 "; +" quantilesBFloat16Weighted "; +" quantilesDeterministic "; +" quantilesExact "; +" quantilesExactExclusive "; +" quantilesExactHigh "; +" quantilesExactInclusive "; +" quantilesExactLow "; +" quantilesExactWeighted "; +" quantilesTDigest "; +" quantilesTDigestWeighted "; +" quantilesTiming "; +" quantilesTimingWeighted "; +" quantileTDigest "; +" quantileTDigestWeighted "; +" quantileTiming "; +" quantileTimingWeighted "; +" QUARTER "; +" query_id "; +" queryID "; +" queryString "; +" queryStringAndFragment "; +" rand "; +" rand32 "; +" rand64 "; +" randConstant "; +" randomFixedString "; +" randomPrintableASCII "; +" randomString "; +" randomStringUTF8 "; +" range "; +" RANGE "; +" rank "; +" rankCorr "; +" readWKTMultiPolygon "; +" readWKTPoint "; +" readWKTPolygon "; +" readWKTRing "; +" REAL "; +" REFRESH "; +" regexpQuoteMeta "; +" regionHierarchy "; +" regionIn "; +" regionToArea "; +" regionToCity "; +" regionToContinent "; +" regionToCountry "; +" regionToDistrict "; +" regionToName "; +" regionToPopulation "; +" regionToTopContinent "; +" reinterpret "; +" reinterpretAsDate "; +" reinterpretAsDateTime "; +" reinterpretAsFixedString "; +" reinterpretAsFloat32 "; +" reinterpretAsFloat64 "; +" reinterpretAsInt128 "; +" reinterpretAsInt16 "; +" reinterpretAsInt256 "; +" reinterpretAsInt32 "; +" reinterpretAsInt64 "; +" reinterpretAsInt8 "; +" reinterpretAsString "; +" reinterpretAsUInt128 "; +" reinterpretAsUInt16 "; +" reinterpretAsUInt256 "; +" reinterpretAsUInt32 "; +" reinterpretAsUInt64 "; +" reinterpretAsUInt8 "; +" reinterpretAsUUID "; +" RELOAD "; +" REMOVE "; +" RENAME "; +" RENAME COLUMN "; +" RENAME TABLE "; +" repeat "; +" replace "; +" REPLACE "; +" replaceAll "; +" replaceOne "; +" REPLACE PARTITION "; +" replaceRegexpAll "; +" replaceRegexpOne "; +" REPLICA "; +" replicate "; +" REPLICATED "; +" Resample "; +" RESUME "; +" retention "; +" reverse "; +" reverseUTF8 "; +" RIGHT "; +" rightPad "; +" rightPadUTF8 "; +" Ring "; +" ROLLUP "; +" round "; +" roundAge "; +" roundBankers "; +" roundDown "; +" roundDuration "; +" roundToExp2 "; +" row_number "; +" rowNumberInAllBlocks "; +" rowNumberInBlock "; +" rpad "; +" RTRIM "; +" runningAccumulate "; +" runningConcurrency "; +" runningDifference "; +" runningDifferenceStartingWithFirstValue "; +" S "; +" s2CapContains "; +" s2CapUnion "; +" s2CellsIntersect "; +" s2GetNeighbors "; +" s2RectAdd "; +" s2RectContains "; +" s2RectIntersection "; +" s2RectUnion "; +" s2ToGeo "; +" SAMPLE "; +" SAMPLE BY "; +" SECOND "; +" SELECT "; +" SEMI "; +" SENDS "; +" sequenceCount "; +" sequenceMatch "; +" sequenceNextNode "; +" serverUUID "; +" SET "; +" SETTINGS "; +" SHA1 "; +" SHA224 "; +" SHA256 "; +" SHA384 "; +" SHA512 "; +" shardCount "; +" shardNum "; +" SHOW "; +" SHOW PROCESSLIST "; +" sigmoid "; +" sign "; +" SimpleAggregateFunction "; +" simpleJSONExtractBool "; +" simpleJSONExtractFloat "; +" simpleJSONExtractInt "; +" simpleJSONExtractRaw "; +" simpleJSONExtractString "; +" simpleJSONExtractUInt "; +" simpleJSONHas "; +" simpleLinearRegression "; +" sin "; +" SINGLE "; +" singleValueOrNull "; +" sinh "; +" sipHash128 "; +" sipHash64 "; +" skewPop "; +" skewSamp "; +" sleep "; +" sleepEachRow "; +" SMALLINT "; +" SMALLINT SIGNED "; +" SMALLINT UNSIGNED "; +" snowflakeToDateTime "; +" snowflakeToDateTime64 "; +" SOURCE "; +" sparkbar "; +" splitByChar "; +" splitByNonAlpha "; +" splitByRegexp "; +" splitByString "; +" splitByWhitespace "; +" SQL_TSI_DAY "; +" SQL_TSI_HOUR "; +" SQL_TSI_MINUTE "; +" SQL_TSI_MONTH "; +" SQL_TSI_QUARTER "; +" SQL_TSI_SECOND "; +" SQL_TSI_WEEK "; +" SQL_TSI_YEAR "; +" sqrt "; +" SS "; +" START "; +" startsWith "; +" State "; +" stddevPop "; +" STDDEV_POP "; +" stddevPopStable "; +" stddevSamp "; +" STDDEV_SAMP "; +" stddevSampStable "; +" stem "; +" STEP "; +" stochasticLinearRegression "; +" stochasticLogisticRegression "; +" STOP "; +" String "; +" stringToH3 "; +" studentTTest "; +" subBitmap "; +" substr "; +" substring "; +" SUBSTRING "; +" substringUTF8 "; +" subtractDays "; +" subtractHours "; +" subtractMinutes "; +" subtractMonths "; +" subtractQuarters "; +" subtractSeconds "; +" subtractWeeks "; +" subtractYears "; +" sum "; +" sumCount "; +" sumKahan "; +" sumMap "; +" sumMapFiltered "; +" sumMapFilteredWithOverflow "; +" sumMapWithOverflow "; +" sumWithOverflow "; +" SUSPEND "; +" svg "; +" SVG "; +" SYNC "; +" synonyms "; +" SYNTAX "; +" SYSTEM "; +" TABLE "; +" TABLES "; +" tan "; +" tanh "; +" tcpPort "; +" TEMPORARY "; +" TEST "; +" TEXT "; +" tgamma "; +" THEN "; +" throwIf "; +" tid "; +" TIES "; +" TIMEOUT "; +" timeSlot "; +" timeSlots "; +" TIMESTAMP "; +" TIMESTAMP_ADD "; +" TIMESTAMPADD "; +" TIMESTAMP_DIFF "; +" TIMESTAMPDIFF "; +" TIMESTAMP_SUB "; +" TIMESTAMPSUB "; +" timezone "; +" timeZone "; +" timezoneOf "; +" timeZoneOf "; +" timezoneOffset "; +" timeZoneOffset "; +" TINYBLOB "; +" TINYINT "; +" TINYINT SIGNED "; +" TINYINT UNSIGNED "; +" TINYTEXT "; +" TO "; +" TO_BASE64 "; +" toColumnTypeName "; +" toDate "; +" toDate32 "; +" toDate32OrNull "; +" toDate32OrZero "; +" toDateOrNull "; +" toDateOrZero "; +" toDateTime "; +" toDateTime32 "; +" toDateTime64 "; +" toDateTime64OrNull "; +" toDateTime64OrZero "; +" toDateTimeOrNull "; +" toDateTimeOrZero "; +" today "; +" toDayOfMonth "; +" toDayOfWeek "; +" toDayOfYear "; +" toDecimal128 "; +" toDecimal128OrNull "; +" toDecimal128OrZero "; +" toDecimal256 "; +" toDecimal256OrNull "; +" toDecimal256OrZero "; +" toDecimal32 "; +" toDecimal32OrNull "; +" toDecimal32OrZero "; +" toDecimal64 "; +" toDecimal64OrNull "; +" toDecimal64OrZero "; +" TO DISK "; +" toFixedString "; +" toFloat32 "; +" toFloat32OrNull "; +" toFloat32OrZero "; +" toFloat64 "; +" toFloat64OrNull "; +" toFloat64OrZero "; +" toHour "; +" toInt128 "; +" toInt128OrNull "; +" toInt128OrZero "; +" toInt16 "; +" toInt16OrNull "; +" toInt16OrZero "; +" toInt256 "; +" toInt256OrNull "; +" toInt256OrZero "; +" toInt32 "; +" toInt32OrNull "; +" toInt32OrZero "; +" toInt64 "; +" toInt64OrNull "; +" toInt64OrZero "; +" toInt8 "; +" toInt8OrNull "; +" toInt8OrZero "; +" toIntervalDay "; +" toIntervalHour "; +" toIntervalMinute "; +" toIntervalMonth "; +" toIntervalQuarter "; +" toIntervalSecond "; +" toIntervalWeek "; +" toIntervalYear "; +" toIPv4 "; +" toIPv6 "; +" toISOWeek "; +" toISOYear "; +" toJSONString "; +" toLowCardinality "; +" toMinute "; +" toModifiedJulianDay "; +" toModifiedJulianDayOrNull "; +" toMonday "; +" toMonth "; +" toNullable "; +" TOP "; +" topK "; +" topKWeighted "; +" topLevelDomain "; +" toQuarter "; +" toRelativeDayNum "; +" toRelativeHourNum "; +" toRelativeMinuteNum "; +" toRelativeMonthNum "; +" toRelativeQuarterNum "; +" toRelativeSecondNum "; +" toRelativeWeekNum "; +" toRelativeYearNum "; +" toSecond "; +" toStartOfDay "; +" toStartOfFifteenMinutes "; +" toStartOfFiveMinutes "; +" toStartOfHour "; +" toStartOfInterval "; +" toStartOfISOYear "; +" toStartOfMinute "; +" toStartOfMonth "; +" toStartOfQuarter "; +" toStartOfSecond "; +" toStartOfTenMinutes "; +" toStartOfWeek "; +" toStartOfYear "; +" toString "; +" toStringCutToZero "; +" TO TABLE "; +" TOTALS "; +" toTime "; +" toTimezone "; +" toTimeZone "; +" toTypeName "; +" toUInt128 "; +" toUInt128OrNull "; +" toUInt128OrZero "; +" toUInt16 "; +" toUInt16OrNull "; +" toUInt16OrZero "; +" toUInt256 "; +" toUInt256OrNull "; +" toUInt256OrZero "; +" toUInt32 "; +" toUInt32OrNull "; +" toUInt32OrZero "; +" toUInt64 "; +" toUInt64OrNull "; +" toUInt64OrZero "; +" toUInt8 "; +" toUInt8OrNull "; +" toUInt8OrZero "; +" toUnixTimestamp "; +" toUnixTimestamp64Micro "; +" toUnixTimestamp64Milli "; +" toUnixTimestamp64Nano "; +" toUUID "; +" toUUIDOrNull "; +" toUUIDOrZero "; +" toValidUTF8 "; +" TO VOLUME "; +" toWeek "; +" toYear "; +" toYearWeek "; +" toYYYYMM "; +" toYYYYMMDD "; +" toYYYYMMDDhhmmss "; +" TRAILING "; +" transform "; +" TRIM "; +" trimBoth "; +" trimLeft "; +" trimRight "; +" trunc "; +" truncate "; +" TRUNCATE "; +" tryBase64Decode "; +" TTL "; +" tuple "; +" Tuple "; +" tupleElement "; +" tupleHammingDistance "; +" tupleToNameValuePairs "; +" TYPE "; +" ucase "; +" UInt128 "; +" UInt16 "; +" UInt256 "; +" UInt32 "; +" UInt64 "; +" UInt8 "; +" unbin "; +" unhex "; +" UNION "; +" uniq "; +" uniqCombined "; +" uniqCombined64 "; +" uniqExact "; +" uniqHLL12 "; +" uniqTheta "; +" uniqUpTo "; +" UPDATE "; +" upper "; +" upperUTF8 "; +" uptime "; +" URLHash "; +" URLHierarchy "; +" URLPathHierarchy "; +" USE "; +" user "; +" USING "; +" UUID "; +" UUIDNumToString "; +" UUIDStringToNum "; +" validateNestedArraySizes "; +" VALUES "; +" VARCHAR "; +" VARCHAR2 "; +" varPop "; +" VAR_POP "; +" varPopStable "; +" varSamp "; +" VAR_SAMP "; +" varSampStable "; +" version "; +" VIEW "; +" visibleWidth "; +" visitParamExtractBool "; +" visitParamExtractFloat "; +" visitParamExtractInt "; +" visitParamExtractRaw "; +" visitParamExtractString "; +" visitParamExtractUInt "; +" visitParamHas "; +" VOLUME "; +" WATCH "; +" week "; +" WEEK "; +" welchTTest "; +" WHEN "; +" WHERE "; +" windowFunnel "; +" WITH "; +" WITH FILL "; +" WITH TIES "; +" WK "; +" wkt "; +" wordShingleMinHash "; +" wordShingleMinHashArg "; +" wordShingleMinHashArgCaseInsensitive "; +" wordShingleMinHashArgCaseInsensitiveUTF8 "; +" wordShingleMinHashArgUTF8 "; +" wordShingleMinHashCaseInsensitive "; +" wordShingleMinHashCaseInsensitiveUTF8 "; +" wordShingleMinHashUTF8 "; +" wordShingleSimHash "; +" wordShingleSimHashCaseInsensitive "; +" wordShingleSimHashCaseInsensitiveUTF8 "; +" wordShingleSimHashUTF8 "; +" WW "; +" xor "; +" xxHash32 "; +" xxHash64 "; +" kostikConsistentHash "; +" YEAR "; +" yearweek "; +" yesterday "; +" YY "; +" YYYY "; +" zookeeperSessionUptime "; diff --git a/src/Parsers/fuzzers/codegen_fuzzer/out.cpp b/src/Parsers/fuzzers/codegen_fuzzer/out.cpp new file mode 100644 index 00000000000..29168751d71 --- /dev/null +++ b/src/Parsers/fuzzers/codegen_fuzzer/out.cpp @@ -0,0 +1,6461 @@ +#include +#include +#include + +#include + +#include "out.pb.h" + +void GenerateWord(const Word&, std::string&, int); + +void GenerateSentence(const Sentence& stc, std::string &s, int depth) { + for (int i = 0; i < stc.words_size(); i++ ) { + GenerateWord(stc.words(i), s, ++depth); + } +} +void GenerateWord(const Word& word, std::string &s, int depth) { + if (depth > 5) return; + + switch (word.value()) { + case 0: { + s += " "; + break; + } + case 1: { + s += " "; + break; + } + case 2: { + s += " "; + break; + } + case 3: { + s += ";"; + break; + } + case 4: { + s += "("; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ")"; + break; + } + case 5: { + s += "("; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ")"; + break; + } + case 6: { + s += "("; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ")"; + break; + } + case 7: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + break; + } + case 8: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 9: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ", "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + break; + } + case 10: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ", "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + s += ", "; + if (word.inner().words_size() > 4) GenerateWord(word.inner().words(4), s, ++depth); + break; + } + case 11: { + s += "["; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += "]"; + break; + } + case 12: { + s += "["; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += "]"; + break; + } + case 13: { + s += "["; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ", "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + s += "]"; + break; + } + case 14: { + s += "["; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ", "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ", "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + s += ", "; + if (word.inner().words_size() > 4) GenerateWord(word.inner().words(4), s, ++depth); + s += "]"; + break; + } + case 15: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += "("; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ")"; + break; + } + case 16: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += "("; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ")"; + break; + } + case 17: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += "("; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += ", "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += ", "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + s += ")"; + break; + } + case 18: { + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " as "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + break; + } + case 19: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " WHERE "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 20: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " GROUP BY "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 21: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " SORT BY "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 22: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " LIMIT "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 23: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " JOIN "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 24: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " ARRAY JOIN "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + break; + } + case 25: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " JOIN "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += " ON "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + break; + } + case 26: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " FROM "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += " JOIN "; + if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); + s += " USING "; + if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); + break; + } + case 27: { + s += "SELECT "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " INTO OUTFILE "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + break; + } + case 28: { + s += "WITH "; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += " AS "; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + break; + } + case 29: { + s += "{"; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ":"; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += "}"; + break; + } + case 30: { + s += "["; + if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); + s += ","; + if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); + s += "]"; + break; + } + case 31: { + s += "[]"; + break; + } + case 32: { + s += " x "; + break; + } + case 33: { + s += "x"; + break; + } + case 34: { + s += " `x` "; + break; + } + case 35: { + s += "`x`"; + break; + } + case 36: { + s += " \"value\" "; + break; + } + case 37: { + s += "\"value\""; + break; + } + case 38: { + s += " 0 "; + break; + } + case 39: { + s += "0"; + break; + } + case 40: { + s += "1"; + break; + } + case 41: { + s += "2"; + break; + } + case 42: { + s += "123123123123123123"; + break; + } + case 43: { + s += "182374019873401982734091873420923123123123123123"; + break; + } + case 44: { + s += "1e-1"; + break; + } + case 45: { + s += "1.1"; + break; + } + case 46: { + s += "\"\""; + break; + } + case 47: { + s += " '../../../../../../../../../etc/passwd' "; + break; + } + case 48: { + s += "/"; + break; + } + case 49: { + s += "="; + break; + } + case 50: { + s += "=="; + break; + } + case 51: { + s += "!="; + break; + } + case 52: { + s += "<>"; + break; + } + case 53: { + s += "<"; + break; + } + case 54: { + s += "<="; + break; + } + case 55: { + s += ">"; + break; + } + case 56: { + s += ">="; + break; + } + case 57: { + s += "<<"; + break; + } + case 58: { + s += "|<<"; + break; + } + case 59: { + s += "&"; + break; + } + case 60: { + s += "|"; + break; + } + case 61: { + s += "||"; + break; + } + case 62: { + s += "<|"; + break; + } + case 63: { + s += "|>"; + break; + } + case 64: { + s += "+"; + break; + } + case 65: { + s += "-"; + break; + } + case 66: { + s += "~"; + break; + } + case 67: { + s += "*"; + break; + } + case 68: { + s += "/"; + break; + } + case 69: { + s += "\\"; + break; + } + case 70: { + s += "%"; + break; + } + case 71: { + s += ""; + break; + } + case 72: { + s += "."; + break; + } + case 73: { + s += ","; + break; + } + case 74: { + s += ","; + break; + } + case 75: { + s += ","; + break; + } + case 76: { + s += ","; + break; + } + case 77: { + s += ","; + break; + } + case 78: { + s += ","; + break; + } + case 79: { + s += "("; + break; + } + case 80: { + s += ")"; + break; + } + case 81: { + s += "("; + break; + } + case 82: { + s += ")"; + break; + } + case 83: { + s += "("; + break; + } + case 84: { + s += ")"; + break; + } + case 85: { + s += "("; + break; + } + case 86: { + s += ")"; + break; + } + case 87: { + s += "("; + break; + } + case 88: { + s += ")"; + break; + } + case 89: { + s += "("; + break; + } + case 90: { + s += ")"; + break; + } + case 91: { + s += "?"; + break; + } + case 92: { + s += ":"; + break; + } + case 93: { + s += "@"; + break; + } + case 94: { + s += "@@"; + break; + } + case 95: { + s += "$"; + break; + } + case 96: { + s += "\""; + break; + } + case 97: { + s += "`"; + break; + } + case 98: { + s += "{"; + break; + } + case 99: { + s += "}"; + break; + } + case 100: { + s += "^"; + break; + } + case 101: { + s += "::"; + break; + } + case 102: { + s += "->"; + break; + } + case 103: { + s += "]"; + break; + } + case 104: { + s += "["; + break; + } + case 105: { + s += " abs "; + break; + } + case 106: { + s += " accurate_Cast "; + break; + } + case 107: { + s += " accurateCast "; + break; + } + case 108: { + s += " accurate_CastOrNull "; + break; + } + case 109: { + s += " accurateCastOrNull "; + break; + } + case 110: { + s += " acos "; + break; + } + case 111: { + s += " acosh "; + break; + } + case 112: { + s += " ADD "; + break; + } + case 113: { + s += " ADD COLUMN "; + break; + } + case 114: { + s += " ADD CONSTRAINT "; + break; + } + case 115: { + s += " addDays "; + break; + } + case 116: { + s += " addHours "; + break; + } + case 117: { + s += " ADD INDEX "; + break; + } + case 118: { + s += " addMinutes "; + break; + } + case 119: { + s += " addMonths "; + break; + } + case 120: { + s += " addQuarters "; + break; + } + case 121: { + s += " addressToLine "; + break; + } + case 122: { + s += " addressToSymbol "; + break; + } + case 123: { + s += " addSeconds "; + break; + } + case 124: { + s += " addWeeks "; + break; + } + case 125: { + s += " addYears "; + break; + } + case 126: { + s += " aes_decrypt_mysql "; + break; + } + case 127: { + s += " aes_encrypt_mysql "; + break; + } + case 128: { + s += " AFTER "; + break; + } + case 129: { + s += " AggregateFunction "; + break; + } + case 130: { + s += " aggThrow "; + break; + } + case 131: { + s += " ALIAS "; + break; + } + case 132: { + s += " ALL "; + break; + } + case 133: { + s += " alphaTokens "; + break; + } + case 134: { + s += " ALTER "; + break; + } + case 135: { + s += " ALTER LIVE VIEW "; + break; + } + case 136: { + s += " ALTER TABLE "; + break; + } + case 137: { + s += " and "; + break; + } + case 138: { + s += " AND "; + break; + } + case 139: { + s += " ANTI "; + break; + } + case 140: { + s += " any "; + break; + } + case 141: { + s += " ANY "; + break; + } + case 142: { + s += " anyHeavy "; + break; + } + case 143: { + s += " anyLast "; + break; + } + case 144: { + s += " appendTrailingCharIfAbsent "; + break; + } + case 145: { + s += " argMax "; + break; + } + case 146: { + s += " argMin "; + break; + } + case 147: { + s += " array "; + break; + } + case 148: { + s += " Array "; + break; + } + case 149: { + s += " ARRAY "; + break; + } + case 150: { + s += " arrayAll "; + break; + } + case 151: { + s += " arrayAUC "; + break; + } + case 152: { + s += " arrayAvg "; + break; + } + case 153: { + s += " arrayCompact "; + break; + } + case 154: { + s += " arrayConcat "; + break; + } + case 155: { + s += " arrayCount "; + break; + } + case 156: { + s += " arrayCumSum "; + break; + } + case 157: { + s += " arrayCumSumNonNegative "; + break; + } + case 158: { + s += " arrayDifference "; + break; + } + case 159: { + s += " arrayDistinct "; + break; + } + case 160: { + s += " arrayElement "; + break; + } + case 161: { + s += " arrayEnumerate "; + break; + } + case 162: { + s += " arrayEnumerateDense "; + break; + } + case 163: { + s += " arrayEnumerateDenseRanked "; + break; + } + case 164: { + s += " arrayEnumerateUniq "; + break; + } + case 165: { + s += " arrayEnumerateUniqRanked "; + break; + } + case 166: { + s += " arrayExists "; + break; + } + case 167: { + s += " arrayFill "; + break; + } + case 168: { + s += " arrayFilter "; + break; + } + case 169: { + s += " arrayFirst "; + break; + } + case 170: { + s += " arrayFirstIndex "; + break; + } + case 171: { + s += " arrayFlatten "; + break; + } + case 172: { + s += " arrayIntersect "; + break; + } + case 173: { + s += " arrayJoin "; + break; + } + case 174: { + s += " ARRAY JOIN "; + break; + } + case 175: { + s += " arrayMap "; + break; + } + case 176: { + s += " arrayMax "; + break; + } + case 177: { + s += " arrayMin "; + break; + } + case 178: { + s += " arrayPartialReverseSort "; + break; + } + case 179: { + s += " arrayPartialShuffle "; + break; + } + case 180: { + s += " arrayPartialSort "; + break; + } + case 181: { + s += " arrayPopBack "; + break; + } + case 182: { + s += " arrayPopFront "; + break; + } + case 183: { + s += " arrayProduct "; + break; + } + case 184: { + s += " arrayPushBack "; + break; + } + case 185: { + s += " arrayPushFront "; + break; + } + case 186: { + s += " arrayReduce "; + break; + } + case 187: { + s += " arrayReduceInRanges "; + break; + } + case 188: { + s += " arrayResize "; + break; + } + case 189: { + s += " arrayReverse "; + break; + } + case 190: { + s += " arrayReverseFill "; + break; + } + case 191: { + s += " arrayReverseSort "; + break; + } + case 192: { + s += " arrayReverseSplit "; + break; + } + case 193: { + s += " arrayShuffle "; + break; + } + case 194: { + s += " arraySlice "; + break; + } + case 195: { + s += " arraySort "; + break; + } + case 196: { + s += " arraySplit "; + break; + } + case 197: { + s += " arrayStringConcat "; + break; + } + case 198: { + s += " arraySum "; + break; + } + case 199: { + s += " arrayUniq "; + break; + } + case 200: { + s += " arrayWithConstant "; + break; + } + case 201: { + s += " arrayZip "; + break; + } + case 202: { + s += " AS "; + break; + } + case 203: { + s += " ASC "; + break; + } + case 204: { + s += " ASCENDING "; + break; + } + case 205: { + s += " asin "; + break; + } + case 206: { + s += " asinh "; + break; + } + case 207: { + s += " ASOF "; + break; + } + case 208: { + s += " assumeNotNull "; + break; + } + case 209: { + s += " AST "; + break; + } + case 210: { + s += " ASYNC "; + break; + } + case 211: { + s += " atan "; + break; + } + case 212: { + s += " atan2 "; + break; + } + case 213: { + s += " atanh "; + break; + } + case 214: { + s += " ATTACH "; + break; + } + case 215: { + s += " ATTACH PART "; + break; + } + case 216: { + s += " ATTACH PARTITION "; + break; + } + case 217: { + s += " avg "; + break; + } + case 218: { + s += " avgWeighted "; + break; + } + case 219: { + s += " bar "; + break; + } + case 220: { + s += " base64Decode "; + break; + } + case 221: { + s += " base64Encode "; + break; + } + case 222: { + s += " basename "; + break; + } + case 223: { + s += " bayesAB "; + break; + } + case 224: { + s += " BETWEEN "; + break; + } + case 225: { + s += " BIGINT "; + break; + } + case 226: { + s += " BIGINT SIGNED "; + break; + } + case 227: { + s += " BIGINT UNSIGNED "; + break; + } + case 228: { + s += " bin "; + break; + } + case 229: { + s += " BINARY "; + break; + } + case 230: { + s += " BINARY LARGE OBJECT "; + break; + } + case 231: { + s += " BINARY VARYING "; + break; + } + case 232: { + s += " bitAnd "; + break; + } + case 233: { + s += " BIT_AND "; + break; + } + case 234: { + s += " __bitBoolMaskAnd "; + break; + } + case 235: { + s += " __bitBoolMaskOr "; + break; + } + case 236: { + s += " bitCount "; + break; + } + case 237: { + s += " bitHammingDistance "; + break; + } + case 238: { + s += " bitmapAnd "; + break; + } + case 239: { + s += " bitmapAndCardinality "; + break; + } + case 240: { + s += " bitmapAndnot "; + break; + } + case 241: { + s += " bitmapAndnotCardinality "; + break; + } + case 242: { + s += " bitmapBuild "; + break; + } + case 243: { + s += " bitmapCardinality "; + break; + } + case 244: { + s += " bitmapContains "; + break; + } + case 245: { + s += " bitmapHasAll "; + break; + } + case 246: { + s += " bitmapHasAny "; + break; + } + case 247: { + s += " bitmapMax "; + break; + } + case 248: { + s += " bitmapMin "; + break; + } + case 249: { + s += " bitmapOr "; + break; + } + case 250: { + s += " bitmapOrCardinality "; + break; + } + case 251: { + s += " bitmapSubsetInRange "; + break; + } + case 252: { + s += " bitmapSubsetLimit "; + break; + } + case 253: { + s += " bitmapToArray "; + break; + } + case 254: { + s += " bitmapTransform "; + break; + } + case 255: { + s += " bitmapXor "; + break; + } + case 256: { + s += " bitmapXorCardinality "; + break; + } + case 257: { + s += " bitmaskToArray "; + break; + } + case 258: { + s += " bitmaskToList "; + break; + } + case 259: { + s += " bitNot "; + break; + } + case 260: { + s += " bitOr "; + break; + } + case 261: { + s += " BIT_OR "; + break; + } + case 262: { + s += " bitPositionsToArray "; + break; + } + case 263: { + s += " bitRotateLeft "; + break; + } + case 264: { + s += " bitRotateRight "; + break; + } + case 265: { + s += " bitShiftLeft "; + break; + } + case 266: { + s += " bitShiftRight "; + break; + } + case 267: { + s += " __bitSwapLastTwo "; + break; + } + case 268: { + s += " bitTest "; + break; + } + case 269: { + s += " bitTestAll "; + break; + } + case 270: { + s += " bitTestAny "; + break; + } + case 271: { + s += " __bitWrapperFunc "; + break; + } + case 272: { + s += " bitXor "; + break; + } + case 273: { + s += " BIT_XOR "; + break; + } + case 274: { + s += " BLOB "; + break; + } + case 275: { + s += " blockNumber "; + break; + } + case 276: { + s += " blockSerializedSize "; + break; + } + case 277: { + s += " blockSize "; + break; + } + case 278: { + s += " BOOL "; + break; + } + case 279: { + s += " BOOLEAN "; + break; + } + case 280: { + s += " BOTH "; + break; + } + case 281: { + s += " boundingRatio "; + break; + } + case 282: { + s += " buildId "; + break; + } + case 283: { + s += " BY "; + break; + } + case 284: { + s += " BYTE "; + break; + } + case 285: { + s += " BYTEA "; + break; + } + case 286: { + s += " byteSize "; + break; + } + case 287: { + s += " CASE "; + break; + } + case 288: { + s += " caseWithExpr "; + break; + } + case 289: { + s += " caseWithExpression "; + break; + } + case 290: { + s += " caseWithoutExpr "; + break; + } + case 291: { + s += " caseWithoutExpression "; + break; + } + case 292: { + s += " _CAST "; + break; + } + case 293: { + s += " CAST "; + break; + } + case 294: { + s += " categoricalInformationValue "; + break; + } + case 295: { + s += " cbrt "; + break; + } + case 296: { + s += " ceil "; + break; + } + case 297: { + s += " ceiling "; + break; + } + case 298: { + s += " char "; + break; + } + case 299: { + s += " CHAR "; + break; + } + case 300: { + s += " CHARACTER "; + break; + } + case 301: { + s += " CHARACTER LARGE OBJECT "; + break; + } + case 302: { + s += " CHARACTER_LENGTH "; + break; + } + case 303: { + s += " CHARACTER VARYING "; + break; + } + case 304: { + s += " CHAR LARGE OBJECT "; + break; + } + case 305: { + s += " CHAR_LENGTH "; + break; + } + case 306: { + s += " CHAR VARYING "; + break; + } + case 307: { + s += " CHECK "; + break; + } + case 308: { + s += " CHECK TABLE "; + break; + } + case 309: { + s += " cityHash64 "; + break; + } + case 310: { + s += " CLEAR "; + break; + } + case 311: { + s += " CLEAR COLUMN "; + break; + } + case 312: { + s += " CLEAR INDEX "; + break; + } + case 313: { + s += " CLOB "; + break; + } + case 314: { + s += " CLUSTER "; + break; + } + case 315: { + s += " coalesce "; + break; + } + case 316: { + s += " CODEC "; + break; + } + case 317: { + s += " COLLATE "; + break; + } + case 318: { + s += " COLUMN "; + break; + } + case 319: { + s += " COLUMNS "; + break; + } + case 320: { + s += " COMMENT "; + break; + } + case 321: { + s += " COMMENT COLUMN "; + break; + } + case 322: { + s += " concat "; + break; + } + case 323: { + s += " concatAssumeInjective "; + break; + } + case 324: { + s += " connection_id "; + break; + } + case 325: { + s += " connectionid "; + break; + } + case 326: { + s += " connectionId "; + break; + } + case 327: { + s += " CONSTRAINT "; + break; + } + case 328: { + s += " convertCharset "; + break; + } + case 329: { + s += " corr "; + break; + } + case 330: { + s += " corrStable "; + break; + } + case 331: { + s += " cos "; + break; + } + case 332: { + s += " cosh "; + break; + } + case 333: { + s += " count "; + break; + } + case 334: { + s += " countDigits "; + break; + } + case 335: { + s += " countEqual "; + break; + } + case 336: { + s += " countMatches "; + break; + } + case 337: { + s += " countMatchesCaseInsensitive "; + break; + } + case 338: { + s += " countSubstrings "; + break; + } + case 339: { + s += " countSubstringsCaseInsensitive "; + break; + } + case 340: { + s += " countSubstringsCaseInsensitiveUTF8 "; + break; + } + case 341: { + s += " covarPop "; + break; + } + case 342: { + s += " COVAR_POP "; + break; + } + case 343: { + s += " covarPopStable "; + break; + } + case 344: { + s += " covarSamp "; + break; + } + case 345: { + s += " COVAR_SAMP "; + break; + } + case 346: { + s += " covarSampStable "; + break; + } + case 347: { + s += " CRC32 "; + break; + } + case 348: { + s += " CRC32IEEE "; + break; + } + case 349: { + s += " CRC64 "; + break; + } + case 350: { + s += " CREATE "; + break; + } + case 351: { + s += " CROSS "; + break; + } + case 352: { + s += " CUBE "; + break; + } + case 353: { + s += " currentDatabase "; + break; + } + case 354: { + s += " currentProfiles "; + break; + } + case 355: { + s += " currentRoles "; + break; + } + case 356: { + s += " currentUser "; + break; + } + case 357: { + s += " cutFragment "; + break; + } + case 358: { + s += " cutIPv6 "; + break; + } + case 359: { + s += " cutQueryString "; + break; + } + case 360: { + s += " cutQueryStringAndFragment "; + break; + } + case 361: { + s += " cutToFirstSignificantSubdomain "; + break; + } + case 362: { + s += " cutToFirstSignificantSubdomainCustom "; + break; + } + case 363: { + s += " cutToFirstSignificantSubdomainCustomWithWWW "; + break; + } + case 364: { + s += " cutToFirstSignificantSubdomainWithWWW "; + break; + } + case 365: { + s += " cutURLParameter "; + break; + } + case 366: { + s += " cutWWW "; + break; + } + case 367: { + s += " D "; + break; + } + case 368: { + s += " DATABASE "; + break; + } + case 369: { + s += " DATABASES "; + break; + } + case 370: { + s += " Date "; + break; + } + case 371: { + s += " DATE "; + break; + } + case 372: { + s += " Date32 "; + break; + } + case 373: { + s += " DATE_ADD "; + break; + } + case 374: { + s += " DATEADD "; + break; + } + case 375: { + s += " dateDiff "; + break; + } + case 376: { + s += " DATE_DIFF "; + break; + } + case 377: { + s += " DATEDIFF "; + break; + } + case 378: { + s += " dateName "; + break; + } + case 379: { + s += " DATE_SUB "; + break; + } + case 380: { + s += " DATESUB "; + break; + } + case 381: { + s += " DateTime "; + break; + } + case 382: { + s += " DateTime32 "; + break; + } + case 383: { + s += " DateTime64 "; + break; + } + case 384: { + s += " dateTime64ToSnowflake "; + break; + } + case 385: { + s += " dateTimeToSnowflake "; + break; + } + case 386: { + s += " date_trunc "; + break; + } + case 387: { + s += " dateTrunc "; + break; + } + case 388: { + s += " DAY "; + break; + } + case 389: { + s += " DAYOFMONTH "; + break; + } + case 390: { + s += " DAYOFWEEK "; + break; + } + case 391: { + s += " DAYOFYEAR "; + break; + } + case 392: { + s += " DD "; + break; + } + case 393: { + s += " DEC "; + break; + } + case 394: { + s += " Decimal "; + break; + } + case 395: { + s += " Decimal128 "; + break; + } + case 396: { + s += " Decimal256 "; + break; + } + case 397: { + s += " Decimal32 "; + break; + } + case 398: { + s += " Decimal64 "; + break; + } + case 399: { + s += " decodeURLComponent "; + break; + } + case 400: { + s += " decodeXMLComponent "; + break; + } + case 401: { + s += " decrypt "; + break; + } + case 402: { + s += " DEDUPLICATE "; + break; + } + case 403: { + s += " DEFAULT "; + break; + } + case 404: { + s += " defaultProfiles "; + break; + } + case 405: { + s += " defaultRoles "; + break; + } + case 406: { + s += " defaultValueOfArgumentType "; + break; + } + case 407: { + s += " defaultValueOfTypeName "; + break; + } + case 408: { + s += " DELAY "; + break; + } + case 409: { + s += " DELETE "; + break; + } + case 410: { + s += " DELETE WHERE "; + break; + } + case 411: { + s += " deltaSum "; + break; + } + case 412: { + s += " deltaSumTimestamp "; + break; + } + case 413: { + s += " demangle "; + break; + } + case 414: { + s += " dense_rank "; + break; + } + case 415: { + s += " DESC "; + break; + } + case 416: { + s += " DESCENDING "; + break; + } + case 417: { + s += " DESCRIBE "; + break; + } + case 418: { + s += " DETACH "; + break; + } + case 419: { + s += " DETACH PARTITION "; + break; + } + case 420: { + s += " dictGet "; + break; + } + case 421: { + s += " dictGetChildren "; + break; + } + case 422: { + s += " dictGetDate "; + break; + } + case 423: { + s += " dictGetDateOrDefault "; + break; + } + case 424: { + s += " dictGetDateTime "; + break; + } + case 425: { + s += " dictGetDateTimeOrDefault "; + break; + } + case 426: { + s += " dictGetDescendants "; + break; + } + case 427: { + s += " dictGetFloat32 "; + break; + } + case 428: { + s += " dictGetFloat32OrDefault "; + break; + } + case 429: { + s += " dictGetFloat64 "; + break; + } + case 430: { + s += " dictGetFloat64OrDefault "; + break; + } + case 431: { + s += " dictGetHierarchy "; + break; + } + case 432: { + s += " dictGetInt16 "; + break; + } + case 433: { + s += " dictGetInt16OrDefault "; + break; + } + case 434: { + s += " dictGetInt32 "; + break; + } + case 435: { + s += " dictGetInt32OrDefault "; + break; + } + case 436: { + s += " dictGetInt64 "; + break; + } + case 437: { + s += " dictGetInt64OrDefault "; + break; + } + case 438: { + s += " dictGetInt8 "; + break; + } + case 439: { + s += " dictGetInt8OrDefault "; + break; + } + case 440: { + s += " dictGetOrDefault "; + break; + } + case 441: { + s += " dictGetOrNull "; + break; + } + case 442: { + s += " dictGetString "; + break; + } + case 443: { + s += " dictGetStringOrDefault "; + break; + } + case 444: { + s += " dictGetUInt16 "; + break; + } + case 445: { + s += " dictGetUInt16OrDefault "; + break; + } + case 446: { + s += " dictGetUInt32 "; + break; + } + case 447: { + s += " dictGetUInt32OrDefault "; + break; + } + case 448: { + s += " dictGetUInt64 "; + break; + } + case 449: { + s += " dictGetUInt64OrDefault "; + break; + } + case 450: { + s += " dictGetUInt8 "; + break; + } + case 451: { + s += " dictGetUInt8OrDefault "; + break; + } + case 452: { + s += " dictGetUUID "; + break; + } + case 453: { + s += " dictGetUUIDOrDefault "; + break; + } + case 454: { + s += " dictHas "; + break; + } + case 455: { + s += " DICTIONARIES "; + break; + } + case 456: { + s += " DICTIONARY "; + break; + } + case 457: { + s += " dictIsIn "; + break; + } + case 458: { + s += " DISK "; + break; + } + case 459: { + s += " DISTINCT "; + break; + } + case 460: { + s += " DISTRIBUTED "; + break; + } + case 461: { + s += " divide "; + break; + } + case 462: { + s += " domain "; + break; + } + case 463: { + s += " domainWithoutWWW "; + break; + } + case 464: { + s += " DOUBLE "; + break; + } + case 465: { + s += " DOUBLE PRECISION "; + break; + } + case 466: { + s += " DROP "; + break; + } + case 467: { + s += " DROP COLUMN "; + break; + } + case 468: { + s += " DROP CONSTRAINT "; + break; + } + case 469: { + s += " DROP DETACHED PART "; + break; + } + case 470: { + s += " DROP DETACHED PARTITION "; + break; + } + case 471: { + s += " DROP INDEX "; + break; + } + case 472: { + s += " DROP PARTITION "; + break; + } + case 473: { + s += " dumpColumnStructure "; + break; + } + case 474: { + s += " e "; + break; + } + case 475: { + s += " ELSE "; + break; + } + case 476: { + s += " empty "; + break; + } + case 477: { + s += " emptyArrayDate "; + break; + } + case 478: { + s += " emptyArrayDateTime "; + break; + } + case 479: { + s += " emptyArrayFloat32 "; + break; + } + case 480: { + s += " emptyArrayFloat64 "; + break; + } + case 481: { + s += " emptyArrayInt16 "; + break; + } + case 482: { + s += " emptyArrayInt32 "; + break; + } + case 483: { + s += " emptyArrayInt64 "; + break; + } + case 484: { + s += " emptyArrayInt8 "; + break; + } + case 485: { + s += " emptyArrayString "; + break; + } + case 486: { + s += " emptyArrayToSingle "; + break; + } + case 487: { + s += " emptyArrayUInt16 "; + break; + } + case 488: { + s += " emptyArrayUInt32 "; + break; + } + case 489: { + s += " emptyArrayUInt64 "; + break; + } + case 490: { + s += " emptyArrayUInt8 "; + break; + } + case 491: { + s += " enabledProfiles "; + break; + } + case 492: { + s += " enabledRoles "; + break; + } + case 493: { + s += " encodeXMLComponent "; + break; + } + case 494: { + s += " encrypt "; + break; + } + case 495: { + s += " END "; + break; + } + case 496: { + s += " endsWith "; + break; + } + case 497: { + s += " ENGINE "; + break; + } + case 498: { + s += " entropy "; + break; + } + case 499: { + s += " Enum "; + break; + } + case 500: { + s += " ENUM "; + break; + } + case 501: { + s += " Enum16 "; + break; + } + case 502: { + s += " Enum8 "; + break; + } + case 503: { + s += " equals "; + break; + } + case 504: { + s += " erf "; + break; + } + case 505: { + s += " erfc "; + break; + } + case 506: { + s += " errorCodeToName "; + break; + } + case 507: { + s += " evalMLMethod "; + break; + } + case 508: { + s += " EVENTS "; + break; + } + case 509: { + s += " EXCHANGE TABLES "; + break; + } + case 510: { + s += " EXISTS "; + break; + } + case 511: { + s += " exp "; + break; + } + case 512: { + s += " exp10 "; + break; + } + case 513: { + s += " exp2 "; + break; + } + case 514: { + s += " EXPLAIN "; + break; + } + case 515: { + s += " exponentialMovingAverage "; + break; + } + case 516: { + s += " EXPRESSION "; + break; + } + case 517: { + s += " extract "; + break; + } + case 518: { + s += " EXTRACT "; + break; + } + case 519: { + s += " extractAll "; + break; + } + case 520: { + s += " extractAllGroups "; + break; + } + case 521: { + s += " extractAllGroupsHorizontal "; + break; + } + case 522: { + s += " extractAllGroupsVertical "; + break; + } + case 523: { + s += " extractGroups "; + break; + } + case 524: { + s += " extractTextFromHTML "; + break; + } + case 525: { + s += " extractURLParameter "; + break; + } + case 526: { + s += " extractURLParameterNames "; + break; + } + case 527: { + s += " extractURLParameters "; + break; + } + case 528: { + s += " farmFingerprint64 "; + break; + } + case 529: { + s += " farmHash64 "; + break; + } + case 530: { + s += " FETCHES "; + break; + } + case 531: { + s += " FETCH PART "; + break; + } + case 532: { + s += " FETCH PARTITION "; + break; + } + case 533: { + s += " file "; + break; + } + case 534: { + s += " filesystemAvailable "; + break; + } + case 535: { + s += " filesystemCapacity "; + break; + } + case 536: { + s += " filesystemFree "; + break; + } + case 537: { + s += " FINAL "; + break; + } + case 538: { + s += " finalizeAggregation "; + break; + } + case 539: { + s += " FIRST "; + break; + } + case 540: { + s += " firstSignificantSubdomain "; + break; + } + case 541: { + s += " firstSignificantSubdomainCustom "; + break; + } + case 542: { + s += " first_value "; + break; + } + case 543: { + s += " FIXED "; + break; + } + case 544: { + s += " FixedString "; + break; + } + case 545: { + s += " flatten "; + break; + } + case 546: { + s += " FLOAT "; + break; + } + case 547: { + s += " Float32 "; + break; + } + case 548: { + s += " Float64 "; + break; + } + case 549: { + s += " floor "; + break; + } + case 550: { + s += " FLUSH "; + break; + } + case 551: { + s += " FOR "; + break; + } + case 552: { + s += " ForEach "; + break; + } + case 553: { + s += " format "; + break; + } + case 554: { + s += " FORMAT "; + break; + } + case 555: { + s += " formatDateTime "; + break; + } + case 556: { + s += " formatReadableQuantity "; + break; + } + case 557: { + s += " formatReadableDecimalSize "; + break; + } + case 558: { + s += " formatReadableSize "; + break; + } + case 559: { + s += " formatReadableTimeDelta "; + break; + } + case 560: { + s += " formatRow "; + break; + } + case 561: { + s += " formatRowNoNewline "; + break; + } + case 562: { + s += " FQDN "; + break; + } + case 563: { + s += " fragment "; + break; + } + case 564: { + s += " FREEZE "; + break; + } + case 565: { + s += " FROM "; + break; + } + case 566: { + s += " FROM_BASE64 "; + break; + } + case 567: { + s += " fromModifiedJulianDay "; + break; + } + case 568: { + s += " fromModifiedJulianDayOrNull "; + break; + } + case 569: { + s += " FROM_UNIXTIME "; + break; + } + case 570: { + s += " fromUnixTimestamp "; + break; + } + case 571: { + s += " fromUnixTimestamp64Micro "; + break; + } + case 572: { + s += " fromUnixTimestamp64Milli "; + break; + } + case 573: { + s += " fromUnixTimestamp64Nano "; + break; + } + case 574: { + s += " FULL "; + break; + } + case 575: { + s += " fullHostName "; + break; + } + case 576: { + s += " FUNCTION "; + break; + } + case 577: { + s += " fuzzBits "; + break; + } + case 578: { + s += " gccMurmurHash "; + break; + } + case 579: { + s += " gcd "; + break; + } + case 580: { + s += " generateUUIDv4 "; + break; + } + case 581: { + s += " geoDistance "; + break; + } + case 582: { + s += " geohashDecode "; + break; + } + case 583: { + s += " geohashEncode "; + break; + } + case 584: { + s += " geohashesInBox "; + break; + } + case 585: { + s += " geoToH3 "; + break; + } + case 586: { + s += " geoToS2 "; + break; + } + case 587: { + s += " getMacro "; + break; + } + case 588: { + s += " __getScalar "; + break; + } + case 589: { + s += " getServerPort "; + break; + } + case 590: { + s += " getSetting "; + break; + } + case 591: { + s += " getSizeOfEnumType "; + break; + } + case 592: { + s += " GLOBAL "; + break; + } + case 593: { + s += " globalIn "; + break; + } + case 594: { + s += " globalInIgnoreSet "; + break; + } + case 595: { + s += " globalNotIn "; + break; + } + case 596: { + s += " globalNotInIgnoreSet "; + break; + } + case 597: { + s += " globalNotNullIn "; + break; + } + case 598: { + s += " globalNotNullInIgnoreSet "; + break; + } + case 599: { + s += " globalNullIn "; + break; + } + case 600: { + s += " globalNullInIgnoreSet "; + break; + } + case 601: { + s += " globalVariable "; + break; + } + case 602: { + s += " GRANULARITY "; + break; + } + case 603: { + s += " greatCircleAngle "; + break; + } + case 604: { + s += " greatCircleDistance "; + break; + } + case 605: { + s += " greater "; + break; + } + case 606: { + s += " greaterOrEquals "; + break; + } + case 607: { + s += " greatest "; + break; + } + case 608: { + s += " GROUP "; + break; + } + case 609: { + s += " groupArray "; + break; + } + case 610: { + s += " groupArrayInsertAt "; + break; + } + case 611: { + s += " groupArrayMovingAvg "; + break; + } + case 612: { + s += " groupArrayMovingSum "; + break; + } + case 613: { + s += " groupArraySample "; + break; + } + case 614: { + s += " groupBitAnd "; + break; + } + case 615: { + s += " groupBitmap "; + break; + } + case 616: { + s += " groupBitmapAnd "; + break; + } + case 617: { + s += " groupBitmapOr "; + break; + } + case 618: { + s += " groupBitmapXor "; + break; + } + case 619: { + s += " groupBitOr "; + break; + } + case 620: { + s += " groupBitXor "; + break; + } + case 621: { + s += " GROUP BY "; + break; + } + case 622: { + s += " groupUniqArray "; + break; + } + case 623: { + s += " h3EdgeAngle "; + break; + } + case 624: { + s += " h3EdgeLengthM "; + break; + } + case 625: { + s += " h3GetBaseCell "; + break; + } + case 626: { + s += " h3GetFaces "; + break; + } + case 627: { + s += " h3GetResolution "; + break; + } + case 628: { + s += " h3HexAreaM2 "; + break; + } + case 629: { + s += " h3IndexesAreNeighbors "; + break; + } + case 630: { + s += " h3IsPentagon "; + break; + } + case 631: { + s += " h3IsResClassIII "; + break; + } + case 632: { + s += " h3IsValid "; + break; + } + case 633: { + s += " h3kRing "; + break; + } + case 634: { + s += " h3ToChildren "; + break; + } + case 635: { + s += " h3ToGeo "; + break; + } + case 636: { + s += " h3ToGeoBoundary "; + break; + } + case 637: { + s += " h3ToParent "; + break; + } + case 638: { + s += " h3ToString "; + break; + } + case 639: { + s += " halfMD5 "; + break; + } + case 640: { + s += " has "; + break; + } + case 641: { + s += " hasAll "; + break; + } + case 642: { + s += " hasAny "; + break; + } + case 643: { + s += " hasColumnInTable "; + break; + } + case 644: { + s += " hasSubstr "; + break; + } + case 645: { + s += " hasThreadFuzzer "; + break; + } + case 646: { + s += " hasToken "; + break; + } + case 647: { + s += " hasTokenCaseInsensitive "; + break; + } + case 648: { + s += " HAVING "; + break; + } + case 649: { + s += " hex "; + break; + } + case 650: { + s += " HH "; + break; + } + case 651: { + s += " HIERARCHICAL "; + break; + } + case 652: { + s += " histogram "; + break; + } + case 653: { + s += " hiveHash "; + break; + } + case 654: { + s += " hostname "; + break; + } + case 655: { + s += " hostName "; + break; + } + case 656: { + s += " HOUR "; + break; + } + case 657: { + s += " hypot "; + break; + } + case 658: { + s += " ID "; + break; + } + case 659: { + s += " identity "; + break; + } + case 660: { + s += " if "; + break; + } + case 661: { + s += " IF "; + break; + } + case 662: { + s += " IF EXISTS "; + break; + } + case 663: { + s += " IF NOT EXISTS "; + break; + } + case 664: { + s += " ifNotFinite "; + break; + } + case 665: { + s += " ifNull "; + break; + } + case 666: { + s += " ignore "; + break; + } + case 667: { + s += " ilike "; + break; + } + case 668: { + s += " ILIKE "; + break; + } + case 669: { + s += " in "; + break; + } + case 670: { + s += " IN "; + break; + } + case 671: { + s += " INDEX "; + break; + } + case 672: { + s += " indexHint "; + break; + } + case 673: { + s += " indexOf "; + break; + } + case 674: { + s += " INET4 "; + break; + } + case 675: { + s += " INET6 "; + break; + } + case 676: { + s += " INET6_ATON "; + break; + } + case 677: { + s += " INET6_NTOA "; + break; + } + case 678: { + s += " INET_ATON "; + break; + } + case 679: { + s += " INET_NTOA "; + break; + } + case 680: { + s += " INF "; + break; + } + case 681: { + s += " inIgnoreSet "; + break; + } + case 682: { + s += " initializeAggregation "; + break; + } + case 683: { + s += " initial_query_id "; + break; + } + case 684: { + s += " initialQueryID "; + break; + } + case 685: { + s += " INJECTIVE "; + break; + } + case 686: { + s += " INNER "; + break; + } + case 687: { + s += " IN PARTITION "; + break; + } + case 688: { + s += " INSERT "; + break; + } + case 689: { + s += " INSERT INTO "; + break; + } + case 690: { + s += " INT "; + break; + } + case 691: { + s += " INT1 "; + break; + } + case 692: { + s += " Int128 "; + break; + } + case 693: { + s += " Int16 "; + break; + } + case 694: { + s += " INT1 SIGNED "; + break; + } + case 695: { + s += " INT1 UNSIGNED "; + break; + } + case 696: { + s += " Int256 "; + break; + } + case 697: { + s += " Int32 "; + break; + } + case 698: { + s += " Int64 "; + break; + } + case 699: { + s += " Int8 "; + break; + } + case 700: { + s += " intDiv "; + break; + } + case 701: { + s += " intDivOrZero "; + break; + } + case 702: { + s += " INTEGER "; + break; + } + case 703: { + s += " INTEGER SIGNED "; + break; + } + case 704: { + s += " INTEGER UNSIGNED "; + break; + } + case 705: { + s += " INTERVAL "; + break; + } + case 706: { + s += " IntervalDay "; + break; + } + case 707: { + s += " IntervalHour "; + break; + } + case 708: { + s += " intervalLengthSum "; + break; + } + case 709: { + s += " IntervalMinute "; + break; + } + case 710: { + s += " IntervalMonth "; + break; + } + case 711: { + s += " IntervalQuarter "; + break; + } + case 712: { + s += " IntervalSecond "; + break; + } + case 713: { + s += " IntervalWeek "; + break; + } + case 714: { + s += " IntervalYear "; + break; + } + case 715: { + s += " intExp10 "; + break; + } + case 716: { + s += " intExp2 "; + break; + } + case 717: { + s += " intHash32 "; + break; + } + case 718: { + s += " intHash64 "; + break; + } + case 719: { + s += " INTO "; + break; + } + case 720: { + s += " INTO OUTFILE "; + break; + } + case 721: { + s += " INT SIGNED "; + break; + } + case 722: { + s += " INT UNSIGNED "; + break; + } + case 723: { + s += " IPv4 "; + break; + } + case 724: { + s += " IPv4CIDRToRange "; + break; + } + case 725: { + s += " IPv4NumToString "; + break; + } + case 726: { + s += " IPv4NumToStringClassC "; + break; + } + case 727: { + s += " IPv4StringToNum "; + break; + } + case 728: { + s += " IPv4ToIPv6 "; + break; + } + case 729: { + s += " IPv6 "; + break; + } + case 730: { + s += " IPv6CIDRToRange "; + break; + } + case 731: { + s += " IPv6NumToString "; + break; + } + case 732: { + s += " IPv6StringToNum "; + break; + } + case 733: { + s += " IS "; + break; + } + case 734: { + s += " isConstant "; + break; + } + case 735: { + s += " isDecimalOverflow "; + break; + } + case 736: { + s += " isFinite "; + break; + } + case 737: { + s += " isInfinite "; + break; + } + case 738: { + s += " isIPAddressInRange "; + break; + } + case 739: { + s += " isIPv4String "; + break; + } + case 740: { + s += " isIPv6String "; + break; + } + case 741: { + s += " isNaN "; + break; + } + case 742: { + s += " isNotNull "; + break; + } + case 743: { + s += " isNull "; + break; + } + case 744: { + s += " IS_OBJECT_ID "; + break; + } + case 745: { + s += " isValidJSON "; + break; + } + case 746: { + s += " isValidUTF8 "; + break; + } + case 747: { + s += " isZeroOrNull "; + break; + } + case 748: { + s += " javaHash "; + break; + } + case 749: { + s += " javaHashUTF16LE "; + break; + } + case 750: { + s += " JOIN "; + break; + } + case 751: { + s += " joinGet "; + break; + } + case 752: { + s += " joinGetOrNull "; + break; + } + case 753: { + s += " JSON_EXISTS "; + break; + } + case 754: { + s += " JSONExtract "; + break; + } + case 755: { + s += " JSONExtractArrayRaw "; + break; + } + case 756: { + s += " JSONExtractBool "; + break; + } + case 757: { + s += " JSONExtractFloat "; + break; + } + case 758: { + s += " JSONExtractInt "; + break; + } + case 759: { + s += " JSONExtractKeysAndValues "; + break; + } + case 760: { + s += " JSONExtractKeysAndValuesRaw "; + break; + } + case 761: { + s += " JSONExtractKeys "; + break; + } + case 762: { + s += " JSONExtractRaw "; + break; + } + case 763: { + s += " JSONExtractString "; + break; + } + case 764: { + s += " JSONExtractUInt "; + break; + } + case 765: { + s += " JSONHas "; + break; + } + case 766: { + s += " JSONKey "; + break; + } + case 767: { + s += " JSONLength "; + break; + } + case 768: { + s += " JSON_QUERY "; + break; + } + case 769: { + s += " JSONType "; + break; + } + case 770: { + s += " JSON_VALUE "; + break; + } + case 771: { + s += " jumpConsistentHash "; + break; + } + case 772: { + s += " KEY "; + break; + } + case 773: { + s += " KILL "; + break; + } + case 774: { + s += " kurtPop "; + break; + } + case 775: { + s += " kurtSamp "; + break; + } + case 776: { + s += " lagInFrame "; + break; + } + case 777: { + s += " LAST "; + break; + } + case 778: { + s += " last_value "; + break; + } + case 779: { + s += " LAYOUT "; + break; + } + case 780: { + s += " lcase "; + break; + } + case 781: { + s += " lcm "; + break; + } + case 782: { + s += " leadInFrame "; + break; + } + case 783: { + s += " LEADING "; + break; + } + case 784: { + s += " least "; + break; + } + case 785: { + s += " LEFT "; + break; + } + case 786: { + s += " LEFT ARRAY JOIN "; + break; + } + case 787: { + s += " leftPad "; + break; + } + case 788: { + s += " leftPadUTF8 "; + break; + } + case 789: { + s += " lemmatize "; + break; + } + case 790: { + s += " length "; + break; + } + case 791: { + s += " lengthUTF8 "; + break; + } + case 792: { + s += " less "; + break; + } + case 793: { + s += " lessOrEquals "; + break; + } + case 794: { + s += " lgamma "; + break; + } + case 795: { + s += " LIFETIME "; + break; + } + case 796: { + s += " like "; + break; + } + case 797: { + s += " LIKE "; + break; + } + case 798: { + s += " LIMIT "; + break; + } + case 799: { + s += " LIVE "; + break; + } + case 800: { + s += " ln "; + break; + } + case 801: { + s += " LOCAL "; + break; + } + case 802: { + s += " locate "; + break; + } + case 803: { + s += " log "; + break; + } + case 804: { + s += " log10 "; + break; + } + case 805: { + s += " log1p "; + break; + } + case 806: { + s += " log2 "; + break; + } + case 807: { + s += " LOGS "; + break; + } + case 808: { + s += " logTrace "; + break; + } + case 809: { + s += " LONGBLOB "; + break; + } + case 810: { + s += " LONGTEXT "; + break; + } + case 811: { + s += " LowCardinality "; + break; + } + case 812: { + s += " lowCardinalityIndices "; + break; + } + case 813: { + s += " lowCardinalityKeys "; + break; + } + case 814: { + s += " lower "; + break; + } + case 815: { + s += " lowerUTF8 "; + break; + } + case 816: { + s += " lpad "; + break; + } + case 817: { + s += " LTRIM "; + break; + } + case 818: { + s += " M "; + break; + } + case 819: { + s += " MACNumToString "; + break; + } + case 820: { + s += " MACStringToNum "; + break; + } + case 821: { + s += " MACStringToOUI "; + break; + } + case 822: { + s += " mannWhitneyUTest "; + break; + } + case 823: { + s += " map "; + break; + } + case 824: { + s += " Map "; + break; + } + case 825: { + s += " mapAdd "; + break; + } + case 826: { + s += " mapContains "; + break; + } + case 827: { + s += " mapKeys "; + break; + } + case 828: { + s += " mapPopulateSeries "; + break; + } + case 829: { + s += " mapSubtract "; + break; + } + case 830: { + s += " mapValues "; + break; + } + case 831: { + s += " match "; + break; + } + case 832: { + s += " materialize "; + break; + } + case 833: { + s += " MATERIALIZE "; + break; + } + case 834: { + s += " MATERIALIZED "; + break; + } + case 835: { + s += " MATERIALIZE INDEX "; + break; + } + case 836: { + s += " MATERIALIZE TTL "; + break; + } + case 837: { + s += " max "; + break; + } + case 838: { + s += " MAX "; + break; + } + case 839: { + s += " maxIntersections "; + break; + } + case 840: { + s += " maxIntersectionsPosition "; + break; + } + case 841: { + s += " maxMap "; + break; + } + case 842: { + s += " MD4 "; + break; + } + case 843: { + s += " MD5 "; + break; + } + case 844: { + s += " median "; + break; + } + case 845: { + s += " medianBFloat16 "; + break; + } + case 846: { + s += " medianBFloat16Weighted "; + break; + } + case 847: { + s += " medianDeterministic "; + break; + } + case 848: { + s += " medianExact "; + break; + } + case 849: { + s += " medianExactHigh "; + break; + } + case 850: { + s += " medianExactLow "; + break; + } + case 851: { + s += " medianExactWeighted "; + break; + } + case 852: { + s += " medianTDigest "; + break; + } + case 853: { + s += " medianTDigestWeighted "; + break; + } + case 854: { + s += " medianTiming "; + break; + } + case 855: { + s += " medianTimingWeighted "; + break; + } + case 856: { + s += " MEDIUMBLOB "; + break; + } + case 857: { + s += " MEDIUMINT "; + break; + } + case 858: { + s += " MEDIUMINT SIGNED "; + break; + } + case 859: { + s += " MEDIUMINT UNSIGNED "; + break; + } + case 860: { + s += " MEDIUMTEXT "; + break; + } + case 861: { + s += " Merge "; + break; + } + case 862: { + s += " MERGES "; + break; + } + case 863: { + s += " metroHash64 "; + break; + } + case 864: { + s += " MI "; + break; + } + case 865: { + s += " mid "; + break; + } + case 866: { + s += " min "; + break; + } + case 867: { + s += " MIN "; + break; + } + case 868: { + s += " minMap "; + break; + } + case 869: { + s += " minus "; + break; + } + case 870: { + s += " MINUTE "; + break; + } + case 871: { + s += " MM "; + break; + } + case 872: { + s += " mod "; + break; + } + case 873: { + s += " MODIFY "; + break; + } + case 874: { + s += " MODIFY COLUMN "; + break; + } + case 875: { + s += " MODIFY ORDER BY "; + break; + } + case 876: { + s += " MODIFY QUERY "; + break; + } + case 877: { + s += " MODIFY SETTING "; + break; + } + case 878: { + s += " MODIFY TTL "; + break; + } + case 879: { + s += " modulo "; + break; + } + case 880: { + s += " moduloLegacy "; + break; + } + case 881: { + s += " moduloOrZero "; + break; + } + case 882: { + s += " MONTH "; + break; + } + case 883: { + s += " MOVE "; + break; + } + case 884: { + s += " MOVE PART "; + break; + } + case 885: { + s += " MOVE PARTITION "; + break; + } + case 886: { + s += " movingXXX "; + break; + } + case 887: { + s += " multiFuzzyMatchAllIndices "; + break; + } + case 888: { + s += " multiFuzzyMatchAny "; + break; + } + case 889: { + s += " multiFuzzyMatchAnyIndex "; + break; + } + case 890: { + s += " multiIf "; + break; + } + case 891: { + s += " multiMatchAllIndices "; + break; + } + case 892: { + s += " multiMatchAny "; + break; + } + case 893: { + s += " multiMatchAnyIndex "; + break; + } + case 894: { + s += " multiply "; + break; + } + case 895: { + s += " MultiPolygon "; + break; + } + case 896: { + s += " multiSearchAllPositions "; + break; + } + case 897: { + s += " multiSearchAllPositionsCaseInsensitive "; + break; + } + case 898: { + s += " multiSearchAllPositionsCaseInsensitiveUTF8 "; + break; + } + case 899: { + s += " multiSearchAllPositionsUTF8 "; + break; + } + case 900: { + s += " multiSearchAny "; + break; + } + case 901: { + s += " multiSearchAnyCaseInsensitive "; + break; + } + case 902: { + s += " multiSearchAnyCaseInsensitiveUTF8 "; + break; + } + case 903: { + s += " multiSearchAnyUTF8 "; + break; + } + case 904: { + s += " multiSearchFirstIndex "; + break; + } + case 905: { + s += " multiSearchFirstIndexCaseInsensitive "; + break; + } + case 906: { + s += " multiSearchFirstIndexCaseInsensitiveUTF8 "; + break; + } + case 907: { + s += " multiSearchFirstIndexUTF8 "; + break; + } + case 908: { + s += " multiSearchFirstPosition "; + break; + } + case 909: { + s += " multiSearchFirstPositionCaseInsensitive "; + break; + } + case 910: { + s += " multiSearchFirstPositionCaseInsensitiveUTF8 "; + break; + } + case 911: { + s += " multiSearchFirstPositionUTF8 "; + break; + } + case 912: { + s += " murmurHash2_32 "; + break; + } + case 913: { + s += " murmurHash2_64 "; + break; + } + case 914: { + s += " murmurHash3_128 "; + break; + } + case 915: { + s += " murmurHash3_32 "; + break; + } + case 916: { + s += " murmurHash3_64 "; + break; + } + case 917: { + s += " MUTATION "; + break; + } + case 918: { + s += " N "; + break; + } + case 919: { + s += " NAME "; + break; + } + case 920: { + s += " NAN_SQL "; + break; + } + case 921: { + s += " NATIONAL CHAR "; + break; + } + case 922: { + s += " NATIONAL CHARACTER "; + break; + } + case 923: { + s += " NATIONAL CHARACTER LARGE OBJECT "; + break; + } + case 924: { + s += " NATIONAL CHARACTER VARYING "; + break; + } + case 925: { + s += " NATIONAL CHAR VARYING "; + break; + } + case 926: { + s += " NCHAR "; + break; + } + case 927: { + s += " NCHAR LARGE OBJECT "; + break; + } + case 928: { + s += " NCHAR VARYING "; + break; + } + case 929: { + s += " negate "; + break; + } + case 930: { + s += " neighbor "; + break; + } + case 931: { + s += " Nested "; + break; + } + case 932: { + s += " netloc "; + break; + } + case 933: { + s += " ngramDistance "; + break; + } + case 934: { + s += " ngramDistanceCaseInsensitive "; + break; + } + case 935: { + s += " ngramDistanceCaseInsensitiveUTF8 "; + break; + } + case 936: { + s += " ngramDistanceUTF8 "; + break; + } + case 937: { + s += " ngramMinHash "; + break; + } + case 938: { + s += " ngramMinHashArg "; + break; + } + case 939: { + s += " ngramMinHashArgCaseInsensitive "; + break; + } + case 940: { + s += " ngramMinHashArgCaseInsensitiveUTF8 "; + break; + } + case 941: { + s += " ngramMinHashArgUTF8 "; + break; + } + case 942: { + s += " ngramMinHashCaseInsensitive "; + break; + } + case 943: { + s += " ngramMinHashCaseInsensitiveUTF8 "; + break; + } + case 944: { + s += " ngramMinHashUTF8 "; + break; + } + case 945: { + s += " ngramSearch "; + break; + } + case 946: { + s += " ngramSearchCaseInsensitive "; + break; + } + case 947: { + s += " ngramSearchCaseInsensitiveUTF8 "; + break; + } + case 948: { + s += " ngramSearchUTF8 "; + break; + } + case 949: { + s += " ngramSimHash "; + break; + } + case 950: { + s += " ngramSimHashCaseInsensitive "; + break; + } + case 951: { + s += " ngramSimHashCaseInsensitiveUTF8 "; + break; + } + case 952: { + s += " ngramSimHashUTF8 "; + break; + } + case 953: { + s += " NO "; + break; + } + case 954: { + s += " NO DELAY "; + break; + } + case 955: { + s += " NONE "; + break; + } + case 956: { + s += " normalizedQueryHash "; + break; + } + case 957: { + s += " normalizedQueryHashKeepNames "; + break; + } + case 958: { + s += " normalizeQuery "; + break; + } + case 959: { + s += " normalizeQueryKeepNames "; + break; + } + case 960: { + s += " not "; + break; + } + case 961: { + s += " NOT "; + break; + } + case 962: { + s += " notEmpty "; + break; + } + case 963: { + s += " notEquals "; + break; + } + case 964: { + s += " nothing "; + break; + } + case 965: { + s += " Nothing "; + break; + } + case 966: { + s += " notILike "; + break; + } + case 967: { + s += " notIn "; + break; + } + case 968: { + s += " notInIgnoreSet "; + break; + } + case 969: { + s += " notLike "; + break; + } + case 970: { + s += " notNullIn "; + break; + } + case 971: { + s += " notNullInIgnoreSet "; + break; + } + case 972: { + s += " now "; + break; + } + case 973: { + s += " now64 "; + break; + } + case 974: { + s += " Null "; + break; + } + case 975: { + s += " Nullable "; + break; + } + case 976: { + s += " nullIf "; + break; + } + case 977: { + s += " nullIn "; + break; + } + case 978: { + s += " nullInIgnoreSet "; + break; + } + case 979: { + s += " NULLS "; + break; + } + case 980: { + s += " NULL_SQL "; + break; + } + case 981: { + s += " NUMERIC "; + break; + } + case 982: { + s += " NVARCHAR "; + break; + } + case 983: { + s += " OFFSET "; + break; + } + case 984: { + s += " ON "; + break; + } + case 985: { + s += " ONLY "; + break; + } + case 986: { + s += " OPTIMIZE "; + break; + } + case 987: { + s += " OPTIMIZE TABLE "; + break; + } + case 988: { + s += " or "; + break; + } + case 989: { + s += " OR "; + break; + } + case 990: { + s += " ORDER "; + break; + } + case 991: { + s += " ORDER BY "; + break; + } + case 992: { + s += " OR REPLACE "; + break; + } + case 993: { + s += " OUTER "; + break; + } + case 994: { + s += " OUTFILE "; + break; + } + case 995: { + s += " parseDateTime32BestEffort "; + break; + } + case 996: { + s += " parseDateTime32BestEffortOrNull "; + break; + } + case 997: { + s += " parseDateTime32BestEffortOrZero "; + break; + } + case 998: { + s += " parseDateTime64BestEffort "; + break; + } + case 999: { + s += " parseDateTime64BestEffortOrNull "; + break; + } + case 1000: { + s += " parseDateTime64BestEffortOrZero "; + break; + } + case 1001: { + s += " parseDateTimeBestEffort "; + break; + } + case 1002: { + s += " parseDateTimeBestEffortOrNull "; + break; + } + case 1003: { + s += " parseDateTimeBestEffortOrZero "; + break; + } + case 1004: { + s += " parseDateTimeBestEffortUS "; + break; + } + case 1005: { + s += " parseDateTimeBestEffortUSOrNull "; + break; + } + case 1006: { + s += " parseDateTimeBestEffortUSOrZero "; + break; + } + case 1007: { + s += " parseTimeDelta "; + break; + } + case 1008: { + s += " PARTITION "; + break; + } + case 1009: { + s += " PARTITION BY "; + break; + } + case 1010: { + s += " partitionId "; + break; + } + case 1011: { + s += " path "; + break; + } + case 1012: { + s += " pathFull "; + break; + } + case 1013: { + s += " pi "; + break; + } + case 1014: { + s += " plus "; + break; + } + case 1015: { + s += " Point "; + break; + } + case 1016: { + s += " pointInEllipses "; + break; + } + case 1017: { + s += " pointInPolygon "; + break; + } + case 1018: { + s += " Polygon "; + break; + } + case 1019: { + s += " polygonAreaCartesian "; + break; + } + case 1020: { + s += " polygonAreaSpherical "; + break; + } + case 1021: { + s += " polygonConvexHullCartesian "; + break; + } + case 1022: { + s += " polygonPerimeterCartesian "; + break; + } + case 1023: { + s += " polygonPerimeterSpherical "; + break; + } + case 1024: { + s += " polygonsDistanceCartesian "; + break; + } + case 1025: { + s += " polygonsDistanceSpherical "; + break; + } + case 1026: { + s += " polygonsEqualsCartesian "; + break; + } + case 1027: { + s += " polygonsIntersectionCartesian "; + break; + } + case 1028: { + s += " polygonsIntersectionSpherical "; + break; + } + case 1029: { + s += " polygonsSymDifferenceCartesian "; + break; + } + case 1030: { + s += " polygonsSymDifferenceSpherical "; + break; + } + case 1031: { + s += " polygonsUnionCartesian "; + break; + } + case 1032: { + s += " polygonsUnionSpherical "; + break; + } + case 1033: { + s += " polygonsWithinCartesian "; + break; + } + case 1034: { + s += " polygonsWithinSpherical "; + break; + } + case 1035: { + s += " POPULATE "; + break; + } + case 1036: { + s += " port "; + break; + } + case 1037: { + s += " position "; + break; + } + case 1038: { + s += " positionCaseInsensitive "; + break; + } + case 1039: { + s += " positionCaseInsensitiveUTF8 "; + break; + } + case 1040: { + s += " positionUTF8 "; + break; + } + case 1041: { + s += " pow "; + break; + } + case 1042: { + s += " power "; + break; + } + case 1043: { + s += " PREWHERE "; + break; + } + case 1044: { + s += " PRIMARY "; + break; + } + case 1045: { + s += " PRIMARY KEY "; + break; + } + case 1046: { + s += " PROJECTION "; + break; + } + case 1047: { + s += " protocol "; + break; + } + case 1048: { + s += " Q "; + break; + } + case 1049: { + s += " QQ "; + break; + } + case 1050: { + s += " quantile "; + break; + } + case 1051: { + s += " quantileBFloat16 "; + break; + } + case 1052: { + s += " quantileBFloat16Weighted "; + break; + } + case 1053: { + s += " quantileDeterministic "; + break; + } + case 1054: { + s += " quantileExact "; + break; + } + case 1055: { + s += " quantileExactExclusive "; + break; + } + case 1056: { + s += " quantileExactHigh "; + break; + } + case 1057: { + s += " quantileExactInclusive "; + break; + } + case 1058: { + s += " quantileExactLow "; + break; + } + case 1059: { + s += " quantileExactWeighted "; + break; + } + case 1060: { + s += " quantiles "; + break; + } + case 1061: { + s += " quantilesBFloat16 "; + break; + } + case 1062: { + s += " quantilesBFloat16Weighted "; + break; + } + case 1063: { + s += " quantilesDeterministic "; + break; + } + case 1064: { + s += " quantilesExact "; + break; + } + case 1065: { + s += " quantilesExactExclusive "; + break; + } + case 1066: { + s += " quantilesExactHigh "; + break; + } + case 1067: { + s += " quantilesExactInclusive "; + break; + } + case 1068: { + s += " quantilesExactLow "; + break; + } + case 1069: { + s += " quantilesExactWeighted "; + break; + } + case 1070: { + s += " quantilesTDigest "; + break; + } + case 1071: { + s += " quantilesTDigestWeighted "; + break; + } + case 1072: { + s += " quantilesTiming "; + break; + } + case 1073: { + s += " quantilesTimingWeighted "; + break; + } + case 1074: { + s += " quantileTDigest "; + break; + } + case 1075: { + s += " quantileTDigestWeighted "; + break; + } + case 1076: { + s += " quantileTiming "; + break; + } + case 1077: { + s += " quantileTimingWeighted "; + break; + } + case 1078: { + s += " QUARTER "; + break; + } + case 1079: { + s += " query_id "; + break; + } + case 1080: { + s += " queryID "; + break; + } + case 1081: { + s += " queryString "; + break; + } + case 1082: { + s += " queryStringAndFragment "; + break; + } + case 1083: { + s += " rand "; + break; + } + case 1084: { + s += " rand32 "; + break; + } + case 1085: { + s += " rand64 "; + break; + } + case 1086: { + s += " randConstant "; + break; + } + case 1087: { + s += " randomFixedString "; + break; + } + case 1088: { + s += " randomPrintableASCII "; + break; + } + case 1089: { + s += " randomString "; + break; + } + case 1090: { + s += " randomStringUTF8 "; + break; + } + case 1091: { + s += " range "; + break; + } + case 1092: { + s += " RANGE "; + break; + } + case 1093: { + s += " rank "; + break; + } + case 1094: { + s += " rankCorr "; + break; + } + case 1095: { + s += " readWKTMultiPolygon "; + break; + } + case 1096: { + s += " readWKTPoint "; + break; + } + case 1097: { + s += " readWKTPolygon "; + break; + } + case 1098: { + s += " readWKTRing "; + break; + } + case 1099: { + s += " REAL "; + break; + } + case 1100: { + s += " REFRESH "; + break; + } + case 1101: { + s += " regexpQuoteMeta "; + break; + } + case 1102: { + s += " regionHierarchy "; + break; + } + case 1103: { + s += " regionIn "; + break; + } + case 1104: { + s += " regionToArea "; + break; + } + case 1105: { + s += " regionToCity "; + break; + } + case 1106: { + s += " regionToContinent "; + break; + } + case 1107: { + s += " regionToCountry "; + break; + } + case 1108: { + s += " regionToDistrict "; + break; + } + case 1109: { + s += " regionToName "; + break; + } + case 1110: { + s += " regionToPopulation "; + break; + } + case 1111: { + s += " regionToTopContinent "; + break; + } + case 1112: { + s += " reinterpret "; + break; + } + case 1113: { + s += " reinterpretAsDate "; + break; + } + case 1114: { + s += " reinterpretAsDateTime "; + break; + } + case 1115: { + s += " reinterpretAsFixedString "; + break; + } + case 1116: { + s += " reinterpretAsFloat32 "; + break; + } + case 1117: { + s += " reinterpretAsFloat64 "; + break; + } + case 1118: { + s += " reinterpretAsInt128 "; + break; + } + case 1119: { + s += " reinterpretAsInt16 "; + break; + } + case 1120: { + s += " reinterpretAsInt256 "; + break; + } + case 1121: { + s += " reinterpretAsInt32 "; + break; + } + case 1122: { + s += " reinterpretAsInt64 "; + break; + } + case 1123: { + s += " reinterpretAsInt8 "; + break; + } + case 1124: { + s += " reinterpretAsString "; + break; + } + case 1125: { + s += " reinterpretAsUInt128 "; + break; + } + case 1126: { + s += " reinterpretAsUInt16 "; + break; + } + case 1127: { + s += " reinterpretAsUInt256 "; + break; + } + case 1128: { + s += " reinterpretAsUInt32 "; + break; + } + case 1129: { + s += " reinterpretAsUInt64 "; + break; + } + case 1130: { + s += " reinterpretAsUInt8 "; + break; + } + case 1131: { + s += " reinterpretAsUUID "; + break; + } + case 1132: { + s += " RELOAD "; + break; + } + case 1133: { + s += " REMOVE "; + break; + } + case 1134: { + s += " RENAME "; + break; + } + case 1135: { + s += " RENAME COLUMN "; + break; + } + case 1136: { + s += " RENAME TABLE "; + break; + } + case 1137: { + s += " repeat "; + break; + } + case 1138: { + s += " replace "; + break; + } + case 1139: { + s += " REPLACE "; + break; + } + case 1140: { + s += " replaceAll "; + break; + } + case 1141: { + s += " replaceOne "; + break; + } + case 1142: { + s += " REPLACE PARTITION "; + break; + } + case 1143: { + s += " replaceRegexpAll "; + break; + } + case 1144: { + s += " replaceRegexpOne "; + break; + } + case 1145: { + s += " REPLICA "; + break; + } + case 1146: { + s += " replicate "; + break; + } + case 1147: { + s += " REPLICATED "; + break; + } + case 1148: { + s += " Resample "; + break; + } + case 1149: { + s += " RESUME "; + break; + } + case 1150: { + s += " retention "; + break; + } + case 1151: { + s += " reverse "; + break; + } + case 1152: { + s += " reverseUTF8 "; + break; + } + case 1153: { + s += " RIGHT "; + break; + } + case 1154: { + s += " rightPad "; + break; + } + case 1155: { + s += " rightPadUTF8 "; + break; + } + case 1156: { + s += " Ring "; + break; + } + case 1157: { + s += " ROLLUP "; + break; + } + case 1158: { + s += " round "; + break; + } + case 1159: { + s += " roundAge "; + break; + } + case 1160: { + s += " roundBankers "; + break; + } + case 1161: { + s += " roundDown "; + break; + } + case 1162: { + s += " roundDuration "; + break; + } + case 1163: { + s += " roundToExp2 "; + break; + } + case 1164: { + s += " row_number "; + break; + } + case 1165: { + s += " rowNumberInAllBlocks "; + break; + } + case 1166: { + s += " rowNumberInBlock "; + break; + } + case 1167: { + s += " rpad "; + break; + } + case 1168: { + s += " RTRIM "; + break; + } + case 1169: { + s += " runningAccumulate "; + break; + } + case 1170: { + s += " runningConcurrency "; + break; + } + case 1171: { + s += " runningDifference "; + break; + } + case 1172: { + s += " runningDifferenceStartingWithFirstValue "; + break; + } + case 1173: { + s += " S "; + break; + } + case 1174: { + s += " s2CapContains "; + break; + } + case 1175: { + s += " s2CapUnion "; + break; + } + case 1176: { + s += " s2CellsIntersect "; + break; + } + case 1177: { + s += " s2GetNeighbors "; + break; + } + case 1178: { + s += " s2RectAdd "; + break; + } + case 1179: { + s += " s2RectContains "; + break; + } + case 1180: { + s += " s2RectIntersection "; + break; + } + case 1181: { + s += " s2RectUnion "; + break; + } + case 1182: { + s += " s2ToGeo "; + break; + } + case 1183: { + s += " SAMPLE "; + break; + } + case 1184: { + s += " SAMPLE BY "; + break; + } + case 1185: { + s += " SECOND "; + break; + } + case 1186: { + s += " SELECT "; + break; + } + case 1187: { + s += " SEMI "; + break; + } + case 1188: { + s += " SENDS "; + break; + } + case 1189: { + s += " sequenceCount "; + break; + } + case 1190: { + s += " sequenceMatch "; + break; + } + case 1191: { + s += " sequenceNextNode "; + break; + } + case 1192: { + s += " serverUUID "; + break; + } + case 1193: { + s += " SET "; + break; + } + case 1194: { + s += " SETTINGS "; + break; + } + case 1195: { + s += " SHA1 "; + break; + } + case 1196: { + s += " SHA224 "; + break; + } + case 1197: { + s += " SHA256 "; + break; + } + case 1198: { + s += " SHA384 "; + break; + } + case 1199: { + s += " SHA512 "; + break; + } + case 1200: { + s += " shardCount "; + break; + } + case 1201: { + s += " shardNum "; + break; + } + case 1202: { + s += " SHOW "; + break; + } + case 1203: { + s += " SHOW PROCESSLIST "; + break; + } + case 1204: { + s += " sigmoid "; + break; + } + case 1205: { + s += " sign "; + break; + } + case 1206: { + s += " SimpleAggregateFunction "; + break; + } + case 1207: { + s += " simpleJSONExtractBool "; + break; + } + case 1208: { + s += " simpleJSONExtractFloat "; + break; + } + case 1209: { + s += " simpleJSONExtractInt "; + break; + } + case 1210: { + s += " simpleJSONExtractRaw "; + break; + } + case 1211: { + s += " simpleJSONExtractString "; + break; + } + case 1212: { + s += " simpleJSONExtractUInt "; + break; + } + case 1213: { + s += " simpleJSONHas "; + break; + } + case 1214: { + s += " simpleLinearRegression "; + break; + } + case 1215: { + s += " sin "; + break; + } + case 1216: { + s += " SINGLE "; + break; + } + case 1217: { + s += " singleValueOrNull "; + break; + } + case 1218: { + s += " sinh "; + break; + } + case 1219: { + s += " sipHash128 "; + break; + } + case 1220: { + s += " sipHash64 "; + break; + } + case 1221: { + s += " skewPop "; + break; + } + case 1222: { + s += " skewSamp "; + break; + } + case 1223: { + s += " sleep "; + break; + } + case 1224: { + s += " sleepEachRow "; + break; + } + case 1225: { + s += " SMALLINT "; + break; + } + case 1226: { + s += " SMALLINT SIGNED "; + break; + } + case 1227: { + s += " SMALLINT UNSIGNED "; + break; + } + case 1228: { + s += " snowflakeToDateTime "; + break; + } + case 1229: { + s += " snowflakeToDateTime64 "; + break; + } + case 1230: { + s += " SOURCE "; + break; + } + case 1231: { + s += " sparkbar "; + break; + } + case 1232: { + s += " splitByChar "; + break; + } + case 1233: { + s += " splitByNonAlpha "; + break; + } + case 1234: { + s += " splitByRegexp "; + break; + } + case 1235: { + s += " splitByString "; + break; + } + case 1236: { + s += " splitByWhitespace "; + break; + } + case 1237: { + s += " SQL_TSI_DAY "; + break; + } + case 1238: { + s += " SQL_TSI_HOUR "; + break; + } + case 1239: { + s += " SQL_TSI_MINUTE "; + break; + } + case 1240: { + s += " SQL_TSI_MONTH "; + break; + } + case 1241: { + s += " SQL_TSI_QUARTER "; + break; + } + case 1242: { + s += " SQL_TSI_SECOND "; + break; + } + case 1243: { + s += " SQL_TSI_WEEK "; + break; + } + case 1244: { + s += " SQL_TSI_YEAR "; + break; + } + case 1245: { + s += " sqrt "; + break; + } + case 1246: { + s += " SS "; + break; + } + case 1247: { + s += " START "; + break; + } + case 1248: { + s += " startsWith "; + break; + } + case 1249: { + s += " State "; + break; + } + case 1250: { + s += " stddevPop "; + break; + } + case 1251: { + s += " STDDEV_POP "; + break; + } + case 1252: { + s += " stddevPopStable "; + break; + } + case 1253: { + s += " stddevSamp "; + break; + } + case 1254: { + s += " STDDEV_SAMP "; + break; + } + case 1255: { + s += " stddevSampStable "; + break; + } + case 1256: { + s += " stem "; + break; + } + case 1257: { + s += " STEP "; + break; + } + case 1258: { + s += " stochasticLinearRegression "; + break; + } + case 1259: { + s += " stochasticLogisticRegression "; + break; + } + case 1260: { + s += " STOP "; + break; + } + case 1261: { + s += " String "; + break; + } + case 1262: { + s += " stringToH3 "; + break; + } + case 1263: { + s += " studentTTest "; + break; + } + case 1264: { + s += " subBitmap "; + break; + } + case 1265: { + s += " substr "; + break; + } + case 1266: { + s += " substring "; + break; + } + case 1267: { + s += " SUBSTRING "; + break; + } + case 1268: { + s += " substringUTF8 "; + break; + } + case 1269: { + s += " subtractDays "; + break; + } + case 1270: { + s += " subtractHours "; + break; + } + case 1271: { + s += " subtractMinutes "; + break; + } + case 1272: { + s += " subtractMonths "; + break; + } + case 1273: { + s += " subtractQuarters "; + break; + } + case 1274: { + s += " subtractSeconds "; + break; + } + case 1275: { + s += " subtractWeeks "; + break; + } + case 1276: { + s += " subtractYears "; + break; + } + case 1277: { + s += " sum "; + break; + } + case 1278: { + s += " sumCount "; + break; + } + case 1279: { + s += " sumKahan "; + break; + } + case 1280: { + s += " sumMap "; + break; + } + case 1281: { + s += " sumMapFiltered "; + break; + } + case 1282: { + s += " sumMapFilteredWithOverflow "; + break; + } + case 1283: { + s += " sumMapWithOverflow "; + break; + } + case 1284: { + s += " sumWithOverflow "; + break; + } + case 1285: { + s += " SUSPEND "; + break; + } + case 1286: { + s += " svg "; + break; + } + case 1287: { + s += " SVG "; + break; + } + case 1288: { + s += " SYNC "; + break; + } + case 1289: { + s += " synonyms "; + break; + } + case 1290: { + s += " SYNTAX "; + break; + } + case 1291: { + s += " SYSTEM "; + break; + } + case 1292: { + s += " TABLE "; + break; + } + case 1293: { + s += " TABLES "; + break; + } + case 1294: { + s += " tan "; + break; + } + case 1295: { + s += " tanh "; + break; + } + case 1296: { + s += " tcpPort "; + break; + } + case 1297: { + s += " TEMPORARY "; + break; + } + case 1298: { + s += " TEST "; + break; + } + case 1299: { + s += " TEXT "; + break; + } + case 1300: { + s += " tgamma "; + break; + } + case 1301: { + s += " THEN "; + break; + } + case 1302: { + s += " throwIf "; + break; + } + case 1303: { + s += " tid "; + break; + } + case 1304: { + s += " TIES "; + break; + } + case 1305: { + s += " TIMEOUT "; + break; + } + case 1306: { + s += " timeSlot "; + break; + } + case 1307: { + s += " timeSlots "; + break; + } + case 1308: { + s += " TIMESTAMP "; + break; + } + case 1309: { + s += " TIMESTAMP_ADD "; + break; + } + case 1310: { + s += " TIMESTAMPADD "; + break; + } + case 1311: { + s += " TIMESTAMP_DIFF "; + break; + } + case 1312: { + s += " TIMESTAMPDIFF "; + break; + } + case 1313: { + s += " TIMESTAMP_SUB "; + break; + } + case 1314: { + s += " TIMESTAMPSUB "; + break; + } + case 1315: { + s += " timezone "; + break; + } + case 1316: { + s += " timeZone "; + break; + } + case 1317: { + s += " timezoneOf "; + break; + } + case 1318: { + s += " timeZoneOf "; + break; + } + case 1319: { + s += " timezoneOffset "; + break; + } + case 1320: { + s += " timeZoneOffset "; + break; + } + case 1321: { + s += " TINYBLOB "; + break; + } + case 1322: { + s += " TINYINT "; + break; + } + case 1323: { + s += " TINYINT SIGNED "; + break; + } + case 1324: { + s += " TINYINT UNSIGNED "; + break; + } + case 1325: { + s += " TINYTEXT "; + break; + } + case 1326: { + s += " TO "; + break; + } + case 1327: { + s += " TO_BASE64 "; + break; + } + case 1328: { + s += " toColumnTypeName "; + break; + } + case 1329: { + s += " toDate "; + break; + } + case 1330: { + s += " toDate32 "; + break; + } + case 1331: { + s += " toDate32OrNull "; + break; + } + case 1332: { + s += " toDate32OrZero "; + break; + } + case 1333: { + s += " toDateOrNull "; + break; + } + case 1334: { + s += " toDateOrZero "; + break; + } + case 1335: { + s += " toDateTime "; + break; + } + case 1336: { + s += " toDateTime32 "; + break; + } + case 1337: { + s += " toDateTime64 "; + break; + } + case 1338: { + s += " toDateTime64OrNull "; + break; + } + case 1339: { + s += " toDateTime64OrZero "; + break; + } + case 1340: { + s += " toDateTimeOrNull "; + break; + } + case 1341: { + s += " toDateTimeOrZero "; + break; + } + case 1342: { + s += " today "; + break; + } + case 1343: { + s += " toDayOfMonth "; + break; + } + case 1344: { + s += " toDayOfWeek "; + break; + } + case 1345: { + s += " toDayOfYear "; + break; + } + case 1346: { + s += " toDecimal128 "; + break; + } + case 1347: { + s += " toDecimal128OrNull "; + break; + } + case 1348: { + s += " toDecimal128OrZero "; + break; + } + case 1349: { + s += " toDecimal256 "; + break; + } + case 1350: { + s += " toDecimal256OrNull "; + break; + } + case 1351: { + s += " toDecimal256OrZero "; + break; + } + case 1352: { + s += " toDecimal32 "; + break; + } + case 1353: { + s += " toDecimal32OrNull "; + break; + } + case 1354: { + s += " toDecimal32OrZero "; + break; + } + case 1355: { + s += " toDecimal64 "; + break; + } + case 1356: { + s += " toDecimal64OrNull "; + break; + } + case 1357: { + s += " toDecimal64OrZero "; + break; + } + case 1358: { + s += " TO DISK "; + break; + } + case 1359: { + s += " toFixedString "; + break; + } + case 1360: { + s += " toFloat32 "; + break; + } + case 1361: { + s += " toFloat32OrNull "; + break; + } + case 1362: { + s += " toFloat32OrZero "; + break; + } + case 1363: { + s += " toFloat64 "; + break; + } + case 1364: { + s += " toFloat64OrNull "; + break; + } + case 1365: { + s += " toFloat64OrZero "; + break; + } + case 1366: { + s += " toHour "; + break; + } + case 1367: { + s += " toInt128 "; + break; + } + case 1368: { + s += " toInt128OrNull "; + break; + } + case 1369: { + s += " toInt128OrZero "; + break; + } + case 1370: { + s += " toInt16 "; + break; + } + case 1371: { + s += " toInt16OrNull "; + break; + } + case 1372: { + s += " toInt16OrZero "; + break; + } + case 1373: { + s += " toInt256 "; + break; + } + case 1374: { + s += " toInt256OrNull "; + break; + } + case 1375: { + s += " toInt256OrZero "; + break; + } + case 1376: { + s += " toInt32 "; + break; + } + case 1377: { + s += " toInt32OrNull "; + break; + } + case 1378: { + s += " toInt32OrZero "; + break; + } + case 1379: { + s += " toInt64 "; + break; + } + case 1380: { + s += " toInt64OrNull "; + break; + } + case 1381: { + s += " toInt64OrZero "; + break; + } + case 1382: { + s += " toInt8 "; + break; + } + case 1383: { + s += " toInt8OrNull "; + break; + } + case 1384: { + s += " toInt8OrZero "; + break; + } + case 1385: { + s += " toIntervalDay "; + break; + } + case 1386: { + s += " toIntervalHour "; + break; + } + case 1387: { + s += " toIntervalMinute "; + break; + } + case 1388: { + s += " toIntervalMonth "; + break; + } + case 1389: { + s += " toIntervalQuarter "; + break; + } + case 1390: { + s += " toIntervalSecond "; + break; + } + case 1391: { + s += " toIntervalWeek "; + break; + } + case 1392: { + s += " toIntervalYear "; + break; + } + case 1393: { + s += " toIPv4 "; + break; + } + case 1394: { + s += " toIPv6 "; + break; + } + case 1395: { + s += " toISOWeek "; + break; + } + case 1396: { + s += " toISOYear "; + break; + } + case 1397: { + s += " toJSONString "; + break; + } + case 1398: { + s += " toLowCardinality "; + break; + } + case 1399: { + s += " toMinute "; + break; + } + case 1400: { + s += " toModifiedJulianDay "; + break; + } + case 1401: { + s += " toModifiedJulianDayOrNull "; + break; + } + case 1402: { + s += " toMonday "; + break; + } + case 1403: { + s += " toMonth "; + break; + } + case 1404: { + s += " toNullable "; + break; + } + case 1405: { + s += " TOP "; + break; + } + case 1406: { + s += " topK "; + break; + } + case 1407: { + s += " topKWeighted "; + break; + } + case 1408: { + s += " topLevelDomain "; + break; + } + case 1409: { + s += " toQuarter "; + break; + } + case 1410: { + s += " toRelativeDayNum "; + break; + } + case 1411: { + s += " toRelativeHourNum "; + break; + } + case 1412: { + s += " toRelativeMinuteNum "; + break; + } + case 1413: { + s += " toRelativeMonthNum "; + break; + } + case 1414: { + s += " toRelativeQuarterNum "; + break; + } + case 1415: { + s += " toRelativeSecondNum "; + break; + } + case 1416: { + s += " toRelativeWeekNum "; + break; + } + case 1417: { + s += " toRelativeYearNum "; + break; + } + case 1418: { + s += " toSecond "; + break; + } + case 1419: { + s += " toStartOfDay "; + break; + } + case 1420: { + s += " toStartOfFifteenMinutes "; + break; + } + case 1421: { + s += " toStartOfFiveMinutes "; + break; + } + case 1422: { + s += " toStartOfHour "; + break; + } + case 1423: { + s += " toStartOfInterval "; + break; + } + case 1424: { + s += " toStartOfISOYear "; + break; + } + case 1425: { + s += " toStartOfMinute "; + break; + } + case 1426: { + s += " toStartOfMonth "; + break; + } + case 1427: { + s += " toStartOfQuarter "; + break; + } + case 1428: { + s += " toStartOfSecond "; + break; + } + case 1429: { + s += " toStartOfTenMinutes "; + break; + } + case 1430: { + s += " toStartOfWeek "; + break; + } + case 1431: { + s += " toStartOfYear "; + break; + } + case 1432: { + s += " toString "; + break; + } + case 1433: { + s += " toStringCutToZero "; + break; + } + case 1434: { + s += " TO TABLE "; + break; + } + case 1435: { + s += " TOTALS "; + break; + } + case 1436: { + s += " toTime "; + break; + } + case 1437: { + s += " toTimezone "; + break; + } + case 1438: { + s += " toTimeZone "; + break; + } + case 1439: { + s += " toTypeName "; + break; + } + case 1440: { + s += " toUInt128 "; + break; + } + case 1441: { + s += " toUInt128OrNull "; + break; + } + case 1442: { + s += " toUInt128OrZero "; + break; + } + case 1443: { + s += " toUInt16 "; + break; + } + case 1444: { + s += " toUInt16OrNull "; + break; + } + case 1445: { + s += " toUInt16OrZero "; + break; + } + case 1446: { + s += " toUInt256 "; + break; + } + case 1447: { + s += " toUInt256OrNull "; + break; + } + case 1448: { + s += " toUInt256OrZero "; + break; + } + case 1449: { + s += " toUInt32 "; + break; + } + case 1450: { + s += " toUInt32OrNull "; + break; + } + case 1451: { + s += " toUInt32OrZero "; + break; + } + case 1452: { + s += " toUInt64 "; + break; + } + case 1453: { + s += " toUInt64OrNull "; + break; + } + case 1454: { + s += " toUInt64OrZero "; + break; + } + case 1455: { + s += " toUInt8 "; + break; + } + case 1456: { + s += " toUInt8OrNull "; + break; + } + case 1457: { + s += " toUInt8OrZero "; + break; + } + case 1458: { + s += " toUnixTimestamp "; + break; + } + case 1459: { + s += " toUnixTimestamp64Micro "; + break; + } + case 1460: { + s += " toUnixTimestamp64Milli "; + break; + } + case 1461: { + s += " toUnixTimestamp64Nano "; + break; + } + case 1462: { + s += " toUUID "; + break; + } + case 1463: { + s += " toUUIDOrNull "; + break; + } + case 1464: { + s += " toUUIDOrZero "; + break; + } + case 1465: { + s += " toValidUTF8 "; + break; + } + case 1466: { + s += " TO VOLUME "; + break; + } + case 1467: { + s += " toWeek "; + break; + } + case 1468: { + s += " toYear "; + break; + } + case 1469: { + s += " toYearWeek "; + break; + } + case 1470: { + s += " toYYYYMM "; + break; + } + case 1471: { + s += " toYYYYMMDD "; + break; + } + case 1472: { + s += " toYYYYMMDDhhmmss "; + break; + } + case 1473: { + s += " TRAILING "; + break; + } + case 1474: { + s += " transform "; + break; + } + case 1475: { + s += " TRIM "; + break; + } + case 1476: { + s += " trimBoth "; + break; + } + case 1477: { + s += " trimLeft "; + break; + } + case 1478: { + s += " trimRight "; + break; + } + case 1479: { + s += " trunc "; + break; + } + case 1480: { + s += " truncate "; + break; + } + case 1481: { + s += " TRUNCATE "; + break; + } + case 1482: { + s += " tryBase64Decode "; + break; + } + case 1483: { + s += " TTL "; + break; + } + case 1484: { + s += " tuple "; + break; + } + case 1485: { + s += " Tuple "; + break; + } + case 1486: { + s += " tupleElement "; + break; + } + case 1487: { + s += " tupleHammingDistance "; + break; + } + case 1488: { + s += " tupleToNameValuePairs "; + break; + } + case 1489: { + s += " TYPE "; + break; + } + case 1490: { + s += " ucase "; + break; + } + case 1491: { + s += " UInt128 "; + break; + } + case 1492: { + s += " UInt16 "; + break; + } + case 1493: { + s += " UInt256 "; + break; + } + case 1494: { + s += " UInt32 "; + break; + } + case 1495: { + s += " UInt64 "; + break; + } + case 1496: { + s += " UInt8 "; + break; + } + case 1497: { + s += " unbin "; + break; + } + case 1498: { + s += " unhex "; + break; + } + case 1499: { + s += " UNION "; + break; + } + case 1500: { + s += " uniq "; + break; + } + case 1501: { + s += " uniqCombined "; + break; + } + case 1502: { + s += " uniqCombined64 "; + break; + } + case 1503: { + s += " uniqExact "; + break; + } + case 1504: { + s += " uniqHLL12 "; + break; + } + case 1505: { + s += " uniqTheta "; + break; + } + case 1506: { + s += " uniqUpTo "; + break; + } + case 1507: { + s += " UPDATE "; + break; + } + case 1508: { + s += " upper "; + break; + } + case 1509: { + s += " upperUTF8 "; + break; + } + case 1510: { + s += " uptime "; + break; + } + case 1511: { + s += " URLHash "; + break; + } + case 1512: { + s += " URLHierarchy "; + break; + } + case 1513: { + s += " URLPathHierarchy "; + break; + } + case 1514: { + s += " USE "; + break; + } + case 1515: { + s += " user "; + break; + } + case 1516: { + s += " USING "; + break; + } + case 1517: { + s += " UUID "; + break; + } + case 1518: { + s += " UUIDNumToString "; + break; + } + case 1519: { + s += " UUIDStringToNum "; + break; + } + case 1520: { + s += " validateNestedArraySizes "; + break; + } + case 1521: { + s += " VALUES "; + break; + } + case 1522: { + s += " VARCHAR "; + break; + } + case 1523: { + s += " VARCHAR2 "; + break; + } + case 1524: { + s += " varPop "; + break; + } + case 1525: { + s += " VAR_POP "; + break; + } + case 1526: { + s += " varPopStable "; + break; + } + case 1527: { + s += " varSamp "; + break; + } + case 1528: { + s += " VAR_SAMP "; + break; + } + case 1529: { + s += " varSampStable "; + break; + } + case 1530: { + s += " version "; + break; + } + case 1531: { + s += " VIEW "; + break; + } + case 1532: { + s += " visibleWidth "; + break; + } + case 1533: { + s += " visitParamExtractBool "; + break; + } + case 1534: { + s += " visitParamExtractFloat "; + break; + } + case 1535: { + s += " visitParamExtractInt "; + break; + } + case 1536: { + s += " visitParamExtractRaw "; + break; + } + case 1537: { + s += " visitParamExtractString "; + break; + } + case 1538: { + s += " visitParamExtractUInt "; + break; + } + case 1539: { + s += " visitParamHas "; + break; + } + case 1540: { + s += " VOLUME "; + break; + } + case 1541: { + s += " WATCH "; + break; + } + case 1542: { + s += " week "; + break; + } + case 1543: { + s += " WEEK "; + break; + } + case 1544: { + s += " welchTTest "; + break; + } + case 1545: { + s += " WHEN "; + break; + } + case 1546: { + s += " WHERE "; + break; + } + case 1547: { + s += " windowFunnel "; + break; + } + case 1548: { + s += " WITH "; + break; + } + case 1549: { + s += " WITH FILL "; + break; + } + case 1550: { + s += " WITH TIES "; + break; + } + case 1551: { + s += " WK "; + break; + } + case 1552: { + s += " wkt "; + break; + } + case 1553: { + s += " wordShingleMinHash "; + break; + } + case 1554: { + s += " wordShingleMinHashArg "; + break; + } + case 1555: { + s += " wordShingleMinHashArgCaseInsensitive "; + break; + } + case 1556: { + s += " wordShingleMinHashArgCaseInsensitiveUTF8 "; + break; + } + case 1557: { + s += " wordShingleMinHashArgUTF8 "; + break; + } + case 1558: { + s += " wordShingleMinHashCaseInsensitive "; + break; + } + case 1559: { + s += " wordShingleMinHashCaseInsensitiveUTF8 "; + break; + } + case 1560: { + s += " wordShingleMinHashUTF8 "; + break; + } + case 1561: { + s += " wordShingleSimHash "; + break; + } + case 1562: { + s += " wordShingleSimHashCaseInsensitive "; + break; + } + case 1563: { + s += " wordShingleSimHashCaseInsensitiveUTF8 "; + break; + } + case 1564: { + s += " wordShingleSimHashUTF8 "; + break; + } + case 1565: { + s += " WW "; + break; + } + case 1566: { + s += " xor "; + break; + } + case 1567: { + s += " xxHash32 "; + break; + } + case 1568: { + s += " xxHash64 "; + break; + } + case 1569: { + s += " kostikConsistentHash "; + break; + } + case 1570: { + s += " YEAR "; + break; + } + case 1571: { + s += " yearweek "; + break; + } + case 1572: { + s += " yesterday "; + break; + } + case 1573: { + s += " YY "; + break; + } + case 1574: { + s += " YYYY "; + break; + } + case 1575: { + s += " zookeeperSessionUptime "; + break; + } + default: break; + } +} diff --git a/src/Parsers/fuzzers/codegen_fuzzer/out.proto b/src/Parsers/fuzzers/codegen_fuzzer/out.proto new file mode 100644 index 00000000000..60992ca6a81 --- /dev/null +++ b/src/Parsers/fuzzers/codegen_fuzzer/out.proto @@ -0,0 +1,1587 @@ +syntax = "proto3"; + +message Word { + enum Value { + value_0 = 0; + value_1 = 1; + value_2 = 2; + value_3 = 3; + value_4 = 4; + value_5 = 5; + value_6 = 6; + value_7 = 7; + value_8 = 8; + value_9 = 9; + value_10 = 10; + value_11 = 11; + value_12 = 12; + value_13 = 13; + value_14 = 14; + value_15 = 15; + value_16 = 16; + value_17 = 17; + value_18 = 18; + value_19 = 19; + value_20 = 20; + value_21 = 21; + value_22 = 22; + value_23 = 23; + value_24 = 24; + value_25 = 25; + value_26 = 26; + value_27 = 27; + value_28 = 28; + value_29 = 29; + value_30 = 30; + value_31 = 31; + value_32 = 32; + value_33 = 33; + value_34 = 34; + value_35 = 35; + value_36 = 36; + value_37 = 37; + value_38 = 38; + value_39 = 39; + value_40 = 40; + value_41 = 41; + value_42 = 42; + value_43 = 43; + value_44 = 44; + value_45 = 45; + value_46 = 46; + value_47 = 47; + value_48 = 48; + value_49 = 49; + value_50 = 50; + value_51 = 51; + value_52 = 52; + value_53 = 53; + value_54 = 54; + value_55 = 55; + value_56 = 56; + value_57 = 57; + value_58 = 58; + value_59 = 59; + value_60 = 60; + value_61 = 61; + value_62 = 62; + value_63 = 63; + value_64 = 64; + value_65 = 65; + value_66 = 66; + value_67 = 67; + value_68 = 68; + value_69 = 69; + value_70 = 70; + value_71 = 71; + value_72 = 72; + value_73 = 73; + value_74 = 74; + value_75 = 75; + value_76 = 76; + value_77 = 77; + value_78 = 78; + value_79 = 79; + value_80 = 80; + value_81 = 81; + value_82 = 82; + value_83 = 83; + value_84 = 84; + value_85 = 85; + value_86 = 86; + value_87 = 87; + value_88 = 88; + value_89 = 89; + value_90 = 90; + value_91 = 91; + value_92 = 92; + value_93 = 93; + value_94 = 94; + value_95 = 95; + value_96 = 96; + value_97 = 97; + value_98 = 98; + value_99 = 99; + value_100 = 100; + value_101 = 101; + value_102 = 102; + value_103 = 103; + value_104 = 104; + value_105 = 105; + value_106 = 106; + value_107 = 107; + value_108 = 108; + value_109 = 109; + value_110 = 110; + value_111 = 111; + value_112 = 112; + value_113 = 113; + value_114 = 114; + value_115 = 115; + value_116 = 116; + value_117 = 117; + value_118 = 118; + value_119 = 119; + value_120 = 120; + value_121 = 121; + value_122 = 122; + value_123 = 123; + value_124 = 124; + value_125 = 125; + value_126 = 126; + value_127 = 127; + value_128 = 128; + value_129 = 129; + value_130 = 130; + value_131 = 131; + value_132 = 132; + value_133 = 133; + value_134 = 134; + value_135 = 135; + value_136 = 136; + value_137 = 137; + value_138 = 138; + value_139 = 139; + value_140 = 140; + value_141 = 141; + value_142 = 142; + value_143 = 143; + value_144 = 144; + value_145 = 145; + value_146 = 146; + value_147 = 147; + value_148 = 148; + value_149 = 149; + value_150 = 150; + value_151 = 151; + value_152 = 152; + value_153 = 153; + value_154 = 154; + value_155 = 155; + value_156 = 156; + value_157 = 157; + value_158 = 158; + value_159 = 159; + value_160 = 160; + value_161 = 161; + value_162 = 162; + value_163 = 163; + value_164 = 164; + value_165 = 165; + value_166 = 166; + value_167 = 167; + value_168 = 168; + value_169 = 169; + value_170 = 170; + value_171 = 171; + value_172 = 172; + value_173 = 173; + value_174 = 174; + value_175 = 175; + value_176 = 176; + value_177 = 177; + value_178 = 178; + value_179 = 179; + value_180 = 180; + value_181 = 181; + value_182 = 182; + value_183 = 183; + value_184 = 184; + value_185 = 185; + value_186 = 186; + value_187 = 187; + value_188 = 188; + value_189 = 189; + value_190 = 190; + value_191 = 191; + value_192 = 192; + value_193 = 193; + value_194 = 194; + value_195 = 195; + value_196 = 196; + value_197 = 197; + value_198 = 198; + value_199 = 199; + value_200 = 200; + value_201 = 201; + value_202 = 202; + value_203 = 203; + value_204 = 204; + value_205 = 205; + value_206 = 206; + value_207 = 207; + value_208 = 208; + value_209 = 209; + value_210 = 210; + value_211 = 211; + value_212 = 212; + value_213 = 213; + value_214 = 214; + value_215 = 215; + value_216 = 216; + value_217 = 217; + value_218 = 218; + value_219 = 219; + value_220 = 220; + value_221 = 221; + value_222 = 222; + value_223 = 223; + value_224 = 224; + value_225 = 225; + value_226 = 226; + value_227 = 227; + value_228 = 228; + value_229 = 229; + value_230 = 230; + value_231 = 231; + value_232 = 232; + value_233 = 233; + value_234 = 234; + value_235 = 235; + value_236 = 236; + value_237 = 237; + value_238 = 238; + value_239 = 239; + value_240 = 240; + value_241 = 241; + value_242 = 242; + value_243 = 243; + value_244 = 244; + value_245 = 245; + value_246 = 246; + value_247 = 247; + value_248 = 248; + value_249 = 249; + value_250 = 250; + value_251 = 251; + value_252 = 252; + value_253 = 253; + value_254 = 254; + value_255 = 255; + value_256 = 256; + value_257 = 257; + value_258 = 258; + value_259 = 259; + value_260 = 260; + value_261 = 261; + value_262 = 262; + value_263 = 263; + value_264 = 264; + value_265 = 265; + value_266 = 266; + value_267 = 267; + value_268 = 268; + value_269 = 269; + value_270 = 270; + value_271 = 271; + value_272 = 272; + value_273 = 273; + value_274 = 274; + value_275 = 275; + value_276 = 276; + value_277 = 277; + value_278 = 278; + value_279 = 279; + value_280 = 280; + value_281 = 281; + value_282 = 282; + value_283 = 283; + value_284 = 284; + value_285 = 285; + value_286 = 286; + value_287 = 287; + value_288 = 288; + value_289 = 289; + value_290 = 290; + value_291 = 291; + value_292 = 292; + value_293 = 293; + value_294 = 294; + value_295 = 295; + value_296 = 296; + value_297 = 297; + value_298 = 298; + value_299 = 299; + value_300 = 300; + value_301 = 301; + value_302 = 302; + value_303 = 303; + value_304 = 304; + value_305 = 305; + value_306 = 306; + value_307 = 307; + value_308 = 308; + value_309 = 309; + value_310 = 310; + value_311 = 311; + value_312 = 312; + value_313 = 313; + value_314 = 314; + value_315 = 315; + value_316 = 316; + value_317 = 317; + value_318 = 318; + value_319 = 319; + value_320 = 320; + value_321 = 321; + value_322 = 322; + value_323 = 323; + value_324 = 324; + value_325 = 325; + value_326 = 326; + value_327 = 327; + value_328 = 328; + value_329 = 329; + value_330 = 330; + value_331 = 331; + value_332 = 332; + value_333 = 333; + value_334 = 334; + value_335 = 335; + value_336 = 336; + value_337 = 337; + value_338 = 338; + value_339 = 339; + value_340 = 340; + value_341 = 341; + value_342 = 342; + value_343 = 343; + value_344 = 344; + value_345 = 345; + value_346 = 346; + value_347 = 347; + value_348 = 348; + value_349 = 349; + value_350 = 350; + value_351 = 351; + value_352 = 352; + value_353 = 353; + value_354 = 354; + value_355 = 355; + value_356 = 356; + value_357 = 357; + value_358 = 358; + value_359 = 359; + value_360 = 360; + value_361 = 361; + value_362 = 362; + value_363 = 363; + value_364 = 364; + value_365 = 365; + value_366 = 366; + value_367 = 367; + value_368 = 368; + value_369 = 369; + value_370 = 370; + value_371 = 371; + value_372 = 372; + value_373 = 373; + value_374 = 374; + value_375 = 375; + value_376 = 376; + value_377 = 377; + value_378 = 378; + value_379 = 379; + value_380 = 380; + value_381 = 381; + value_382 = 382; + value_383 = 383; + value_384 = 384; + value_385 = 385; + value_386 = 386; + value_387 = 387; + value_388 = 388; + value_389 = 389; + value_390 = 390; + value_391 = 391; + value_392 = 392; + value_393 = 393; + value_394 = 394; + value_395 = 395; + value_396 = 396; + value_397 = 397; + value_398 = 398; + value_399 = 399; + value_400 = 400; + value_401 = 401; + value_402 = 402; + value_403 = 403; + value_404 = 404; + value_405 = 405; + value_406 = 406; + value_407 = 407; + value_408 = 408; + value_409 = 409; + value_410 = 410; + value_411 = 411; + value_412 = 412; + value_413 = 413; + value_414 = 414; + value_415 = 415; + value_416 = 416; + value_417 = 417; + value_418 = 418; + value_419 = 419; + value_420 = 420; + value_421 = 421; + value_422 = 422; + value_423 = 423; + value_424 = 424; + value_425 = 425; + value_426 = 426; + value_427 = 427; + value_428 = 428; + value_429 = 429; + value_430 = 430; + value_431 = 431; + value_432 = 432; + value_433 = 433; + value_434 = 434; + value_435 = 435; + value_436 = 436; + value_437 = 437; + value_438 = 438; + value_439 = 439; + value_440 = 440; + value_441 = 441; + value_442 = 442; + value_443 = 443; + value_444 = 444; + value_445 = 445; + value_446 = 446; + value_447 = 447; + value_448 = 448; + value_449 = 449; + value_450 = 450; + value_451 = 451; + value_452 = 452; + value_453 = 453; + value_454 = 454; + value_455 = 455; + value_456 = 456; + value_457 = 457; + value_458 = 458; + value_459 = 459; + value_460 = 460; + value_461 = 461; + value_462 = 462; + value_463 = 463; + value_464 = 464; + value_465 = 465; + value_466 = 466; + value_467 = 467; + value_468 = 468; + value_469 = 469; + value_470 = 470; + value_471 = 471; + value_472 = 472; + value_473 = 473; + value_474 = 474; + value_475 = 475; + value_476 = 476; + value_477 = 477; + value_478 = 478; + value_479 = 479; + value_480 = 480; + value_481 = 481; + value_482 = 482; + value_483 = 483; + value_484 = 484; + value_485 = 485; + value_486 = 486; + value_487 = 487; + value_488 = 488; + value_489 = 489; + value_490 = 490; + value_491 = 491; + value_492 = 492; + value_493 = 493; + value_494 = 494; + value_495 = 495; + value_496 = 496; + value_497 = 497; + value_498 = 498; + value_499 = 499; + value_500 = 500; + value_501 = 501; + value_502 = 502; + value_503 = 503; + value_504 = 504; + value_505 = 505; + value_506 = 506; + value_507 = 507; + value_508 = 508; + value_509 = 509; + value_510 = 510; + value_511 = 511; + value_512 = 512; + value_513 = 513; + value_514 = 514; + value_515 = 515; + value_516 = 516; + value_517 = 517; + value_518 = 518; + value_519 = 519; + value_520 = 520; + value_521 = 521; + value_522 = 522; + value_523 = 523; + value_524 = 524; + value_525 = 525; + value_526 = 526; + value_527 = 527; + value_528 = 528; + value_529 = 529; + value_530 = 530; + value_531 = 531; + value_532 = 532; + value_533 = 533; + value_534 = 534; + value_535 = 535; + value_536 = 536; + value_537 = 537; + value_538 = 538; + value_539 = 539; + value_540 = 540; + value_541 = 541; + value_542 = 542; + value_543 = 543; + value_544 = 544; + value_545 = 545; + value_546 = 546; + value_547 = 547; + value_548 = 548; + value_549 = 549; + value_550 = 550; + value_551 = 551; + value_552 = 552; + value_553 = 553; + value_554 = 554; + value_555 = 555; + value_556 = 556; + value_557 = 557; + value_558 = 558; + value_559 = 559; + value_560 = 560; + value_561 = 561; + value_562 = 562; + value_563 = 563; + value_564 = 564; + value_565 = 565; + value_566 = 566; + value_567 = 567; + value_568 = 568; + value_569 = 569; + value_570 = 570; + value_571 = 571; + value_572 = 572; + value_573 = 573; + value_574 = 574; + value_575 = 575; + value_576 = 576; + value_577 = 577; + value_578 = 578; + value_579 = 579; + value_580 = 580; + value_581 = 581; + value_582 = 582; + value_583 = 583; + value_584 = 584; + value_585 = 585; + value_586 = 586; + value_587 = 587; + value_588 = 588; + value_589 = 589; + value_590 = 590; + value_591 = 591; + value_592 = 592; + value_593 = 593; + value_594 = 594; + value_595 = 595; + value_596 = 596; + value_597 = 597; + value_598 = 598; + value_599 = 599; + value_600 = 600; + value_601 = 601; + value_602 = 602; + value_603 = 603; + value_604 = 604; + value_605 = 605; + value_606 = 606; + value_607 = 607; + value_608 = 608; + value_609 = 609; + value_610 = 610; + value_611 = 611; + value_612 = 612; + value_613 = 613; + value_614 = 614; + value_615 = 615; + value_616 = 616; + value_617 = 617; + value_618 = 618; + value_619 = 619; + value_620 = 620; + value_621 = 621; + value_622 = 622; + value_623 = 623; + value_624 = 624; + value_625 = 625; + value_626 = 626; + value_627 = 627; + value_628 = 628; + value_629 = 629; + value_630 = 630; + value_631 = 631; + value_632 = 632; + value_633 = 633; + value_634 = 634; + value_635 = 635; + value_636 = 636; + value_637 = 637; + value_638 = 638; + value_639 = 639; + value_640 = 640; + value_641 = 641; + value_642 = 642; + value_643 = 643; + value_644 = 644; + value_645 = 645; + value_646 = 646; + value_647 = 647; + value_648 = 648; + value_649 = 649; + value_650 = 650; + value_651 = 651; + value_652 = 652; + value_653 = 653; + value_654 = 654; + value_655 = 655; + value_656 = 656; + value_657 = 657; + value_658 = 658; + value_659 = 659; + value_660 = 660; + value_661 = 661; + value_662 = 662; + value_663 = 663; + value_664 = 664; + value_665 = 665; + value_666 = 666; + value_667 = 667; + value_668 = 668; + value_669 = 669; + value_670 = 670; + value_671 = 671; + value_672 = 672; + value_673 = 673; + value_674 = 674; + value_675 = 675; + value_676 = 676; + value_677 = 677; + value_678 = 678; + value_679 = 679; + value_680 = 680; + value_681 = 681; + value_682 = 682; + value_683 = 683; + value_684 = 684; + value_685 = 685; + value_686 = 686; + value_687 = 687; + value_688 = 688; + value_689 = 689; + value_690 = 690; + value_691 = 691; + value_692 = 692; + value_693 = 693; + value_694 = 694; + value_695 = 695; + value_696 = 696; + value_697 = 697; + value_698 = 698; + value_699 = 699; + value_700 = 700; + value_701 = 701; + value_702 = 702; + value_703 = 703; + value_704 = 704; + value_705 = 705; + value_706 = 706; + value_707 = 707; + value_708 = 708; + value_709 = 709; + value_710 = 710; + value_711 = 711; + value_712 = 712; + value_713 = 713; + value_714 = 714; + value_715 = 715; + value_716 = 716; + value_717 = 717; + value_718 = 718; + value_719 = 719; + value_720 = 720; + value_721 = 721; + value_722 = 722; + value_723 = 723; + value_724 = 724; + value_725 = 725; + value_726 = 726; + value_727 = 727; + value_728 = 728; + value_729 = 729; + value_730 = 730; + value_731 = 731; + value_732 = 732; + value_733 = 733; + value_734 = 734; + value_735 = 735; + value_736 = 736; + value_737 = 737; + value_738 = 738; + value_739 = 739; + value_740 = 740; + value_741 = 741; + value_742 = 742; + value_743 = 743; + value_744 = 744; + value_745 = 745; + value_746 = 746; + value_747 = 747; + value_748 = 748; + value_749 = 749; + value_750 = 750; + value_751 = 751; + value_752 = 752; + value_753 = 753; + value_754 = 754; + value_755 = 755; + value_756 = 756; + value_757 = 757; + value_758 = 758; + value_759 = 759; + value_760 = 760; + value_761 = 761; + value_762 = 762; + value_763 = 763; + value_764 = 764; + value_765 = 765; + value_766 = 766; + value_767 = 767; + value_768 = 768; + value_769 = 769; + value_770 = 770; + value_771 = 771; + value_772 = 772; + value_773 = 773; + value_774 = 774; + value_775 = 775; + value_776 = 776; + value_777 = 777; + value_778 = 778; + value_779 = 779; + value_780 = 780; + value_781 = 781; + value_782 = 782; + value_783 = 783; + value_784 = 784; + value_785 = 785; + value_786 = 786; + value_787 = 787; + value_788 = 788; + value_789 = 789; + value_790 = 790; + value_791 = 791; + value_792 = 792; + value_793 = 793; + value_794 = 794; + value_795 = 795; + value_796 = 796; + value_797 = 797; + value_798 = 798; + value_799 = 799; + value_800 = 800; + value_801 = 801; + value_802 = 802; + value_803 = 803; + value_804 = 804; + value_805 = 805; + value_806 = 806; + value_807 = 807; + value_808 = 808; + value_809 = 809; + value_810 = 810; + value_811 = 811; + value_812 = 812; + value_813 = 813; + value_814 = 814; + value_815 = 815; + value_816 = 816; + value_817 = 817; + value_818 = 818; + value_819 = 819; + value_820 = 820; + value_821 = 821; + value_822 = 822; + value_823 = 823; + value_824 = 824; + value_825 = 825; + value_826 = 826; + value_827 = 827; + value_828 = 828; + value_829 = 829; + value_830 = 830; + value_831 = 831; + value_832 = 832; + value_833 = 833; + value_834 = 834; + value_835 = 835; + value_836 = 836; + value_837 = 837; + value_838 = 838; + value_839 = 839; + value_840 = 840; + value_841 = 841; + value_842 = 842; + value_843 = 843; + value_844 = 844; + value_845 = 845; + value_846 = 846; + value_847 = 847; + value_848 = 848; + value_849 = 849; + value_850 = 850; + value_851 = 851; + value_852 = 852; + value_853 = 853; + value_854 = 854; + value_855 = 855; + value_856 = 856; + value_857 = 857; + value_858 = 858; + value_859 = 859; + value_860 = 860; + value_861 = 861; + value_862 = 862; + value_863 = 863; + value_864 = 864; + value_865 = 865; + value_866 = 866; + value_867 = 867; + value_868 = 868; + value_869 = 869; + value_870 = 870; + value_871 = 871; + value_872 = 872; + value_873 = 873; + value_874 = 874; + value_875 = 875; + value_876 = 876; + value_877 = 877; + value_878 = 878; + value_879 = 879; + value_880 = 880; + value_881 = 881; + value_882 = 882; + value_883 = 883; + value_884 = 884; + value_885 = 885; + value_886 = 886; + value_887 = 887; + value_888 = 888; + value_889 = 889; + value_890 = 890; + value_891 = 891; + value_892 = 892; + value_893 = 893; + value_894 = 894; + value_895 = 895; + value_896 = 896; + value_897 = 897; + value_898 = 898; + value_899 = 899; + value_900 = 900; + value_901 = 901; + value_902 = 902; + value_903 = 903; + value_904 = 904; + value_905 = 905; + value_906 = 906; + value_907 = 907; + value_908 = 908; + value_909 = 909; + value_910 = 910; + value_911 = 911; + value_912 = 912; + value_913 = 913; + value_914 = 914; + value_915 = 915; + value_916 = 916; + value_917 = 917; + value_918 = 918; + value_919 = 919; + value_920 = 920; + value_921 = 921; + value_922 = 922; + value_923 = 923; + value_924 = 924; + value_925 = 925; + value_926 = 926; + value_927 = 927; + value_928 = 928; + value_929 = 929; + value_930 = 930; + value_931 = 931; + value_932 = 932; + value_933 = 933; + value_934 = 934; + value_935 = 935; + value_936 = 936; + value_937 = 937; + value_938 = 938; + value_939 = 939; + value_940 = 940; + value_941 = 941; + value_942 = 942; + value_943 = 943; + value_944 = 944; + value_945 = 945; + value_946 = 946; + value_947 = 947; + value_948 = 948; + value_949 = 949; + value_950 = 950; + value_951 = 951; + value_952 = 952; + value_953 = 953; + value_954 = 954; + value_955 = 955; + value_956 = 956; + value_957 = 957; + value_958 = 958; + value_959 = 959; + value_960 = 960; + value_961 = 961; + value_962 = 962; + value_963 = 963; + value_964 = 964; + value_965 = 965; + value_966 = 966; + value_967 = 967; + value_968 = 968; + value_969 = 969; + value_970 = 970; + value_971 = 971; + value_972 = 972; + value_973 = 973; + value_974 = 974; + value_975 = 975; + value_976 = 976; + value_977 = 977; + value_978 = 978; + value_979 = 979; + value_980 = 980; + value_981 = 981; + value_982 = 982; + value_983 = 983; + value_984 = 984; + value_985 = 985; + value_986 = 986; + value_987 = 987; + value_988 = 988; + value_989 = 989; + value_990 = 990; + value_991 = 991; + value_992 = 992; + value_993 = 993; + value_994 = 994; + value_995 = 995; + value_996 = 996; + value_997 = 997; + value_998 = 998; + value_999 = 999; + value_1000 = 1000; + value_1001 = 1001; + value_1002 = 1002; + value_1003 = 1003; + value_1004 = 1004; + value_1005 = 1005; + value_1006 = 1006; + value_1007 = 1007; + value_1008 = 1008; + value_1009 = 1009; + value_1010 = 1010; + value_1011 = 1011; + value_1012 = 1012; + value_1013 = 1013; + value_1014 = 1014; + value_1015 = 1015; + value_1016 = 1016; + value_1017 = 1017; + value_1018 = 1018; + value_1019 = 1019; + value_1020 = 1020; + value_1021 = 1021; + value_1022 = 1022; + value_1023 = 1023; + value_1024 = 1024; + value_1025 = 1025; + value_1026 = 1026; + value_1027 = 1027; + value_1028 = 1028; + value_1029 = 1029; + value_1030 = 1030; + value_1031 = 1031; + value_1032 = 1032; + value_1033 = 1033; + value_1034 = 1034; + value_1035 = 1035; + value_1036 = 1036; + value_1037 = 1037; + value_1038 = 1038; + value_1039 = 1039; + value_1040 = 1040; + value_1041 = 1041; + value_1042 = 1042; + value_1043 = 1043; + value_1044 = 1044; + value_1045 = 1045; + value_1046 = 1046; + value_1047 = 1047; + value_1048 = 1048; + value_1049 = 1049; + value_1050 = 1050; + value_1051 = 1051; + value_1052 = 1052; + value_1053 = 1053; + value_1054 = 1054; + value_1055 = 1055; + value_1056 = 1056; + value_1057 = 1057; + value_1058 = 1058; + value_1059 = 1059; + value_1060 = 1060; + value_1061 = 1061; + value_1062 = 1062; + value_1063 = 1063; + value_1064 = 1064; + value_1065 = 1065; + value_1066 = 1066; + value_1067 = 1067; + value_1068 = 1068; + value_1069 = 1069; + value_1070 = 1070; + value_1071 = 1071; + value_1072 = 1072; + value_1073 = 1073; + value_1074 = 1074; + value_1075 = 1075; + value_1076 = 1076; + value_1077 = 1077; + value_1078 = 1078; + value_1079 = 1079; + value_1080 = 1080; + value_1081 = 1081; + value_1082 = 1082; + value_1083 = 1083; + value_1084 = 1084; + value_1085 = 1085; + value_1086 = 1086; + value_1087 = 1087; + value_1088 = 1088; + value_1089 = 1089; + value_1090 = 1090; + value_1091 = 1091; + value_1092 = 1092; + value_1093 = 1093; + value_1094 = 1094; + value_1095 = 1095; + value_1096 = 1096; + value_1097 = 1097; + value_1098 = 1098; + value_1099 = 1099; + value_1100 = 1100; + value_1101 = 1101; + value_1102 = 1102; + value_1103 = 1103; + value_1104 = 1104; + value_1105 = 1105; + value_1106 = 1106; + value_1107 = 1107; + value_1108 = 1108; + value_1109 = 1109; + value_1110 = 1110; + value_1111 = 1111; + value_1112 = 1112; + value_1113 = 1113; + value_1114 = 1114; + value_1115 = 1115; + value_1116 = 1116; + value_1117 = 1117; + value_1118 = 1118; + value_1119 = 1119; + value_1120 = 1120; + value_1121 = 1121; + value_1122 = 1122; + value_1123 = 1123; + value_1124 = 1124; + value_1125 = 1125; + value_1126 = 1126; + value_1127 = 1127; + value_1128 = 1128; + value_1129 = 1129; + value_1130 = 1130; + value_1131 = 1131; + value_1132 = 1132; + value_1133 = 1133; + value_1134 = 1134; + value_1135 = 1135; + value_1136 = 1136; + value_1137 = 1137; + value_1138 = 1138; + value_1139 = 1139; + value_1140 = 1140; + value_1141 = 1141; + value_1142 = 1142; + value_1143 = 1143; + value_1144 = 1144; + value_1145 = 1145; + value_1146 = 1146; + value_1147 = 1147; + value_1148 = 1148; + value_1149 = 1149; + value_1150 = 1150; + value_1151 = 1151; + value_1152 = 1152; + value_1153 = 1153; + value_1154 = 1154; + value_1155 = 1155; + value_1156 = 1156; + value_1157 = 1157; + value_1158 = 1158; + value_1159 = 1159; + value_1160 = 1160; + value_1161 = 1161; + value_1162 = 1162; + value_1163 = 1163; + value_1164 = 1164; + value_1165 = 1165; + value_1166 = 1166; + value_1167 = 1167; + value_1168 = 1168; + value_1169 = 1169; + value_1170 = 1170; + value_1171 = 1171; + value_1172 = 1172; + value_1173 = 1173; + value_1174 = 1174; + value_1175 = 1175; + value_1176 = 1176; + value_1177 = 1177; + value_1178 = 1178; + value_1179 = 1179; + value_1180 = 1180; + value_1181 = 1181; + value_1182 = 1182; + value_1183 = 1183; + value_1184 = 1184; + value_1185 = 1185; + value_1186 = 1186; + value_1187 = 1187; + value_1188 = 1188; + value_1189 = 1189; + value_1190 = 1190; + value_1191 = 1191; + value_1192 = 1192; + value_1193 = 1193; + value_1194 = 1194; + value_1195 = 1195; + value_1196 = 1196; + value_1197 = 1197; + value_1198 = 1198; + value_1199 = 1199; + value_1200 = 1200; + value_1201 = 1201; + value_1202 = 1202; + value_1203 = 1203; + value_1204 = 1204; + value_1205 = 1205; + value_1206 = 1206; + value_1207 = 1207; + value_1208 = 1208; + value_1209 = 1209; + value_1210 = 1210; + value_1211 = 1211; + value_1212 = 1212; + value_1213 = 1213; + value_1214 = 1214; + value_1215 = 1215; + value_1216 = 1216; + value_1217 = 1217; + value_1218 = 1218; + value_1219 = 1219; + value_1220 = 1220; + value_1221 = 1221; + value_1222 = 1222; + value_1223 = 1223; + value_1224 = 1224; + value_1225 = 1225; + value_1226 = 1226; + value_1227 = 1227; + value_1228 = 1228; + value_1229 = 1229; + value_1230 = 1230; + value_1231 = 1231; + value_1232 = 1232; + value_1233 = 1233; + value_1234 = 1234; + value_1235 = 1235; + value_1236 = 1236; + value_1237 = 1237; + value_1238 = 1238; + value_1239 = 1239; + value_1240 = 1240; + value_1241 = 1241; + value_1242 = 1242; + value_1243 = 1243; + value_1244 = 1244; + value_1245 = 1245; + value_1246 = 1246; + value_1247 = 1247; + value_1248 = 1248; + value_1249 = 1249; + value_1250 = 1250; + value_1251 = 1251; + value_1252 = 1252; + value_1253 = 1253; + value_1254 = 1254; + value_1255 = 1255; + value_1256 = 1256; + value_1257 = 1257; + value_1258 = 1258; + value_1259 = 1259; + value_1260 = 1260; + value_1261 = 1261; + value_1262 = 1262; + value_1263 = 1263; + value_1264 = 1264; + value_1265 = 1265; + value_1266 = 1266; + value_1267 = 1267; + value_1268 = 1268; + value_1269 = 1269; + value_1270 = 1270; + value_1271 = 1271; + value_1272 = 1272; + value_1273 = 1273; + value_1274 = 1274; + value_1275 = 1275; + value_1276 = 1276; + value_1277 = 1277; + value_1278 = 1278; + value_1279 = 1279; + value_1280 = 1280; + value_1281 = 1281; + value_1282 = 1282; + value_1283 = 1283; + value_1284 = 1284; + value_1285 = 1285; + value_1286 = 1286; + value_1287 = 1287; + value_1288 = 1288; + value_1289 = 1289; + value_1290 = 1290; + value_1291 = 1291; + value_1292 = 1292; + value_1293 = 1293; + value_1294 = 1294; + value_1295 = 1295; + value_1296 = 1296; + value_1297 = 1297; + value_1298 = 1298; + value_1299 = 1299; + value_1300 = 1300; + value_1301 = 1301; + value_1302 = 1302; + value_1303 = 1303; + value_1304 = 1304; + value_1305 = 1305; + value_1306 = 1306; + value_1307 = 1307; + value_1308 = 1308; + value_1309 = 1309; + value_1310 = 1310; + value_1311 = 1311; + value_1312 = 1312; + value_1313 = 1313; + value_1314 = 1314; + value_1315 = 1315; + value_1316 = 1316; + value_1317 = 1317; + value_1318 = 1318; + value_1319 = 1319; + value_1320 = 1320; + value_1321 = 1321; + value_1322 = 1322; + value_1323 = 1323; + value_1324 = 1324; + value_1325 = 1325; + value_1326 = 1326; + value_1327 = 1327; + value_1328 = 1328; + value_1329 = 1329; + value_1330 = 1330; + value_1331 = 1331; + value_1332 = 1332; + value_1333 = 1333; + value_1334 = 1334; + value_1335 = 1335; + value_1336 = 1336; + value_1337 = 1337; + value_1338 = 1338; + value_1339 = 1339; + value_1340 = 1340; + value_1341 = 1341; + value_1342 = 1342; + value_1343 = 1343; + value_1344 = 1344; + value_1345 = 1345; + value_1346 = 1346; + value_1347 = 1347; + value_1348 = 1348; + value_1349 = 1349; + value_1350 = 1350; + value_1351 = 1351; + value_1352 = 1352; + value_1353 = 1353; + value_1354 = 1354; + value_1355 = 1355; + value_1356 = 1356; + value_1357 = 1357; + value_1358 = 1358; + value_1359 = 1359; + value_1360 = 1360; + value_1361 = 1361; + value_1362 = 1362; + value_1363 = 1363; + value_1364 = 1364; + value_1365 = 1365; + value_1366 = 1366; + value_1367 = 1367; + value_1368 = 1368; + value_1369 = 1369; + value_1370 = 1370; + value_1371 = 1371; + value_1372 = 1372; + value_1373 = 1373; + value_1374 = 1374; + value_1375 = 1375; + value_1376 = 1376; + value_1377 = 1377; + value_1378 = 1378; + value_1379 = 1379; + value_1380 = 1380; + value_1381 = 1381; + value_1382 = 1382; + value_1383 = 1383; + value_1384 = 1384; + value_1385 = 1385; + value_1386 = 1386; + value_1387 = 1387; + value_1388 = 1388; + value_1389 = 1389; + value_1390 = 1390; + value_1391 = 1391; + value_1392 = 1392; + value_1393 = 1393; + value_1394 = 1394; + value_1395 = 1395; + value_1396 = 1396; + value_1397 = 1397; + value_1398 = 1398; + value_1399 = 1399; + value_1400 = 1400; + value_1401 = 1401; + value_1402 = 1402; + value_1403 = 1403; + value_1404 = 1404; + value_1405 = 1405; + value_1406 = 1406; + value_1407 = 1407; + value_1408 = 1408; + value_1409 = 1409; + value_1410 = 1410; + value_1411 = 1411; + value_1412 = 1412; + value_1413 = 1413; + value_1414 = 1414; + value_1415 = 1415; + value_1416 = 1416; + value_1417 = 1417; + value_1418 = 1418; + value_1419 = 1419; + value_1420 = 1420; + value_1421 = 1421; + value_1422 = 1422; + value_1423 = 1423; + value_1424 = 1424; + value_1425 = 1425; + value_1426 = 1426; + value_1427 = 1427; + value_1428 = 1428; + value_1429 = 1429; + value_1430 = 1430; + value_1431 = 1431; + value_1432 = 1432; + value_1433 = 1433; + value_1434 = 1434; + value_1435 = 1435; + value_1436 = 1436; + value_1437 = 1437; + value_1438 = 1438; + value_1439 = 1439; + value_1440 = 1440; + value_1441 = 1441; + value_1442 = 1442; + value_1443 = 1443; + value_1444 = 1444; + value_1445 = 1445; + value_1446 = 1446; + value_1447 = 1447; + value_1448 = 1448; + value_1449 = 1449; + value_1450 = 1450; + value_1451 = 1451; + value_1452 = 1452; + value_1453 = 1453; + value_1454 = 1454; + value_1455 = 1455; + value_1456 = 1456; + value_1457 = 1457; + value_1458 = 1458; + value_1459 = 1459; + value_1460 = 1460; + value_1461 = 1461; + value_1462 = 1462; + value_1463 = 1463; + value_1464 = 1464; + value_1465 = 1465; + value_1466 = 1466; + value_1467 = 1467; + value_1468 = 1468; + value_1469 = 1469; + value_1470 = 1470; + value_1471 = 1471; + value_1472 = 1472; + value_1473 = 1473; + value_1474 = 1474; + value_1475 = 1475; + value_1476 = 1476; + value_1477 = 1477; + value_1478 = 1478; + value_1479 = 1479; + value_1480 = 1480; + value_1481 = 1481; + value_1482 = 1482; + value_1483 = 1483; + value_1484 = 1484; + value_1485 = 1485; + value_1486 = 1486; + value_1487 = 1487; + value_1488 = 1488; + value_1489 = 1489; + value_1490 = 1490; + value_1491 = 1491; + value_1492 = 1492; + value_1493 = 1493; + value_1494 = 1494; + value_1495 = 1495; + value_1496 = 1496; + value_1497 = 1497; + value_1498 = 1498; + value_1499 = 1499; + value_1500 = 1500; + value_1501 = 1501; + value_1502 = 1502; + value_1503 = 1503; + value_1504 = 1504; + value_1505 = 1505; + value_1506 = 1506; + value_1507 = 1507; + value_1508 = 1508; + value_1509 = 1509; + value_1510 = 1510; + value_1511 = 1511; + value_1512 = 1512; + value_1513 = 1513; + value_1514 = 1514; + value_1515 = 1515; + value_1516 = 1516; + value_1517 = 1517; + value_1518 = 1518; + value_1519 = 1519; + value_1520 = 1520; + value_1521 = 1521; + value_1522 = 1522; + value_1523 = 1523; + value_1524 = 1524; + value_1525 = 1525; + value_1526 = 1526; + value_1527 = 1527; + value_1528 = 1528; + value_1529 = 1529; + value_1530 = 1530; + value_1531 = 1531; + value_1532 = 1532; + value_1533 = 1533; + value_1534 = 1534; + value_1535 = 1535; + value_1536 = 1536; + value_1537 = 1537; + value_1538 = 1538; + value_1539 = 1539; + value_1540 = 1540; + value_1541 = 1541; + value_1542 = 1542; + value_1543 = 1543; + value_1544 = 1544; + value_1545 = 1545; + value_1546 = 1546; + value_1547 = 1547; + value_1548 = 1548; + value_1549 = 1549; + value_1550 = 1550; + value_1551 = 1551; + value_1552 = 1552; + value_1553 = 1553; + value_1554 = 1554; + value_1555 = 1555; + value_1556 = 1556; + value_1557 = 1557; + value_1558 = 1558; + value_1559 = 1559; + value_1560 = 1560; + value_1561 = 1561; + value_1562 = 1562; + value_1563 = 1563; + value_1564 = 1564; + value_1565 = 1565; + value_1566 = 1566; + value_1567 = 1567; + value_1568 = 1568; + value_1569 = 1569; + value_1570 = 1570; + value_1571 = 1571; + value_1572 = 1572; + value_1573 = 1573; + value_1574 = 1574; + value_1575 = 1575; + } + Value value = 1; + Sentence inner = 2; +} +message Sentence { + repeated Word words = 1; +} From 811ba86a20c67a6cebb70ae0574f9d124e3678ec Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 4 Jul 2023 00:24:35 +0200 Subject: [PATCH 33/63] Remove garbage --- .../fuzzers/codegen_fuzzer/clickhouse.g | 1592 ---- src/Parsers/fuzzers/codegen_fuzzer/out.cpp | 6461 ----------------- src/Parsers/fuzzers/codegen_fuzzer/out.proto | 1587 ---- 3 files changed, 9640 deletions(-) delete mode 100644 src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g delete mode 100644 src/Parsers/fuzzers/codegen_fuzzer/out.cpp delete mode 100644 src/Parsers/fuzzers/codegen_fuzzer/out.proto diff --git a/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g b/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g deleted file mode 100644 index 0ae74055eda..00000000000 --- a/src/Parsers/fuzzers/codegen_fuzzer/clickhouse.g +++ /dev/null @@ -1,1592 +0,0 @@ -" "; -" "; -" "; -";"; - - -"(" $1 ")"; -"(" $1 ", " $2 ")"; -"(" $1 ", " $2 ", " $3 ")"; - -$1 ", " $2 ; -$1 ", " $2 ", " $3 ; -$1 ", " $2 ", " $3 ", " $4 ; -$1 ", " $2 ", " $3 ", " $4 ", " $5 ; - -"[" $1 ", " $2 "]"; -"[" $1 ", " $2 ", " $3 "]"; -"[" $1 ", " $2 ", " $3 ", " $4 "]"; -"[" $1 ", " $2 ", " $3 ", " $4 ", " $5 "]"; - -$0 "(" $1 ")"; -$0 "(" $1 ", " $2 ")"; -$0 "(" $1 ", " $2 ", " $3 ")"; - -$1 " as " $2 ; - - -// TODO: add more clickhouse specific stuff -"SELECT " $1 " FROM " $2 " WHERE " $3 ; -"SELECT " $1 " FROM " $2 " GROUP BY " $3 ; -"SELECT " $1 " FROM " $2 " SORT BY " $3 ; -"SELECT " $1 " FROM " $2 " LIMIT " $3 ; -"SELECT " $1 " FROM " $2 " JOIN " $3 ; -"SELECT " $1 " FROM " $2 " ARRAY JOIN " $3 ; -"SELECT " $1 " FROM " $2 " JOIN " $3 " ON " $4 ; -"SELECT " $1 " FROM " $2 " JOIN " $3 " USING " $5 ; -"SELECT " $1 " INTO OUTFILE " $2 ; - -"WITH " $1 " AS " $2 ; - -"{" $1 ":" $2 "}"; -"[" $1 "," $2 "]"; -"[]"; - - -" x "; -"x"; -" `x` "; -"`x`"; - -" \"value\" "; -"\"value\""; -" 0 "; -"0"; -"1"; -"2"; -"123123123123123123"; -"182374019873401982734091873420923123123123123123"; -"1e-1"; -"1.1"; -"\"\""; -" '../../../../../../../../../etc/passwd' "; - -"/"; -"="; -"=="; -"!="; -"<>"; -"<"; -"<="; -">"; -">="; -"<<"; -"|<<"; -"&"; -"|"; -"||"; -"<|"; -"|>"; -"+"; -"-"; -"~"; -"*"; -"/"; -"\\"; -"%"; -""; -"."; -","; -","; -","; -","; -","; -","; -"("; -")"; -"("; -")"; -"("; -")"; -"("; -")"; -"("; -")"; -"("; -")"; -"?"; -":"; -"@"; -"@@"; -"$"; -"\""; -"`"; -"{"; -"}"; -"^"; -"::"; -"->"; -"]"; -"["; - -" abs "; -" accurate_Cast "; -" accurateCast "; -" accurate_CastOrNull "; -" accurateCastOrNull "; -" acos "; -" acosh "; -" ADD "; -" ADD COLUMN "; -" ADD CONSTRAINT "; -" addDays "; -" addHours "; -" ADD INDEX "; -" addMinutes "; -" addMonths "; -" addQuarters "; -" addressToLine "; -" addressToSymbol "; -" addSeconds "; -" addWeeks "; -" addYears "; -" aes_decrypt_mysql "; -" aes_encrypt_mysql "; -" AFTER "; -" AggregateFunction "; -" aggThrow "; -" ALIAS "; -" ALL "; -" alphaTokens "; -" ALTER "; -" ALTER LIVE VIEW "; -" ALTER TABLE "; -" and "; -" AND "; -" ANTI "; -" any "; -" ANY "; -" anyHeavy "; -" anyLast "; -" appendTrailingCharIfAbsent "; -" argMax "; -" argMin "; -" array "; -" Array "; -" ARRAY "; -" arrayAll "; -" arrayAUC "; -" arrayAvg "; -" arrayCompact "; -" arrayConcat "; -" arrayCount "; -" arrayCumSum "; -" arrayCumSumNonNegative "; -" arrayDifference "; -" arrayDistinct "; -" arrayElement "; -" arrayEnumerate "; -" arrayEnumerateDense "; -" arrayEnumerateDenseRanked "; -" arrayEnumerateUniq "; -" arrayEnumerateUniqRanked "; -" arrayExists "; -" arrayFill "; -" arrayFilter "; -" arrayFirst "; -" arrayFirstIndex "; -" arrayFlatten "; -" arrayIntersect "; -" arrayJoin "; -" ARRAY JOIN "; -" arrayMap "; -" arrayMax "; -" arrayMin "; -" arrayPartialReverseSort "; -" arrayPartialShuffle "; -" arrayPartialSort "; -" arrayPopBack "; -" arrayPopFront "; -" arrayProduct "; -" arrayPushBack "; -" arrayPushFront "; -" arrayReduce "; -" arrayReduceInRanges "; -" arrayResize "; -" arrayReverse "; -" arrayReverseFill "; -" arrayReverseSort "; -" arrayReverseSplit "; -" arrayShuffle "; -" arraySlice "; -" arraySort "; -" arraySplit "; -" arrayStringConcat "; -" arraySum "; -" arrayUniq "; -" arrayWithConstant "; -" arrayZip "; -" AS "; -" ASC "; -" ASCENDING "; -" asin "; -" asinh "; -" ASOF "; -" assumeNotNull "; -" AST "; -" ASYNC "; -" atan "; -" atan2 "; -" atanh "; -" ATTACH "; -" ATTACH PART "; -" ATTACH PARTITION "; -" avg "; -" avgWeighted "; -" bar "; -" base64Decode "; -" base64Encode "; -" basename "; -" bayesAB "; -" BETWEEN "; -" BIGINT "; -" BIGINT SIGNED "; -" BIGINT UNSIGNED "; -" bin "; -" BINARY "; -" BINARY LARGE OBJECT "; -" BINARY VARYING "; -" bitAnd "; -" BIT_AND "; -" __bitBoolMaskAnd "; -" __bitBoolMaskOr "; -" bitCount "; -" bitHammingDistance "; -" bitmapAnd "; -" bitmapAndCardinality "; -" bitmapAndnot "; -" bitmapAndnotCardinality "; -" bitmapBuild "; -" bitmapCardinality "; -" bitmapContains "; -" bitmapHasAll "; -" bitmapHasAny "; -" bitmapMax "; -" bitmapMin "; -" bitmapOr "; -" bitmapOrCardinality "; -" bitmapSubsetInRange "; -" bitmapSubsetLimit "; -" bitmapToArray "; -" bitmapTransform "; -" bitmapXor "; -" bitmapXorCardinality "; -" bitmaskToArray "; -" bitmaskToList "; -" bitNot "; -" bitOr "; -" BIT_OR "; -" bitPositionsToArray "; -" bitRotateLeft "; -" bitRotateRight "; -" bitShiftLeft "; -" bitShiftRight "; -" __bitSwapLastTwo "; -" bitTest "; -" bitTestAll "; -" bitTestAny "; -" __bitWrapperFunc "; -" bitXor "; -" BIT_XOR "; -" BLOB "; -" blockNumber "; -" blockSerializedSize "; -" blockSize "; -" BOOL "; -" BOOLEAN "; -" BOTH "; -" boundingRatio "; -" buildId "; -" BY "; -" BYTE "; -" BYTEA "; -" byteSize "; -" CASE "; -" caseWithExpr "; -" caseWithExpression "; -" caseWithoutExpr "; -" caseWithoutExpression "; -" _CAST "; -" CAST "; -" categoricalInformationValue "; -" cbrt "; -" ceil "; -" ceiling "; -" char "; -" CHAR "; -" CHARACTER "; -" CHARACTER LARGE OBJECT "; -" CHARACTER_LENGTH "; -" CHARACTER VARYING "; -" CHAR LARGE OBJECT "; -" CHAR_LENGTH "; -" CHAR VARYING "; -" CHECK "; -" CHECK TABLE "; -" cityHash64 "; -" CLEAR "; -" CLEAR COLUMN "; -" CLEAR INDEX "; -" CLOB "; -" CLUSTER "; -" coalesce "; -" CODEC "; -" COLLATE "; -" COLUMN "; -" COLUMNS "; -" COMMENT "; -" COMMENT COLUMN "; -" concat "; -" concatAssumeInjective "; -" connection_id "; -" connectionid "; -" connectionId "; -" CONSTRAINT "; -" convertCharset "; -" corr "; -" corrStable "; -" cos "; -" cosh "; -" count "; -" countDigits "; -" countEqual "; -" countMatches "; -" countMatchesCaseInsensitive "; -" countSubstrings "; -" countSubstringsCaseInsensitive "; -" countSubstringsCaseInsensitiveUTF8 "; -" covarPop "; -" COVAR_POP "; -" covarPopStable "; -" covarSamp "; -" COVAR_SAMP "; -" covarSampStable "; -" CRC32 "; -" CRC32IEEE "; -" CRC64 "; -" CREATE "; -" CROSS "; -" CUBE "; -" currentDatabase "; -" currentProfiles "; -" currentRoles "; -" currentUser "; -" cutFragment "; -" cutIPv6 "; -" cutQueryString "; -" cutQueryStringAndFragment "; -" cutToFirstSignificantSubdomain "; -" cutToFirstSignificantSubdomainCustom "; -" cutToFirstSignificantSubdomainCustomWithWWW "; -" cutToFirstSignificantSubdomainWithWWW "; -" cutURLParameter "; -" cutWWW "; -" D "; -" DATABASE "; -" DATABASES "; -" Date "; -" DATE "; -" Date32 "; -" DATE_ADD "; -" DATEADD "; -" dateDiff "; -" DATE_DIFF "; -" DATEDIFF "; -" dateName "; -" DATE_SUB "; -" DATESUB "; -" DateTime "; -" DateTime32 "; -" DateTime64 "; -" dateTime64ToSnowflake "; -" dateTimeToSnowflake "; -" date_trunc "; -" dateTrunc "; -" DAY "; -" DAYOFMONTH "; -" DAYOFWEEK "; -" DAYOFYEAR "; -" DD "; -" DEC "; -" Decimal "; -" Decimal128 "; -" Decimal256 "; -" Decimal32 "; -" Decimal64 "; -" decodeURLComponent "; -" decodeXMLComponent "; -" decrypt "; -" DEDUPLICATE "; -" DEFAULT "; -" defaultProfiles "; -" defaultRoles "; -" defaultValueOfArgumentType "; -" defaultValueOfTypeName "; -" DELAY "; -" DELETE "; -" DELETE WHERE "; -" deltaSum "; -" deltaSumTimestamp "; -" demangle "; -" dense_rank "; -" DESC "; -" DESCENDING "; -" DESCRIBE "; -" DETACH "; -" DETACH PARTITION "; -" dictGet "; -" dictGetChildren "; -" dictGetDate "; -" dictGetDateOrDefault "; -" dictGetDateTime "; -" dictGetDateTimeOrDefault "; -" dictGetDescendants "; -" dictGetFloat32 "; -" dictGetFloat32OrDefault "; -" dictGetFloat64 "; -" dictGetFloat64OrDefault "; -" dictGetHierarchy "; -" dictGetInt16 "; -" dictGetInt16OrDefault "; -" dictGetInt32 "; -" dictGetInt32OrDefault "; -" dictGetInt64 "; -" dictGetInt64OrDefault "; -" dictGetInt8 "; -" dictGetInt8OrDefault "; -" dictGetOrDefault "; -" dictGetOrNull "; -" dictGetString "; -" dictGetStringOrDefault "; -" dictGetUInt16 "; -" dictGetUInt16OrDefault "; -" dictGetUInt32 "; -" dictGetUInt32OrDefault "; -" dictGetUInt64 "; -" dictGetUInt64OrDefault "; -" dictGetUInt8 "; -" dictGetUInt8OrDefault "; -" dictGetUUID "; -" dictGetUUIDOrDefault "; -" dictHas "; -" DICTIONARIES "; -" DICTIONARY "; -" dictIsIn "; -" DISK "; -" DISTINCT "; -" DISTRIBUTED "; -" divide "; -" domain "; -" domainWithoutWWW "; -" DOUBLE "; -" DOUBLE PRECISION "; -" DROP "; -" DROP COLUMN "; -" DROP CONSTRAINT "; -" DROP DETACHED PART "; -" DROP DETACHED PARTITION "; -" DROP INDEX "; -" DROP PARTITION "; -" dumpColumnStructure "; -" e "; -" ELSE "; -" empty "; -" emptyArrayDate "; -" emptyArrayDateTime "; -" emptyArrayFloat32 "; -" emptyArrayFloat64 "; -" emptyArrayInt16 "; -" emptyArrayInt32 "; -" emptyArrayInt64 "; -" emptyArrayInt8 "; -" emptyArrayString "; -" emptyArrayToSingle "; -" emptyArrayUInt16 "; -" emptyArrayUInt32 "; -" emptyArrayUInt64 "; -" emptyArrayUInt8 "; -" enabledProfiles "; -" enabledRoles "; -" encodeXMLComponent "; -" encrypt "; -" END "; -" endsWith "; -" ENGINE "; -" entropy "; -" Enum "; -" ENUM "; -" Enum16 "; -" Enum8 "; -" equals "; -" erf "; -" erfc "; -" errorCodeToName "; -" evalMLMethod "; -" EVENTS "; -" EXCHANGE TABLES "; -" EXISTS "; -" exp "; -" exp10 "; -" exp2 "; -" EXPLAIN "; -" exponentialMovingAverage "; -" EXPRESSION "; -" extract "; -" EXTRACT "; -" extractAll "; -" extractAllGroups "; -" extractAllGroupsHorizontal "; -" extractAllGroupsVertical "; -" extractGroups "; -" extractTextFromHTML "; -" extractURLParameter "; -" extractURLParameterNames "; -" extractURLParameters "; -" farmFingerprint64 "; -" farmHash64 "; -" FETCHES "; -" FETCH PART "; -" FETCH PARTITION "; -" file "; -" filesystemAvailable "; -" filesystemCapacity "; -" filesystemFree "; -" FINAL "; -" finalizeAggregation "; -" FIRST "; -" firstSignificantSubdomain "; -" firstSignificantSubdomainCustom "; -" first_value "; -" FIXED "; -" FixedString "; -" flatten "; -" FLOAT "; -" Float32 "; -" Float64 "; -" floor "; -" FLUSH "; -" FOR "; -" ForEach "; -" format "; -" FORMAT "; -" formatDateTime "; -" formatReadableQuantity "; -" formatReadableDecimalSize "; -" formatReadableSize "; -" formatReadableTimeDelta "; -" formatRow "; -" formatRowNoNewline "; -" FQDN "; -" fragment "; -" FREEZE "; -" FROM "; -" FROM_BASE64 "; -" fromModifiedJulianDay "; -" fromModifiedJulianDayOrNull "; -" FROM_UNIXTIME "; -" fromUnixTimestamp "; -" fromUnixTimestamp64Micro "; -" fromUnixTimestamp64Milli "; -" fromUnixTimestamp64Nano "; -" FULL "; -" fullHostName "; -" FUNCTION "; -" fuzzBits "; -" gccMurmurHash "; -" gcd "; -" generateUUIDv4 "; -" geoDistance "; -" geohashDecode "; -" geohashEncode "; -" geohashesInBox "; -" geoToH3 "; -" geoToS2 "; -" getMacro "; -" __getScalar "; -" getServerPort "; -" getSetting "; -" getSizeOfEnumType "; -" GLOBAL "; -" globalIn "; -" globalInIgnoreSet "; -" globalNotIn "; -" globalNotInIgnoreSet "; -" globalNotNullIn "; -" globalNotNullInIgnoreSet "; -" globalNullIn "; -" globalNullInIgnoreSet "; -" globalVariable "; -" GRANULARITY "; -" greatCircleAngle "; -" greatCircleDistance "; -" greater "; -" greaterOrEquals "; -" greatest "; -" GROUP "; -" groupArray "; -" groupArrayInsertAt "; -" groupArrayMovingAvg "; -" groupArrayMovingSum "; -" groupArraySample "; -" groupBitAnd "; -" groupBitmap "; -" groupBitmapAnd "; -" groupBitmapOr "; -" groupBitmapXor "; -" groupBitOr "; -" groupBitXor "; -" GROUP BY "; -" groupUniqArray "; -" h3EdgeAngle "; -" h3EdgeLengthM "; -" h3GetBaseCell "; -" h3GetFaces "; -" h3GetResolution "; -" h3HexAreaM2 "; -" h3IndexesAreNeighbors "; -" h3IsPentagon "; -" h3IsResClassIII "; -" h3IsValid "; -" h3kRing "; -" h3ToChildren "; -" h3ToGeo "; -" h3ToGeoBoundary "; -" h3ToParent "; -" h3ToString "; -" halfMD5 "; -" has "; -" hasAll "; -" hasAny "; -" hasColumnInTable "; -" hasSubstr "; -" hasThreadFuzzer "; -" hasToken "; -" hasTokenCaseInsensitive "; -" HAVING "; -" hex "; -" HH "; -" HIERARCHICAL "; -" histogram "; -" hiveHash "; -" hostname "; -" hostName "; -" HOUR "; -" hypot "; -" ID "; -" identity "; -" if "; -" IF "; -" IF EXISTS "; -" IF NOT EXISTS "; -" ifNotFinite "; -" ifNull "; -" ignore "; -" ilike "; -" ILIKE "; -" in "; -" IN "; -" INDEX "; -" indexHint "; -" indexOf "; -" INET4 "; -" INET6 "; -" INET6_ATON "; -" INET6_NTOA "; -" INET_ATON "; -" INET_NTOA "; -" INF "; -" inIgnoreSet "; -" initializeAggregation "; -" initial_query_id "; -" initialQueryID "; -" INJECTIVE "; -" INNER "; -" IN PARTITION "; -" INSERT "; -" INSERT INTO "; -" INT "; -" INT1 "; -" Int128 "; -" Int16 "; -" INT1 SIGNED "; -" INT1 UNSIGNED "; -" Int256 "; -" Int32 "; -" Int64 "; -" Int8 "; -" intDiv "; -" intDivOrZero "; -" INTEGER "; -" INTEGER SIGNED "; -" INTEGER UNSIGNED "; -" INTERVAL "; -" IntervalDay "; -" IntervalHour "; -" intervalLengthSum "; -" IntervalMinute "; -" IntervalMonth "; -" IntervalQuarter "; -" IntervalSecond "; -" IntervalWeek "; -" IntervalYear "; -" intExp10 "; -" intExp2 "; -" intHash32 "; -" intHash64 "; -" INTO "; -" INTO OUTFILE "; -" INT SIGNED "; -" INT UNSIGNED "; -" IPv4 "; -" IPv4CIDRToRange "; -" IPv4NumToString "; -" IPv4NumToStringClassC "; -" IPv4StringToNum "; -" IPv4ToIPv6 "; -" IPv6 "; -" IPv6CIDRToRange "; -" IPv6NumToString "; -" IPv6StringToNum "; -" IS "; -" isConstant "; -" isDecimalOverflow "; -" isFinite "; -" isInfinite "; -" isIPAddressInRange "; -" isIPv4String "; -" isIPv6String "; -" isNaN "; -" isNotNull "; -" isNull "; -" IS_OBJECT_ID "; -" isValidJSON "; -" isValidUTF8 "; -" isZeroOrNull "; -" javaHash "; -" javaHashUTF16LE "; -" JOIN "; -" joinGet "; -" joinGetOrNull "; -" JSON_EXISTS "; -" JSONExtract "; -" JSONExtractArrayRaw "; -" JSONExtractBool "; -" JSONExtractFloat "; -" JSONExtractInt "; -" JSONExtractKeysAndValues "; -" JSONExtractKeysAndValuesRaw "; -" JSONExtractKeys "; -" JSONExtractRaw "; -" JSONExtractString "; -" JSONExtractUInt "; -" JSONHas "; -" JSONKey "; -" JSONLength "; -" JSON_QUERY "; -" JSONType "; -" JSON_VALUE "; -" jumpConsistentHash "; -" KEY "; -" KILL "; -" kurtPop "; -" kurtSamp "; -" lagInFrame "; -" LAST "; -" last_value "; -" LAYOUT "; -" lcase "; -" lcm "; -" leadInFrame "; -" LEADING "; -" least "; -" LEFT "; -" LEFT ARRAY JOIN "; -" leftPad "; -" leftPadUTF8 "; -" lemmatize "; -" length "; -" lengthUTF8 "; -" less "; -" lessOrEquals "; -" lgamma "; -" LIFETIME "; -" like "; -" LIKE "; -" LIMIT "; -" LIVE "; -" ln "; -" LOCAL "; -" locate "; -" log "; -" log10 "; -" log1p "; -" log2 "; -" LOGS "; -" logTrace "; -" LONGBLOB "; -" LONGTEXT "; -" LowCardinality "; -" lowCardinalityIndices "; -" lowCardinalityKeys "; -" lower "; -" lowerUTF8 "; -" lpad "; -" LTRIM "; -" M "; -" MACNumToString "; -" MACStringToNum "; -" MACStringToOUI "; -" mannWhitneyUTest "; -" map "; -" Map "; -" mapAdd "; -" mapContains "; -" mapKeys "; -" mapPopulateSeries "; -" mapSubtract "; -" mapValues "; -" match "; -" materialize "; -" MATERIALIZE "; -" MATERIALIZED "; -" MATERIALIZE INDEX "; -" MATERIALIZE TTL "; -" max "; -" MAX "; -" maxIntersections "; -" maxIntersectionsPosition "; -" maxMap "; -" MD4 "; -" MD5 "; -" median "; -" medianBFloat16 "; -" medianBFloat16Weighted "; -" medianDeterministic "; -" medianExact "; -" medianExactHigh "; -" medianExactLow "; -" medianExactWeighted "; -" medianTDigest "; -" medianTDigestWeighted "; -" medianTiming "; -" medianTimingWeighted "; -" MEDIUMBLOB "; -" MEDIUMINT "; -" MEDIUMINT SIGNED "; -" MEDIUMINT UNSIGNED "; -" MEDIUMTEXT "; -" Merge "; -" MERGES "; -" metroHash64 "; -" MI "; -" mid "; -" min "; -" MIN "; -" minMap "; -" minus "; -" MINUTE "; -" MM "; -" mod "; -" MODIFY "; -" MODIFY COLUMN "; -" MODIFY ORDER BY "; -" MODIFY QUERY "; -" MODIFY SETTING "; -" MODIFY TTL "; -" modulo "; -" moduloLegacy "; -" moduloOrZero "; -" MONTH "; -" MOVE "; -" MOVE PART "; -" MOVE PARTITION "; -" movingXXX "; -" multiFuzzyMatchAllIndices "; -" multiFuzzyMatchAny "; -" multiFuzzyMatchAnyIndex "; -" multiIf "; -" multiMatchAllIndices "; -" multiMatchAny "; -" multiMatchAnyIndex "; -" multiply "; -" MultiPolygon "; -" multiSearchAllPositions "; -" multiSearchAllPositionsCaseInsensitive "; -" multiSearchAllPositionsCaseInsensitiveUTF8 "; -" multiSearchAllPositionsUTF8 "; -" multiSearchAny "; -" multiSearchAnyCaseInsensitive "; -" multiSearchAnyCaseInsensitiveUTF8 "; -" multiSearchAnyUTF8 "; -" multiSearchFirstIndex "; -" multiSearchFirstIndexCaseInsensitive "; -" multiSearchFirstIndexCaseInsensitiveUTF8 "; -" multiSearchFirstIndexUTF8 "; -" multiSearchFirstPosition "; -" multiSearchFirstPositionCaseInsensitive "; -" multiSearchFirstPositionCaseInsensitiveUTF8 "; -" multiSearchFirstPositionUTF8 "; -" murmurHash2_32 "; -" murmurHash2_64 "; -" murmurHash3_128 "; -" murmurHash3_32 "; -" murmurHash3_64 "; -" MUTATION "; -" N "; -" NAME "; -" NAN_SQL "; -" NATIONAL CHAR "; -" NATIONAL CHARACTER "; -" NATIONAL CHARACTER LARGE OBJECT "; -" NATIONAL CHARACTER VARYING "; -" NATIONAL CHAR VARYING "; -" NCHAR "; -" NCHAR LARGE OBJECT "; -" NCHAR VARYING "; -" negate "; -" neighbor "; -" Nested "; -" netloc "; -" ngramDistance "; -" ngramDistanceCaseInsensitive "; -" ngramDistanceCaseInsensitiveUTF8 "; -" ngramDistanceUTF8 "; -" ngramMinHash "; -" ngramMinHashArg "; -" ngramMinHashArgCaseInsensitive "; -" ngramMinHashArgCaseInsensitiveUTF8 "; -" ngramMinHashArgUTF8 "; -" ngramMinHashCaseInsensitive "; -" ngramMinHashCaseInsensitiveUTF8 "; -" ngramMinHashUTF8 "; -" ngramSearch "; -" ngramSearchCaseInsensitive "; -" ngramSearchCaseInsensitiveUTF8 "; -" ngramSearchUTF8 "; -" ngramSimHash "; -" ngramSimHashCaseInsensitive "; -" ngramSimHashCaseInsensitiveUTF8 "; -" ngramSimHashUTF8 "; -" NO "; -" NO DELAY "; -" NONE "; -" normalizedQueryHash "; -" normalizedQueryHashKeepNames "; -" normalizeQuery "; -" normalizeQueryKeepNames "; -" not "; -" NOT "; -" notEmpty "; -" notEquals "; -" nothing "; -" Nothing "; -" notILike "; -" notIn "; -" notInIgnoreSet "; -" notLike "; -" notNullIn "; -" notNullInIgnoreSet "; -" now "; -" now64 "; -" Null "; -" Nullable "; -" nullIf "; -" nullIn "; -" nullInIgnoreSet "; -" NULLS "; -" NULL_SQL "; -" NUMERIC "; -" NVARCHAR "; -" OFFSET "; -" ON "; -" ONLY "; -" OPTIMIZE "; -" OPTIMIZE TABLE "; -" or "; -" OR "; -" ORDER "; -" ORDER BY "; -" OR REPLACE "; -" OUTER "; -" OUTFILE "; -" parseDateTime32BestEffort "; -" parseDateTime32BestEffortOrNull "; -" parseDateTime32BestEffortOrZero "; -" parseDateTime64BestEffort "; -" parseDateTime64BestEffortOrNull "; -" parseDateTime64BestEffortOrZero "; -" parseDateTimeBestEffort "; -" parseDateTimeBestEffortOrNull "; -" parseDateTimeBestEffortOrZero "; -" parseDateTimeBestEffortUS "; -" parseDateTimeBestEffortUSOrNull "; -" parseDateTimeBestEffortUSOrZero "; -" parseTimeDelta "; -" PARTITION "; -" PARTITION BY "; -" partitionId "; -" path "; -" pathFull "; -" pi "; -" plus "; -" Point "; -" pointInEllipses "; -" pointInPolygon "; -" Polygon "; -" polygonAreaCartesian "; -" polygonAreaSpherical "; -" polygonConvexHullCartesian "; -" polygonPerimeterCartesian "; -" polygonPerimeterSpherical "; -" polygonsDistanceCartesian "; -" polygonsDistanceSpherical "; -" polygonsEqualsCartesian "; -" polygonsIntersectionCartesian "; -" polygonsIntersectionSpherical "; -" polygonsSymDifferenceCartesian "; -" polygonsSymDifferenceSpherical "; -" polygonsUnionCartesian "; -" polygonsUnionSpherical "; -" polygonsWithinCartesian "; -" polygonsWithinSpherical "; -" POPULATE "; -" port "; -" position "; -" positionCaseInsensitive "; -" positionCaseInsensitiveUTF8 "; -" positionUTF8 "; -" pow "; -" power "; -" PREWHERE "; -" PRIMARY "; -" PRIMARY KEY "; -" PROJECTION "; -" protocol "; -" Q "; -" QQ "; -" quantile "; -" quantileBFloat16 "; -" quantileBFloat16Weighted "; -" quantileDeterministic "; -" quantileExact "; -" quantileExactExclusive "; -" quantileExactHigh "; -" quantileExactInclusive "; -" quantileExactLow "; -" quantileExactWeighted "; -" quantiles "; -" quantilesBFloat16 "; -" quantilesBFloat16Weighted "; -" quantilesDeterministic "; -" quantilesExact "; -" quantilesExactExclusive "; -" quantilesExactHigh "; -" quantilesExactInclusive "; -" quantilesExactLow "; -" quantilesExactWeighted "; -" quantilesTDigest "; -" quantilesTDigestWeighted "; -" quantilesTiming "; -" quantilesTimingWeighted "; -" quantileTDigest "; -" quantileTDigestWeighted "; -" quantileTiming "; -" quantileTimingWeighted "; -" QUARTER "; -" query_id "; -" queryID "; -" queryString "; -" queryStringAndFragment "; -" rand "; -" rand32 "; -" rand64 "; -" randConstant "; -" randomFixedString "; -" randomPrintableASCII "; -" randomString "; -" randomStringUTF8 "; -" range "; -" RANGE "; -" rank "; -" rankCorr "; -" readWKTMultiPolygon "; -" readWKTPoint "; -" readWKTPolygon "; -" readWKTRing "; -" REAL "; -" REFRESH "; -" regexpQuoteMeta "; -" regionHierarchy "; -" regionIn "; -" regionToArea "; -" regionToCity "; -" regionToContinent "; -" regionToCountry "; -" regionToDistrict "; -" regionToName "; -" regionToPopulation "; -" regionToTopContinent "; -" reinterpret "; -" reinterpretAsDate "; -" reinterpretAsDateTime "; -" reinterpretAsFixedString "; -" reinterpretAsFloat32 "; -" reinterpretAsFloat64 "; -" reinterpretAsInt128 "; -" reinterpretAsInt16 "; -" reinterpretAsInt256 "; -" reinterpretAsInt32 "; -" reinterpretAsInt64 "; -" reinterpretAsInt8 "; -" reinterpretAsString "; -" reinterpretAsUInt128 "; -" reinterpretAsUInt16 "; -" reinterpretAsUInt256 "; -" reinterpretAsUInt32 "; -" reinterpretAsUInt64 "; -" reinterpretAsUInt8 "; -" reinterpretAsUUID "; -" RELOAD "; -" REMOVE "; -" RENAME "; -" RENAME COLUMN "; -" RENAME TABLE "; -" repeat "; -" replace "; -" REPLACE "; -" replaceAll "; -" replaceOne "; -" REPLACE PARTITION "; -" replaceRegexpAll "; -" replaceRegexpOne "; -" REPLICA "; -" replicate "; -" REPLICATED "; -" Resample "; -" RESUME "; -" retention "; -" reverse "; -" reverseUTF8 "; -" RIGHT "; -" rightPad "; -" rightPadUTF8 "; -" Ring "; -" ROLLUP "; -" round "; -" roundAge "; -" roundBankers "; -" roundDown "; -" roundDuration "; -" roundToExp2 "; -" row_number "; -" rowNumberInAllBlocks "; -" rowNumberInBlock "; -" rpad "; -" RTRIM "; -" runningAccumulate "; -" runningConcurrency "; -" runningDifference "; -" runningDifferenceStartingWithFirstValue "; -" S "; -" s2CapContains "; -" s2CapUnion "; -" s2CellsIntersect "; -" s2GetNeighbors "; -" s2RectAdd "; -" s2RectContains "; -" s2RectIntersection "; -" s2RectUnion "; -" s2ToGeo "; -" SAMPLE "; -" SAMPLE BY "; -" SECOND "; -" SELECT "; -" SEMI "; -" SENDS "; -" sequenceCount "; -" sequenceMatch "; -" sequenceNextNode "; -" serverUUID "; -" SET "; -" SETTINGS "; -" SHA1 "; -" SHA224 "; -" SHA256 "; -" SHA384 "; -" SHA512 "; -" shardCount "; -" shardNum "; -" SHOW "; -" SHOW PROCESSLIST "; -" sigmoid "; -" sign "; -" SimpleAggregateFunction "; -" simpleJSONExtractBool "; -" simpleJSONExtractFloat "; -" simpleJSONExtractInt "; -" simpleJSONExtractRaw "; -" simpleJSONExtractString "; -" simpleJSONExtractUInt "; -" simpleJSONHas "; -" simpleLinearRegression "; -" sin "; -" SINGLE "; -" singleValueOrNull "; -" sinh "; -" sipHash128 "; -" sipHash64 "; -" skewPop "; -" skewSamp "; -" sleep "; -" sleepEachRow "; -" SMALLINT "; -" SMALLINT SIGNED "; -" SMALLINT UNSIGNED "; -" snowflakeToDateTime "; -" snowflakeToDateTime64 "; -" SOURCE "; -" sparkbar "; -" splitByChar "; -" splitByNonAlpha "; -" splitByRegexp "; -" splitByString "; -" splitByWhitespace "; -" SQL_TSI_DAY "; -" SQL_TSI_HOUR "; -" SQL_TSI_MINUTE "; -" SQL_TSI_MONTH "; -" SQL_TSI_QUARTER "; -" SQL_TSI_SECOND "; -" SQL_TSI_WEEK "; -" SQL_TSI_YEAR "; -" sqrt "; -" SS "; -" START "; -" startsWith "; -" State "; -" stddevPop "; -" STDDEV_POP "; -" stddevPopStable "; -" stddevSamp "; -" STDDEV_SAMP "; -" stddevSampStable "; -" stem "; -" STEP "; -" stochasticLinearRegression "; -" stochasticLogisticRegression "; -" STOP "; -" String "; -" stringToH3 "; -" studentTTest "; -" subBitmap "; -" substr "; -" substring "; -" SUBSTRING "; -" substringUTF8 "; -" subtractDays "; -" subtractHours "; -" subtractMinutes "; -" subtractMonths "; -" subtractQuarters "; -" subtractSeconds "; -" subtractWeeks "; -" subtractYears "; -" sum "; -" sumCount "; -" sumKahan "; -" sumMap "; -" sumMapFiltered "; -" sumMapFilteredWithOverflow "; -" sumMapWithOverflow "; -" sumWithOverflow "; -" SUSPEND "; -" svg "; -" SVG "; -" SYNC "; -" synonyms "; -" SYNTAX "; -" SYSTEM "; -" TABLE "; -" TABLES "; -" tan "; -" tanh "; -" tcpPort "; -" TEMPORARY "; -" TEST "; -" TEXT "; -" tgamma "; -" THEN "; -" throwIf "; -" tid "; -" TIES "; -" TIMEOUT "; -" timeSlot "; -" timeSlots "; -" TIMESTAMP "; -" TIMESTAMP_ADD "; -" TIMESTAMPADD "; -" TIMESTAMP_DIFF "; -" TIMESTAMPDIFF "; -" TIMESTAMP_SUB "; -" TIMESTAMPSUB "; -" timezone "; -" timeZone "; -" timezoneOf "; -" timeZoneOf "; -" timezoneOffset "; -" timeZoneOffset "; -" TINYBLOB "; -" TINYINT "; -" TINYINT SIGNED "; -" TINYINT UNSIGNED "; -" TINYTEXT "; -" TO "; -" TO_BASE64 "; -" toColumnTypeName "; -" toDate "; -" toDate32 "; -" toDate32OrNull "; -" toDate32OrZero "; -" toDateOrNull "; -" toDateOrZero "; -" toDateTime "; -" toDateTime32 "; -" toDateTime64 "; -" toDateTime64OrNull "; -" toDateTime64OrZero "; -" toDateTimeOrNull "; -" toDateTimeOrZero "; -" today "; -" toDayOfMonth "; -" toDayOfWeek "; -" toDayOfYear "; -" toDecimal128 "; -" toDecimal128OrNull "; -" toDecimal128OrZero "; -" toDecimal256 "; -" toDecimal256OrNull "; -" toDecimal256OrZero "; -" toDecimal32 "; -" toDecimal32OrNull "; -" toDecimal32OrZero "; -" toDecimal64 "; -" toDecimal64OrNull "; -" toDecimal64OrZero "; -" TO DISK "; -" toFixedString "; -" toFloat32 "; -" toFloat32OrNull "; -" toFloat32OrZero "; -" toFloat64 "; -" toFloat64OrNull "; -" toFloat64OrZero "; -" toHour "; -" toInt128 "; -" toInt128OrNull "; -" toInt128OrZero "; -" toInt16 "; -" toInt16OrNull "; -" toInt16OrZero "; -" toInt256 "; -" toInt256OrNull "; -" toInt256OrZero "; -" toInt32 "; -" toInt32OrNull "; -" toInt32OrZero "; -" toInt64 "; -" toInt64OrNull "; -" toInt64OrZero "; -" toInt8 "; -" toInt8OrNull "; -" toInt8OrZero "; -" toIntervalDay "; -" toIntervalHour "; -" toIntervalMinute "; -" toIntervalMonth "; -" toIntervalQuarter "; -" toIntervalSecond "; -" toIntervalWeek "; -" toIntervalYear "; -" toIPv4 "; -" toIPv6 "; -" toISOWeek "; -" toISOYear "; -" toJSONString "; -" toLowCardinality "; -" toMinute "; -" toModifiedJulianDay "; -" toModifiedJulianDayOrNull "; -" toMonday "; -" toMonth "; -" toNullable "; -" TOP "; -" topK "; -" topKWeighted "; -" topLevelDomain "; -" toQuarter "; -" toRelativeDayNum "; -" toRelativeHourNum "; -" toRelativeMinuteNum "; -" toRelativeMonthNum "; -" toRelativeQuarterNum "; -" toRelativeSecondNum "; -" toRelativeWeekNum "; -" toRelativeYearNum "; -" toSecond "; -" toStartOfDay "; -" toStartOfFifteenMinutes "; -" toStartOfFiveMinutes "; -" toStartOfHour "; -" toStartOfInterval "; -" toStartOfISOYear "; -" toStartOfMinute "; -" toStartOfMonth "; -" toStartOfQuarter "; -" toStartOfSecond "; -" toStartOfTenMinutes "; -" toStartOfWeek "; -" toStartOfYear "; -" toString "; -" toStringCutToZero "; -" TO TABLE "; -" TOTALS "; -" toTime "; -" toTimezone "; -" toTimeZone "; -" toTypeName "; -" toUInt128 "; -" toUInt128OrNull "; -" toUInt128OrZero "; -" toUInt16 "; -" toUInt16OrNull "; -" toUInt16OrZero "; -" toUInt256 "; -" toUInt256OrNull "; -" toUInt256OrZero "; -" toUInt32 "; -" toUInt32OrNull "; -" toUInt32OrZero "; -" toUInt64 "; -" toUInt64OrNull "; -" toUInt64OrZero "; -" toUInt8 "; -" toUInt8OrNull "; -" toUInt8OrZero "; -" toUnixTimestamp "; -" toUnixTimestamp64Micro "; -" toUnixTimestamp64Milli "; -" toUnixTimestamp64Nano "; -" toUUID "; -" toUUIDOrNull "; -" toUUIDOrZero "; -" toValidUTF8 "; -" TO VOLUME "; -" toWeek "; -" toYear "; -" toYearWeek "; -" toYYYYMM "; -" toYYYYMMDD "; -" toYYYYMMDDhhmmss "; -" TRAILING "; -" transform "; -" TRIM "; -" trimBoth "; -" trimLeft "; -" trimRight "; -" trunc "; -" truncate "; -" TRUNCATE "; -" tryBase64Decode "; -" TTL "; -" tuple "; -" Tuple "; -" tupleElement "; -" tupleHammingDistance "; -" tupleToNameValuePairs "; -" TYPE "; -" ucase "; -" UInt128 "; -" UInt16 "; -" UInt256 "; -" UInt32 "; -" UInt64 "; -" UInt8 "; -" unbin "; -" unhex "; -" UNION "; -" uniq "; -" uniqCombined "; -" uniqCombined64 "; -" uniqExact "; -" uniqHLL12 "; -" uniqTheta "; -" uniqUpTo "; -" UPDATE "; -" upper "; -" upperUTF8 "; -" uptime "; -" URLHash "; -" URLHierarchy "; -" URLPathHierarchy "; -" USE "; -" user "; -" USING "; -" UUID "; -" UUIDNumToString "; -" UUIDStringToNum "; -" validateNestedArraySizes "; -" VALUES "; -" VARCHAR "; -" VARCHAR2 "; -" varPop "; -" VAR_POP "; -" varPopStable "; -" varSamp "; -" VAR_SAMP "; -" varSampStable "; -" version "; -" VIEW "; -" visibleWidth "; -" visitParamExtractBool "; -" visitParamExtractFloat "; -" visitParamExtractInt "; -" visitParamExtractRaw "; -" visitParamExtractString "; -" visitParamExtractUInt "; -" visitParamHas "; -" VOLUME "; -" WATCH "; -" week "; -" WEEK "; -" welchTTest "; -" WHEN "; -" WHERE "; -" windowFunnel "; -" WITH "; -" WITH FILL "; -" WITH TIES "; -" WK "; -" wkt "; -" wordShingleMinHash "; -" wordShingleMinHashArg "; -" wordShingleMinHashArgCaseInsensitive "; -" wordShingleMinHashArgCaseInsensitiveUTF8 "; -" wordShingleMinHashArgUTF8 "; -" wordShingleMinHashCaseInsensitive "; -" wordShingleMinHashCaseInsensitiveUTF8 "; -" wordShingleMinHashUTF8 "; -" wordShingleSimHash "; -" wordShingleSimHashCaseInsensitive "; -" wordShingleSimHashCaseInsensitiveUTF8 "; -" wordShingleSimHashUTF8 "; -" WW "; -" xor "; -" xxHash32 "; -" xxHash64 "; -" kostikConsistentHash "; -" YEAR "; -" yearweek "; -" yesterday "; -" YY "; -" YYYY "; -" zookeeperSessionUptime "; diff --git a/src/Parsers/fuzzers/codegen_fuzzer/out.cpp b/src/Parsers/fuzzers/codegen_fuzzer/out.cpp deleted file mode 100644 index 29168751d71..00000000000 --- a/src/Parsers/fuzzers/codegen_fuzzer/out.cpp +++ /dev/null @@ -1,6461 +0,0 @@ -#include -#include -#include - -#include - -#include "out.pb.h" - -void GenerateWord(const Word&, std::string&, int); - -void GenerateSentence(const Sentence& stc, std::string &s, int depth) { - for (int i = 0; i < stc.words_size(); i++ ) { - GenerateWord(stc.words(i), s, ++depth); - } -} -void GenerateWord(const Word& word, std::string &s, int depth) { - if (depth > 5) return; - - switch (word.value()) { - case 0: { - s += " "; - break; - } - case 1: { - s += " "; - break; - } - case 2: { - s += " "; - break; - } - case 3: { - s += ";"; - break; - } - case 4: { - s += "("; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ")"; - break; - } - case 5: { - s += "("; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ")"; - break; - } - case 6: { - s += "("; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ")"; - break; - } - case 7: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - break; - } - case 8: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 9: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ", "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - break; - } - case 10: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ", "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - s += ", "; - if (word.inner().words_size() > 4) GenerateWord(word.inner().words(4), s, ++depth); - break; - } - case 11: { - s += "["; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += "]"; - break; - } - case 12: { - s += "["; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += "]"; - break; - } - case 13: { - s += "["; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ", "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - s += "]"; - break; - } - case 14: { - s += "["; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ", "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ", "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - s += ", "; - if (word.inner().words_size() > 4) GenerateWord(word.inner().words(4), s, ++depth); - s += "]"; - break; - } - case 15: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += "("; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ")"; - break; - } - case 16: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += "("; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ")"; - break; - } - case 17: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += "("; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += ", "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += ", "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - s += ")"; - break; - } - case 18: { - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " as "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - break; - } - case 19: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " WHERE "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 20: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " GROUP BY "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 21: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " SORT BY "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 22: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " LIMIT "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 23: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " JOIN "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 24: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " ARRAY JOIN "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - break; - } - case 25: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " JOIN "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += " ON "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - break; - } - case 26: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " FROM "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += " JOIN "; - if (word.inner().words_size() > 2) GenerateWord(word.inner().words(2), s, ++depth); - s += " USING "; - if (word.inner().words_size() > 3) GenerateWord(word.inner().words(3), s, ++depth); - break; - } - case 27: { - s += "SELECT "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " INTO OUTFILE "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - break; - } - case 28: { - s += "WITH "; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += " AS "; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - break; - } - case 29: { - s += "{"; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ":"; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += "}"; - break; - } - case 30: { - s += "["; - if (word.inner().words_size() > 0) GenerateWord(word.inner().words(0), s, ++depth); - s += ","; - if (word.inner().words_size() > 1) GenerateWord(word.inner().words(1), s, ++depth); - s += "]"; - break; - } - case 31: { - s += "[]"; - break; - } - case 32: { - s += " x "; - break; - } - case 33: { - s += "x"; - break; - } - case 34: { - s += " `x` "; - break; - } - case 35: { - s += "`x`"; - break; - } - case 36: { - s += " \"value\" "; - break; - } - case 37: { - s += "\"value\""; - break; - } - case 38: { - s += " 0 "; - break; - } - case 39: { - s += "0"; - break; - } - case 40: { - s += "1"; - break; - } - case 41: { - s += "2"; - break; - } - case 42: { - s += "123123123123123123"; - break; - } - case 43: { - s += "182374019873401982734091873420923123123123123123"; - break; - } - case 44: { - s += "1e-1"; - break; - } - case 45: { - s += "1.1"; - break; - } - case 46: { - s += "\"\""; - break; - } - case 47: { - s += " '../../../../../../../../../etc/passwd' "; - break; - } - case 48: { - s += "/"; - break; - } - case 49: { - s += "="; - break; - } - case 50: { - s += "=="; - break; - } - case 51: { - s += "!="; - break; - } - case 52: { - s += "<>"; - break; - } - case 53: { - s += "<"; - break; - } - case 54: { - s += "<="; - break; - } - case 55: { - s += ">"; - break; - } - case 56: { - s += ">="; - break; - } - case 57: { - s += "<<"; - break; - } - case 58: { - s += "|<<"; - break; - } - case 59: { - s += "&"; - break; - } - case 60: { - s += "|"; - break; - } - case 61: { - s += "||"; - break; - } - case 62: { - s += "<|"; - break; - } - case 63: { - s += "|>"; - break; - } - case 64: { - s += "+"; - break; - } - case 65: { - s += "-"; - break; - } - case 66: { - s += "~"; - break; - } - case 67: { - s += "*"; - break; - } - case 68: { - s += "/"; - break; - } - case 69: { - s += "\\"; - break; - } - case 70: { - s += "%"; - break; - } - case 71: { - s += ""; - break; - } - case 72: { - s += "."; - break; - } - case 73: { - s += ","; - break; - } - case 74: { - s += ","; - break; - } - case 75: { - s += ","; - break; - } - case 76: { - s += ","; - break; - } - case 77: { - s += ","; - break; - } - case 78: { - s += ","; - break; - } - case 79: { - s += "("; - break; - } - case 80: { - s += ")"; - break; - } - case 81: { - s += "("; - break; - } - case 82: { - s += ")"; - break; - } - case 83: { - s += "("; - break; - } - case 84: { - s += ")"; - break; - } - case 85: { - s += "("; - break; - } - case 86: { - s += ")"; - break; - } - case 87: { - s += "("; - break; - } - case 88: { - s += ")"; - break; - } - case 89: { - s += "("; - break; - } - case 90: { - s += ")"; - break; - } - case 91: { - s += "?"; - break; - } - case 92: { - s += ":"; - break; - } - case 93: { - s += "@"; - break; - } - case 94: { - s += "@@"; - break; - } - case 95: { - s += "$"; - break; - } - case 96: { - s += "\""; - break; - } - case 97: { - s += "`"; - break; - } - case 98: { - s += "{"; - break; - } - case 99: { - s += "}"; - break; - } - case 100: { - s += "^"; - break; - } - case 101: { - s += "::"; - break; - } - case 102: { - s += "->"; - break; - } - case 103: { - s += "]"; - break; - } - case 104: { - s += "["; - break; - } - case 105: { - s += " abs "; - break; - } - case 106: { - s += " accurate_Cast "; - break; - } - case 107: { - s += " accurateCast "; - break; - } - case 108: { - s += " accurate_CastOrNull "; - break; - } - case 109: { - s += " accurateCastOrNull "; - break; - } - case 110: { - s += " acos "; - break; - } - case 111: { - s += " acosh "; - break; - } - case 112: { - s += " ADD "; - break; - } - case 113: { - s += " ADD COLUMN "; - break; - } - case 114: { - s += " ADD CONSTRAINT "; - break; - } - case 115: { - s += " addDays "; - break; - } - case 116: { - s += " addHours "; - break; - } - case 117: { - s += " ADD INDEX "; - break; - } - case 118: { - s += " addMinutes "; - break; - } - case 119: { - s += " addMonths "; - break; - } - case 120: { - s += " addQuarters "; - break; - } - case 121: { - s += " addressToLine "; - break; - } - case 122: { - s += " addressToSymbol "; - break; - } - case 123: { - s += " addSeconds "; - break; - } - case 124: { - s += " addWeeks "; - break; - } - case 125: { - s += " addYears "; - break; - } - case 126: { - s += " aes_decrypt_mysql "; - break; - } - case 127: { - s += " aes_encrypt_mysql "; - break; - } - case 128: { - s += " AFTER "; - break; - } - case 129: { - s += " AggregateFunction "; - break; - } - case 130: { - s += " aggThrow "; - break; - } - case 131: { - s += " ALIAS "; - break; - } - case 132: { - s += " ALL "; - break; - } - case 133: { - s += " alphaTokens "; - break; - } - case 134: { - s += " ALTER "; - break; - } - case 135: { - s += " ALTER LIVE VIEW "; - break; - } - case 136: { - s += " ALTER TABLE "; - break; - } - case 137: { - s += " and "; - break; - } - case 138: { - s += " AND "; - break; - } - case 139: { - s += " ANTI "; - break; - } - case 140: { - s += " any "; - break; - } - case 141: { - s += " ANY "; - break; - } - case 142: { - s += " anyHeavy "; - break; - } - case 143: { - s += " anyLast "; - break; - } - case 144: { - s += " appendTrailingCharIfAbsent "; - break; - } - case 145: { - s += " argMax "; - break; - } - case 146: { - s += " argMin "; - break; - } - case 147: { - s += " array "; - break; - } - case 148: { - s += " Array "; - break; - } - case 149: { - s += " ARRAY "; - break; - } - case 150: { - s += " arrayAll "; - break; - } - case 151: { - s += " arrayAUC "; - break; - } - case 152: { - s += " arrayAvg "; - break; - } - case 153: { - s += " arrayCompact "; - break; - } - case 154: { - s += " arrayConcat "; - break; - } - case 155: { - s += " arrayCount "; - break; - } - case 156: { - s += " arrayCumSum "; - break; - } - case 157: { - s += " arrayCumSumNonNegative "; - break; - } - case 158: { - s += " arrayDifference "; - break; - } - case 159: { - s += " arrayDistinct "; - break; - } - case 160: { - s += " arrayElement "; - break; - } - case 161: { - s += " arrayEnumerate "; - break; - } - case 162: { - s += " arrayEnumerateDense "; - break; - } - case 163: { - s += " arrayEnumerateDenseRanked "; - break; - } - case 164: { - s += " arrayEnumerateUniq "; - break; - } - case 165: { - s += " arrayEnumerateUniqRanked "; - break; - } - case 166: { - s += " arrayExists "; - break; - } - case 167: { - s += " arrayFill "; - break; - } - case 168: { - s += " arrayFilter "; - break; - } - case 169: { - s += " arrayFirst "; - break; - } - case 170: { - s += " arrayFirstIndex "; - break; - } - case 171: { - s += " arrayFlatten "; - break; - } - case 172: { - s += " arrayIntersect "; - break; - } - case 173: { - s += " arrayJoin "; - break; - } - case 174: { - s += " ARRAY JOIN "; - break; - } - case 175: { - s += " arrayMap "; - break; - } - case 176: { - s += " arrayMax "; - break; - } - case 177: { - s += " arrayMin "; - break; - } - case 178: { - s += " arrayPartialReverseSort "; - break; - } - case 179: { - s += " arrayPartialShuffle "; - break; - } - case 180: { - s += " arrayPartialSort "; - break; - } - case 181: { - s += " arrayPopBack "; - break; - } - case 182: { - s += " arrayPopFront "; - break; - } - case 183: { - s += " arrayProduct "; - break; - } - case 184: { - s += " arrayPushBack "; - break; - } - case 185: { - s += " arrayPushFront "; - break; - } - case 186: { - s += " arrayReduce "; - break; - } - case 187: { - s += " arrayReduceInRanges "; - break; - } - case 188: { - s += " arrayResize "; - break; - } - case 189: { - s += " arrayReverse "; - break; - } - case 190: { - s += " arrayReverseFill "; - break; - } - case 191: { - s += " arrayReverseSort "; - break; - } - case 192: { - s += " arrayReverseSplit "; - break; - } - case 193: { - s += " arrayShuffle "; - break; - } - case 194: { - s += " arraySlice "; - break; - } - case 195: { - s += " arraySort "; - break; - } - case 196: { - s += " arraySplit "; - break; - } - case 197: { - s += " arrayStringConcat "; - break; - } - case 198: { - s += " arraySum "; - break; - } - case 199: { - s += " arrayUniq "; - break; - } - case 200: { - s += " arrayWithConstant "; - break; - } - case 201: { - s += " arrayZip "; - break; - } - case 202: { - s += " AS "; - break; - } - case 203: { - s += " ASC "; - break; - } - case 204: { - s += " ASCENDING "; - break; - } - case 205: { - s += " asin "; - break; - } - case 206: { - s += " asinh "; - break; - } - case 207: { - s += " ASOF "; - break; - } - case 208: { - s += " assumeNotNull "; - break; - } - case 209: { - s += " AST "; - break; - } - case 210: { - s += " ASYNC "; - break; - } - case 211: { - s += " atan "; - break; - } - case 212: { - s += " atan2 "; - break; - } - case 213: { - s += " atanh "; - break; - } - case 214: { - s += " ATTACH "; - break; - } - case 215: { - s += " ATTACH PART "; - break; - } - case 216: { - s += " ATTACH PARTITION "; - break; - } - case 217: { - s += " avg "; - break; - } - case 218: { - s += " avgWeighted "; - break; - } - case 219: { - s += " bar "; - break; - } - case 220: { - s += " base64Decode "; - break; - } - case 221: { - s += " base64Encode "; - break; - } - case 222: { - s += " basename "; - break; - } - case 223: { - s += " bayesAB "; - break; - } - case 224: { - s += " BETWEEN "; - break; - } - case 225: { - s += " BIGINT "; - break; - } - case 226: { - s += " BIGINT SIGNED "; - break; - } - case 227: { - s += " BIGINT UNSIGNED "; - break; - } - case 228: { - s += " bin "; - break; - } - case 229: { - s += " BINARY "; - break; - } - case 230: { - s += " BINARY LARGE OBJECT "; - break; - } - case 231: { - s += " BINARY VARYING "; - break; - } - case 232: { - s += " bitAnd "; - break; - } - case 233: { - s += " BIT_AND "; - break; - } - case 234: { - s += " __bitBoolMaskAnd "; - break; - } - case 235: { - s += " __bitBoolMaskOr "; - break; - } - case 236: { - s += " bitCount "; - break; - } - case 237: { - s += " bitHammingDistance "; - break; - } - case 238: { - s += " bitmapAnd "; - break; - } - case 239: { - s += " bitmapAndCardinality "; - break; - } - case 240: { - s += " bitmapAndnot "; - break; - } - case 241: { - s += " bitmapAndnotCardinality "; - break; - } - case 242: { - s += " bitmapBuild "; - break; - } - case 243: { - s += " bitmapCardinality "; - break; - } - case 244: { - s += " bitmapContains "; - break; - } - case 245: { - s += " bitmapHasAll "; - break; - } - case 246: { - s += " bitmapHasAny "; - break; - } - case 247: { - s += " bitmapMax "; - break; - } - case 248: { - s += " bitmapMin "; - break; - } - case 249: { - s += " bitmapOr "; - break; - } - case 250: { - s += " bitmapOrCardinality "; - break; - } - case 251: { - s += " bitmapSubsetInRange "; - break; - } - case 252: { - s += " bitmapSubsetLimit "; - break; - } - case 253: { - s += " bitmapToArray "; - break; - } - case 254: { - s += " bitmapTransform "; - break; - } - case 255: { - s += " bitmapXor "; - break; - } - case 256: { - s += " bitmapXorCardinality "; - break; - } - case 257: { - s += " bitmaskToArray "; - break; - } - case 258: { - s += " bitmaskToList "; - break; - } - case 259: { - s += " bitNot "; - break; - } - case 260: { - s += " bitOr "; - break; - } - case 261: { - s += " BIT_OR "; - break; - } - case 262: { - s += " bitPositionsToArray "; - break; - } - case 263: { - s += " bitRotateLeft "; - break; - } - case 264: { - s += " bitRotateRight "; - break; - } - case 265: { - s += " bitShiftLeft "; - break; - } - case 266: { - s += " bitShiftRight "; - break; - } - case 267: { - s += " __bitSwapLastTwo "; - break; - } - case 268: { - s += " bitTest "; - break; - } - case 269: { - s += " bitTestAll "; - break; - } - case 270: { - s += " bitTestAny "; - break; - } - case 271: { - s += " __bitWrapperFunc "; - break; - } - case 272: { - s += " bitXor "; - break; - } - case 273: { - s += " BIT_XOR "; - break; - } - case 274: { - s += " BLOB "; - break; - } - case 275: { - s += " blockNumber "; - break; - } - case 276: { - s += " blockSerializedSize "; - break; - } - case 277: { - s += " blockSize "; - break; - } - case 278: { - s += " BOOL "; - break; - } - case 279: { - s += " BOOLEAN "; - break; - } - case 280: { - s += " BOTH "; - break; - } - case 281: { - s += " boundingRatio "; - break; - } - case 282: { - s += " buildId "; - break; - } - case 283: { - s += " BY "; - break; - } - case 284: { - s += " BYTE "; - break; - } - case 285: { - s += " BYTEA "; - break; - } - case 286: { - s += " byteSize "; - break; - } - case 287: { - s += " CASE "; - break; - } - case 288: { - s += " caseWithExpr "; - break; - } - case 289: { - s += " caseWithExpression "; - break; - } - case 290: { - s += " caseWithoutExpr "; - break; - } - case 291: { - s += " caseWithoutExpression "; - break; - } - case 292: { - s += " _CAST "; - break; - } - case 293: { - s += " CAST "; - break; - } - case 294: { - s += " categoricalInformationValue "; - break; - } - case 295: { - s += " cbrt "; - break; - } - case 296: { - s += " ceil "; - break; - } - case 297: { - s += " ceiling "; - break; - } - case 298: { - s += " char "; - break; - } - case 299: { - s += " CHAR "; - break; - } - case 300: { - s += " CHARACTER "; - break; - } - case 301: { - s += " CHARACTER LARGE OBJECT "; - break; - } - case 302: { - s += " CHARACTER_LENGTH "; - break; - } - case 303: { - s += " CHARACTER VARYING "; - break; - } - case 304: { - s += " CHAR LARGE OBJECT "; - break; - } - case 305: { - s += " CHAR_LENGTH "; - break; - } - case 306: { - s += " CHAR VARYING "; - break; - } - case 307: { - s += " CHECK "; - break; - } - case 308: { - s += " CHECK TABLE "; - break; - } - case 309: { - s += " cityHash64 "; - break; - } - case 310: { - s += " CLEAR "; - break; - } - case 311: { - s += " CLEAR COLUMN "; - break; - } - case 312: { - s += " CLEAR INDEX "; - break; - } - case 313: { - s += " CLOB "; - break; - } - case 314: { - s += " CLUSTER "; - break; - } - case 315: { - s += " coalesce "; - break; - } - case 316: { - s += " CODEC "; - break; - } - case 317: { - s += " COLLATE "; - break; - } - case 318: { - s += " COLUMN "; - break; - } - case 319: { - s += " COLUMNS "; - break; - } - case 320: { - s += " COMMENT "; - break; - } - case 321: { - s += " COMMENT COLUMN "; - break; - } - case 322: { - s += " concat "; - break; - } - case 323: { - s += " concatAssumeInjective "; - break; - } - case 324: { - s += " connection_id "; - break; - } - case 325: { - s += " connectionid "; - break; - } - case 326: { - s += " connectionId "; - break; - } - case 327: { - s += " CONSTRAINT "; - break; - } - case 328: { - s += " convertCharset "; - break; - } - case 329: { - s += " corr "; - break; - } - case 330: { - s += " corrStable "; - break; - } - case 331: { - s += " cos "; - break; - } - case 332: { - s += " cosh "; - break; - } - case 333: { - s += " count "; - break; - } - case 334: { - s += " countDigits "; - break; - } - case 335: { - s += " countEqual "; - break; - } - case 336: { - s += " countMatches "; - break; - } - case 337: { - s += " countMatchesCaseInsensitive "; - break; - } - case 338: { - s += " countSubstrings "; - break; - } - case 339: { - s += " countSubstringsCaseInsensitive "; - break; - } - case 340: { - s += " countSubstringsCaseInsensitiveUTF8 "; - break; - } - case 341: { - s += " covarPop "; - break; - } - case 342: { - s += " COVAR_POP "; - break; - } - case 343: { - s += " covarPopStable "; - break; - } - case 344: { - s += " covarSamp "; - break; - } - case 345: { - s += " COVAR_SAMP "; - break; - } - case 346: { - s += " covarSampStable "; - break; - } - case 347: { - s += " CRC32 "; - break; - } - case 348: { - s += " CRC32IEEE "; - break; - } - case 349: { - s += " CRC64 "; - break; - } - case 350: { - s += " CREATE "; - break; - } - case 351: { - s += " CROSS "; - break; - } - case 352: { - s += " CUBE "; - break; - } - case 353: { - s += " currentDatabase "; - break; - } - case 354: { - s += " currentProfiles "; - break; - } - case 355: { - s += " currentRoles "; - break; - } - case 356: { - s += " currentUser "; - break; - } - case 357: { - s += " cutFragment "; - break; - } - case 358: { - s += " cutIPv6 "; - break; - } - case 359: { - s += " cutQueryString "; - break; - } - case 360: { - s += " cutQueryStringAndFragment "; - break; - } - case 361: { - s += " cutToFirstSignificantSubdomain "; - break; - } - case 362: { - s += " cutToFirstSignificantSubdomainCustom "; - break; - } - case 363: { - s += " cutToFirstSignificantSubdomainCustomWithWWW "; - break; - } - case 364: { - s += " cutToFirstSignificantSubdomainWithWWW "; - break; - } - case 365: { - s += " cutURLParameter "; - break; - } - case 366: { - s += " cutWWW "; - break; - } - case 367: { - s += " D "; - break; - } - case 368: { - s += " DATABASE "; - break; - } - case 369: { - s += " DATABASES "; - break; - } - case 370: { - s += " Date "; - break; - } - case 371: { - s += " DATE "; - break; - } - case 372: { - s += " Date32 "; - break; - } - case 373: { - s += " DATE_ADD "; - break; - } - case 374: { - s += " DATEADD "; - break; - } - case 375: { - s += " dateDiff "; - break; - } - case 376: { - s += " DATE_DIFF "; - break; - } - case 377: { - s += " DATEDIFF "; - break; - } - case 378: { - s += " dateName "; - break; - } - case 379: { - s += " DATE_SUB "; - break; - } - case 380: { - s += " DATESUB "; - break; - } - case 381: { - s += " DateTime "; - break; - } - case 382: { - s += " DateTime32 "; - break; - } - case 383: { - s += " DateTime64 "; - break; - } - case 384: { - s += " dateTime64ToSnowflake "; - break; - } - case 385: { - s += " dateTimeToSnowflake "; - break; - } - case 386: { - s += " date_trunc "; - break; - } - case 387: { - s += " dateTrunc "; - break; - } - case 388: { - s += " DAY "; - break; - } - case 389: { - s += " DAYOFMONTH "; - break; - } - case 390: { - s += " DAYOFWEEK "; - break; - } - case 391: { - s += " DAYOFYEAR "; - break; - } - case 392: { - s += " DD "; - break; - } - case 393: { - s += " DEC "; - break; - } - case 394: { - s += " Decimal "; - break; - } - case 395: { - s += " Decimal128 "; - break; - } - case 396: { - s += " Decimal256 "; - break; - } - case 397: { - s += " Decimal32 "; - break; - } - case 398: { - s += " Decimal64 "; - break; - } - case 399: { - s += " decodeURLComponent "; - break; - } - case 400: { - s += " decodeXMLComponent "; - break; - } - case 401: { - s += " decrypt "; - break; - } - case 402: { - s += " DEDUPLICATE "; - break; - } - case 403: { - s += " DEFAULT "; - break; - } - case 404: { - s += " defaultProfiles "; - break; - } - case 405: { - s += " defaultRoles "; - break; - } - case 406: { - s += " defaultValueOfArgumentType "; - break; - } - case 407: { - s += " defaultValueOfTypeName "; - break; - } - case 408: { - s += " DELAY "; - break; - } - case 409: { - s += " DELETE "; - break; - } - case 410: { - s += " DELETE WHERE "; - break; - } - case 411: { - s += " deltaSum "; - break; - } - case 412: { - s += " deltaSumTimestamp "; - break; - } - case 413: { - s += " demangle "; - break; - } - case 414: { - s += " dense_rank "; - break; - } - case 415: { - s += " DESC "; - break; - } - case 416: { - s += " DESCENDING "; - break; - } - case 417: { - s += " DESCRIBE "; - break; - } - case 418: { - s += " DETACH "; - break; - } - case 419: { - s += " DETACH PARTITION "; - break; - } - case 420: { - s += " dictGet "; - break; - } - case 421: { - s += " dictGetChildren "; - break; - } - case 422: { - s += " dictGetDate "; - break; - } - case 423: { - s += " dictGetDateOrDefault "; - break; - } - case 424: { - s += " dictGetDateTime "; - break; - } - case 425: { - s += " dictGetDateTimeOrDefault "; - break; - } - case 426: { - s += " dictGetDescendants "; - break; - } - case 427: { - s += " dictGetFloat32 "; - break; - } - case 428: { - s += " dictGetFloat32OrDefault "; - break; - } - case 429: { - s += " dictGetFloat64 "; - break; - } - case 430: { - s += " dictGetFloat64OrDefault "; - break; - } - case 431: { - s += " dictGetHierarchy "; - break; - } - case 432: { - s += " dictGetInt16 "; - break; - } - case 433: { - s += " dictGetInt16OrDefault "; - break; - } - case 434: { - s += " dictGetInt32 "; - break; - } - case 435: { - s += " dictGetInt32OrDefault "; - break; - } - case 436: { - s += " dictGetInt64 "; - break; - } - case 437: { - s += " dictGetInt64OrDefault "; - break; - } - case 438: { - s += " dictGetInt8 "; - break; - } - case 439: { - s += " dictGetInt8OrDefault "; - break; - } - case 440: { - s += " dictGetOrDefault "; - break; - } - case 441: { - s += " dictGetOrNull "; - break; - } - case 442: { - s += " dictGetString "; - break; - } - case 443: { - s += " dictGetStringOrDefault "; - break; - } - case 444: { - s += " dictGetUInt16 "; - break; - } - case 445: { - s += " dictGetUInt16OrDefault "; - break; - } - case 446: { - s += " dictGetUInt32 "; - break; - } - case 447: { - s += " dictGetUInt32OrDefault "; - break; - } - case 448: { - s += " dictGetUInt64 "; - break; - } - case 449: { - s += " dictGetUInt64OrDefault "; - break; - } - case 450: { - s += " dictGetUInt8 "; - break; - } - case 451: { - s += " dictGetUInt8OrDefault "; - break; - } - case 452: { - s += " dictGetUUID "; - break; - } - case 453: { - s += " dictGetUUIDOrDefault "; - break; - } - case 454: { - s += " dictHas "; - break; - } - case 455: { - s += " DICTIONARIES "; - break; - } - case 456: { - s += " DICTIONARY "; - break; - } - case 457: { - s += " dictIsIn "; - break; - } - case 458: { - s += " DISK "; - break; - } - case 459: { - s += " DISTINCT "; - break; - } - case 460: { - s += " DISTRIBUTED "; - break; - } - case 461: { - s += " divide "; - break; - } - case 462: { - s += " domain "; - break; - } - case 463: { - s += " domainWithoutWWW "; - break; - } - case 464: { - s += " DOUBLE "; - break; - } - case 465: { - s += " DOUBLE PRECISION "; - break; - } - case 466: { - s += " DROP "; - break; - } - case 467: { - s += " DROP COLUMN "; - break; - } - case 468: { - s += " DROP CONSTRAINT "; - break; - } - case 469: { - s += " DROP DETACHED PART "; - break; - } - case 470: { - s += " DROP DETACHED PARTITION "; - break; - } - case 471: { - s += " DROP INDEX "; - break; - } - case 472: { - s += " DROP PARTITION "; - break; - } - case 473: { - s += " dumpColumnStructure "; - break; - } - case 474: { - s += " e "; - break; - } - case 475: { - s += " ELSE "; - break; - } - case 476: { - s += " empty "; - break; - } - case 477: { - s += " emptyArrayDate "; - break; - } - case 478: { - s += " emptyArrayDateTime "; - break; - } - case 479: { - s += " emptyArrayFloat32 "; - break; - } - case 480: { - s += " emptyArrayFloat64 "; - break; - } - case 481: { - s += " emptyArrayInt16 "; - break; - } - case 482: { - s += " emptyArrayInt32 "; - break; - } - case 483: { - s += " emptyArrayInt64 "; - break; - } - case 484: { - s += " emptyArrayInt8 "; - break; - } - case 485: { - s += " emptyArrayString "; - break; - } - case 486: { - s += " emptyArrayToSingle "; - break; - } - case 487: { - s += " emptyArrayUInt16 "; - break; - } - case 488: { - s += " emptyArrayUInt32 "; - break; - } - case 489: { - s += " emptyArrayUInt64 "; - break; - } - case 490: { - s += " emptyArrayUInt8 "; - break; - } - case 491: { - s += " enabledProfiles "; - break; - } - case 492: { - s += " enabledRoles "; - break; - } - case 493: { - s += " encodeXMLComponent "; - break; - } - case 494: { - s += " encrypt "; - break; - } - case 495: { - s += " END "; - break; - } - case 496: { - s += " endsWith "; - break; - } - case 497: { - s += " ENGINE "; - break; - } - case 498: { - s += " entropy "; - break; - } - case 499: { - s += " Enum "; - break; - } - case 500: { - s += " ENUM "; - break; - } - case 501: { - s += " Enum16 "; - break; - } - case 502: { - s += " Enum8 "; - break; - } - case 503: { - s += " equals "; - break; - } - case 504: { - s += " erf "; - break; - } - case 505: { - s += " erfc "; - break; - } - case 506: { - s += " errorCodeToName "; - break; - } - case 507: { - s += " evalMLMethod "; - break; - } - case 508: { - s += " EVENTS "; - break; - } - case 509: { - s += " EXCHANGE TABLES "; - break; - } - case 510: { - s += " EXISTS "; - break; - } - case 511: { - s += " exp "; - break; - } - case 512: { - s += " exp10 "; - break; - } - case 513: { - s += " exp2 "; - break; - } - case 514: { - s += " EXPLAIN "; - break; - } - case 515: { - s += " exponentialMovingAverage "; - break; - } - case 516: { - s += " EXPRESSION "; - break; - } - case 517: { - s += " extract "; - break; - } - case 518: { - s += " EXTRACT "; - break; - } - case 519: { - s += " extractAll "; - break; - } - case 520: { - s += " extractAllGroups "; - break; - } - case 521: { - s += " extractAllGroupsHorizontal "; - break; - } - case 522: { - s += " extractAllGroupsVertical "; - break; - } - case 523: { - s += " extractGroups "; - break; - } - case 524: { - s += " extractTextFromHTML "; - break; - } - case 525: { - s += " extractURLParameter "; - break; - } - case 526: { - s += " extractURLParameterNames "; - break; - } - case 527: { - s += " extractURLParameters "; - break; - } - case 528: { - s += " farmFingerprint64 "; - break; - } - case 529: { - s += " farmHash64 "; - break; - } - case 530: { - s += " FETCHES "; - break; - } - case 531: { - s += " FETCH PART "; - break; - } - case 532: { - s += " FETCH PARTITION "; - break; - } - case 533: { - s += " file "; - break; - } - case 534: { - s += " filesystemAvailable "; - break; - } - case 535: { - s += " filesystemCapacity "; - break; - } - case 536: { - s += " filesystemFree "; - break; - } - case 537: { - s += " FINAL "; - break; - } - case 538: { - s += " finalizeAggregation "; - break; - } - case 539: { - s += " FIRST "; - break; - } - case 540: { - s += " firstSignificantSubdomain "; - break; - } - case 541: { - s += " firstSignificantSubdomainCustom "; - break; - } - case 542: { - s += " first_value "; - break; - } - case 543: { - s += " FIXED "; - break; - } - case 544: { - s += " FixedString "; - break; - } - case 545: { - s += " flatten "; - break; - } - case 546: { - s += " FLOAT "; - break; - } - case 547: { - s += " Float32 "; - break; - } - case 548: { - s += " Float64 "; - break; - } - case 549: { - s += " floor "; - break; - } - case 550: { - s += " FLUSH "; - break; - } - case 551: { - s += " FOR "; - break; - } - case 552: { - s += " ForEach "; - break; - } - case 553: { - s += " format "; - break; - } - case 554: { - s += " FORMAT "; - break; - } - case 555: { - s += " formatDateTime "; - break; - } - case 556: { - s += " formatReadableQuantity "; - break; - } - case 557: { - s += " formatReadableDecimalSize "; - break; - } - case 558: { - s += " formatReadableSize "; - break; - } - case 559: { - s += " formatReadableTimeDelta "; - break; - } - case 560: { - s += " formatRow "; - break; - } - case 561: { - s += " formatRowNoNewline "; - break; - } - case 562: { - s += " FQDN "; - break; - } - case 563: { - s += " fragment "; - break; - } - case 564: { - s += " FREEZE "; - break; - } - case 565: { - s += " FROM "; - break; - } - case 566: { - s += " FROM_BASE64 "; - break; - } - case 567: { - s += " fromModifiedJulianDay "; - break; - } - case 568: { - s += " fromModifiedJulianDayOrNull "; - break; - } - case 569: { - s += " FROM_UNIXTIME "; - break; - } - case 570: { - s += " fromUnixTimestamp "; - break; - } - case 571: { - s += " fromUnixTimestamp64Micro "; - break; - } - case 572: { - s += " fromUnixTimestamp64Milli "; - break; - } - case 573: { - s += " fromUnixTimestamp64Nano "; - break; - } - case 574: { - s += " FULL "; - break; - } - case 575: { - s += " fullHostName "; - break; - } - case 576: { - s += " FUNCTION "; - break; - } - case 577: { - s += " fuzzBits "; - break; - } - case 578: { - s += " gccMurmurHash "; - break; - } - case 579: { - s += " gcd "; - break; - } - case 580: { - s += " generateUUIDv4 "; - break; - } - case 581: { - s += " geoDistance "; - break; - } - case 582: { - s += " geohashDecode "; - break; - } - case 583: { - s += " geohashEncode "; - break; - } - case 584: { - s += " geohashesInBox "; - break; - } - case 585: { - s += " geoToH3 "; - break; - } - case 586: { - s += " geoToS2 "; - break; - } - case 587: { - s += " getMacro "; - break; - } - case 588: { - s += " __getScalar "; - break; - } - case 589: { - s += " getServerPort "; - break; - } - case 590: { - s += " getSetting "; - break; - } - case 591: { - s += " getSizeOfEnumType "; - break; - } - case 592: { - s += " GLOBAL "; - break; - } - case 593: { - s += " globalIn "; - break; - } - case 594: { - s += " globalInIgnoreSet "; - break; - } - case 595: { - s += " globalNotIn "; - break; - } - case 596: { - s += " globalNotInIgnoreSet "; - break; - } - case 597: { - s += " globalNotNullIn "; - break; - } - case 598: { - s += " globalNotNullInIgnoreSet "; - break; - } - case 599: { - s += " globalNullIn "; - break; - } - case 600: { - s += " globalNullInIgnoreSet "; - break; - } - case 601: { - s += " globalVariable "; - break; - } - case 602: { - s += " GRANULARITY "; - break; - } - case 603: { - s += " greatCircleAngle "; - break; - } - case 604: { - s += " greatCircleDistance "; - break; - } - case 605: { - s += " greater "; - break; - } - case 606: { - s += " greaterOrEquals "; - break; - } - case 607: { - s += " greatest "; - break; - } - case 608: { - s += " GROUP "; - break; - } - case 609: { - s += " groupArray "; - break; - } - case 610: { - s += " groupArrayInsertAt "; - break; - } - case 611: { - s += " groupArrayMovingAvg "; - break; - } - case 612: { - s += " groupArrayMovingSum "; - break; - } - case 613: { - s += " groupArraySample "; - break; - } - case 614: { - s += " groupBitAnd "; - break; - } - case 615: { - s += " groupBitmap "; - break; - } - case 616: { - s += " groupBitmapAnd "; - break; - } - case 617: { - s += " groupBitmapOr "; - break; - } - case 618: { - s += " groupBitmapXor "; - break; - } - case 619: { - s += " groupBitOr "; - break; - } - case 620: { - s += " groupBitXor "; - break; - } - case 621: { - s += " GROUP BY "; - break; - } - case 622: { - s += " groupUniqArray "; - break; - } - case 623: { - s += " h3EdgeAngle "; - break; - } - case 624: { - s += " h3EdgeLengthM "; - break; - } - case 625: { - s += " h3GetBaseCell "; - break; - } - case 626: { - s += " h3GetFaces "; - break; - } - case 627: { - s += " h3GetResolution "; - break; - } - case 628: { - s += " h3HexAreaM2 "; - break; - } - case 629: { - s += " h3IndexesAreNeighbors "; - break; - } - case 630: { - s += " h3IsPentagon "; - break; - } - case 631: { - s += " h3IsResClassIII "; - break; - } - case 632: { - s += " h3IsValid "; - break; - } - case 633: { - s += " h3kRing "; - break; - } - case 634: { - s += " h3ToChildren "; - break; - } - case 635: { - s += " h3ToGeo "; - break; - } - case 636: { - s += " h3ToGeoBoundary "; - break; - } - case 637: { - s += " h3ToParent "; - break; - } - case 638: { - s += " h3ToString "; - break; - } - case 639: { - s += " halfMD5 "; - break; - } - case 640: { - s += " has "; - break; - } - case 641: { - s += " hasAll "; - break; - } - case 642: { - s += " hasAny "; - break; - } - case 643: { - s += " hasColumnInTable "; - break; - } - case 644: { - s += " hasSubstr "; - break; - } - case 645: { - s += " hasThreadFuzzer "; - break; - } - case 646: { - s += " hasToken "; - break; - } - case 647: { - s += " hasTokenCaseInsensitive "; - break; - } - case 648: { - s += " HAVING "; - break; - } - case 649: { - s += " hex "; - break; - } - case 650: { - s += " HH "; - break; - } - case 651: { - s += " HIERARCHICAL "; - break; - } - case 652: { - s += " histogram "; - break; - } - case 653: { - s += " hiveHash "; - break; - } - case 654: { - s += " hostname "; - break; - } - case 655: { - s += " hostName "; - break; - } - case 656: { - s += " HOUR "; - break; - } - case 657: { - s += " hypot "; - break; - } - case 658: { - s += " ID "; - break; - } - case 659: { - s += " identity "; - break; - } - case 660: { - s += " if "; - break; - } - case 661: { - s += " IF "; - break; - } - case 662: { - s += " IF EXISTS "; - break; - } - case 663: { - s += " IF NOT EXISTS "; - break; - } - case 664: { - s += " ifNotFinite "; - break; - } - case 665: { - s += " ifNull "; - break; - } - case 666: { - s += " ignore "; - break; - } - case 667: { - s += " ilike "; - break; - } - case 668: { - s += " ILIKE "; - break; - } - case 669: { - s += " in "; - break; - } - case 670: { - s += " IN "; - break; - } - case 671: { - s += " INDEX "; - break; - } - case 672: { - s += " indexHint "; - break; - } - case 673: { - s += " indexOf "; - break; - } - case 674: { - s += " INET4 "; - break; - } - case 675: { - s += " INET6 "; - break; - } - case 676: { - s += " INET6_ATON "; - break; - } - case 677: { - s += " INET6_NTOA "; - break; - } - case 678: { - s += " INET_ATON "; - break; - } - case 679: { - s += " INET_NTOA "; - break; - } - case 680: { - s += " INF "; - break; - } - case 681: { - s += " inIgnoreSet "; - break; - } - case 682: { - s += " initializeAggregation "; - break; - } - case 683: { - s += " initial_query_id "; - break; - } - case 684: { - s += " initialQueryID "; - break; - } - case 685: { - s += " INJECTIVE "; - break; - } - case 686: { - s += " INNER "; - break; - } - case 687: { - s += " IN PARTITION "; - break; - } - case 688: { - s += " INSERT "; - break; - } - case 689: { - s += " INSERT INTO "; - break; - } - case 690: { - s += " INT "; - break; - } - case 691: { - s += " INT1 "; - break; - } - case 692: { - s += " Int128 "; - break; - } - case 693: { - s += " Int16 "; - break; - } - case 694: { - s += " INT1 SIGNED "; - break; - } - case 695: { - s += " INT1 UNSIGNED "; - break; - } - case 696: { - s += " Int256 "; - break; - } - case 697: { - s += " Int32 "; - break; - } - case 698: { - s += " Int64 "; - break; - } - case 699: { - s += " Int8 "; - break; - } - case 700: { - s += " intDiv "; - break; - } - case 701: { - s += " intDivOrZero "; - break; - } - case 702: { - s += " INTEGER "; - break; - } - case 703: { - s += " INTEGER SIGNED "; - break; - } - case 704: { - s += " INTEGER UNSIGNED "; - break; - } - case 705: { - s += " INTERVAL "; - break; - } - case 706: { - s += " IntervalDay "; - break; - } - case 707: { - s += " IntervalHour "; - break; - } - case 708: { - s += " intervalLengthSum "; - break; - } - case 709: { - s += " IntervalMinute "; - break; - } - case 710: { - s += " IntervalMonth "; - break; - } - case 711: { - s += " IntervalQuarter "; - break; - } - case 712: { - s += " IntervalSecond "; - break; - } - case 713: { - s += " IntervalWeek "; - break; - } - case 714: { - s += " IntervalYear "; - break; - } - case 715: { - s += " intExp10 "; - break; - } - case 716: { - s += " intExp2 "; - break; - } - case 717: { - s += " intHash32 "; - break; - } - case 718: { - s += " intHash64 "; - break; - } - case 719: { - s += " INTO "; - break; - } - case 720: { - s += " INTO OUTFILE "; - break; - } - case 721: { - s += " INT SIGNED "; - break; - } - case 722: { - s += " INT UNSIGNED "; - break; - } - case 723: { - s += " IPv4 "; - break; - } - case 724: { - s += " IPv4CIDRToRange "; - break; - } - case 725: { - s += " IPv4NumToString "; - break; - } - case 726: { - s += " IPv4NumToStringClassC "; - break; - } - case 727: { - s += " IPv4StringToNum "; - break; - } - case 728: { - s += " IPv4ToIPv6 "; - break; - } - case 729: { - s += " IPv6 "; - break; - } - case 730: { - s += " IPv6CIDRToRange "; - break; - } - case 731: { - s += " IPv6NumToString "; - break; - } - case 732: { - s += " IPv6StringToNum "; - break; - } - case 733: { - s += " IS "; - break; - } - case 734: { - s += " isConstant "; - break; - } - case 735: { - s += " isDecimalOverflow "; - break; - } - case 736: { - s += " isFinite "; - break; - } - case 737: { - s += " isInfinite "; - break; - } - case 738: { - s += " isIPAddressInRange "; - break; - } - case 739: { - s += " isIPv4String "; - break; - } - case 740: { - s += " isIPv6String "; - break; - } - case 741: { - s += " isNaN "; - break; - } - case 742: { - s += " isNotNull "; - break; - } - case 743: { - s += " isNull "; - break; - } - case 744: { - s += " IS_OBJECT_ID "; - break; - } - case 745: { - s += " isValidJSON "; - break; - } - case 746: { - s += " isValidUTF8 "; - break; - } - case 747: { - s += " isZeroOrNull "; - break; - } - case 748: { - s += " javaHash "; - break; - } - case 749: { - s += " javaHashUTF16LE "; - break; - } - case 750: { - s += " JOIN "; - break; - } - case 751: { - s += " joinGet "; - break; - } - case 752: { - s += " joinGetOrNull "; - break; - } - case 753: { - s += " JSON_EXISTS "; - break; - } - case 754: { - s += " JSONExtract "; - break; - } - case 755: { - s += " JSONExtractArrayRaw "; - break; - } - case 756: { - s += " JSONExtractBool "; - break; - } - case 757: { - s += " JSONExtractFloat "; - break; - } - case 758: { - s += " JSONExtractInt "; - break; - } - case 759: { - s += " JSONExtractKeysAndValues "; - break; - } - case 760: { - s += " JSONExtractKeysAndValuesRaw "; - break; - } - case 761: { - s += " JSONExtractKeys "; - break; - } - case 762: { - s += " JSONExtractRaw "; - break; - } - case 763: { - s += " JSONExtractString "; - break; - } - case 764: { - s += " JSONExtractUInt "; - break; - } - case 765: { - s += " JSONHas "; - break; - } - case 766: { - s += " JSONKey "; - break; - } - case 767: { - s += " JSONLength "; - break; - } - case 768: { - s += " JSON_QUERY "; - break; - } - case 769: { - s += " JSONType "; - break; - } - case 770: { - s += " JSON_VALUE "; - break; - } - case 771: { - s += " jumpConsistentHash "; - break; - } - case 772: { - s += " KEY "; - break; - } - case 773: { - s += " KILL "; - break; - } - case 774: { - s += " kurtPop "; - break; - } - case 775: { - s += " kurtSamp "; - break; - } - case 776: { - s += " lagInFrame "; - break; - } - case 777: { - s += " LAST "; - break; - } - case 778: { - s += " last_value "; - break; - } - case 779: { - s += " LAYOUT "; - break; - } - case 780: { - s += " lcase "; - break; - } - case 781: { - s += " lcm "; - break; - } - case 782: { - s += " leadInFrame "; - break; - } - case 783: { - s += " LEADING "; - break; - } - case 784: { - s += " least "; - break; - } - case 785: { - s += " LEFT "; - break; - } - case 786: { - s += " LEFT ARRAY JOIN "; - break; - } - case 787: { - s += " leftPad "; - break; - } - case 788: { - s += " leftPadUTF8 "; - break; - } - case 789: { - s += " lemmatize "; - break; - } - case 790: { - s += " length "; - break; - } - case 791: { - s += " lengthUTF8 "; - break; - } - case 792: { - s += " less "; - break; - } - case 793: { - s += " lessOrEquals "; - break; - } - case 794: { - s += " lgamma "; - break; - } - case 795: { - s += " LIFETIME "; - break; - } - case 796: { - s += " like "; - break; - } - case 797: { - s += " LIKE "; - break; - } - case 798: { - s += " LIMIT "; - break; - } - case 799: { - s += " LIVE "; - break; - } - case 800: { - s += " ln "; - break; - } - case 801: { - s += " LOCAL "; - break; - } - case 802: { - s += " locate "; - break; - } - case 803: { - s += " log "; - break; - } - case 804: { - s += " log10 "; - break; - } - case 805: { - s += " log1p "; - break; - } - case 806: { - s += " log2 "; - break; - } - case 807: { - s += " LOGS "; - break; - } - case 808: { - s += " logTrace "; - break; - } - case 809: { - s += " LONGBLOB "; - break; - } - case 810: { - s += " LONGTEXT "; - break; - } - case 811: { - s += " LowCardinality "; - break; - } - case 812: { - s += " lowCardinalityIndices "; - break; - } - case 813: { - s += " lowCardinalityKeys "; - break; - } - case 814: { - s += " lower "; - break; - } - case 815: { - s += " lowerUTF8 "; - break; - } - case 816: { - s += " lpad "; - break; - } - case 817: { - s += " LTRIM "; - break; - } - case 818: { - s += " M "; - break; - } - case 819: { - s += " MACNumToString "; - break; - } - case 820: { - s += " MACStringToNum "; - break; - } - case 821: { - s += " MACStringToOUI "; - break; - } - case 822: { - s += " mannWhitneyUTest "; - break; - } - case 823: { - s += " map "; - break; - } - case 824: { - s += " Map "; - break; - } - case 825: { - s += " mapAdd "; - break; - } - case 826: { - s += " mapContains "; - break; - } - case 827: { - s += " mapKeys "; - break; - } - case 828: { - s += " mapPopulateSeries "; - break; - } - case 829: { - s += " mapSubtract "; - break; - } - case 830: { - s += " mapValues "; - break; - } - case 831: { - s += " match "; - break; - } - case 832: { - s += " materialize "; - break; - } - case 833: { - s += " MATERIALIZE "; - break; - } - case 834: { - s += " MATERIALIZED "; - break; - } - case 835: { - s += " MATERIALIZE INDEX "; - break; - } - case 836: { - s += " MATERIALIZE TTL "; - break; - } - case 837: { - s += " max "; - break; - } - case 838: { - s += " MAX "; - break; - } - case 839: { - s += " maxIntersections "; - break; - } - case 840: { - s += " maxIntersectionsPosition "; - break; - } - case 841: { - s += " maxMap "; - break; - } - case 842: { - s += " MD4 "; - break; - } - case 843: { - s += " MD5 "; - break; - } - case 844: { - s += " median "; - break; - } - case 845: { - s += " medianBFloat16 "; - break; - } - case 846: { - s += " medianBFloat16Weighted "; - break; - } - case 847: { - s += " medianDeterministic "; - break; - } - case 848: { - s += " medianExact "; - break; - } - case 849: { - s += " medianExactHigh "; - break; - } - case 850: { - s += " medianExactLow "; - break; - } - case 851: { - s += " medianExactWeighted "; - break; - } - case 852: { - s += " medianTDigest "; - break; - } - case 853: { - s += " medianTDigestWeighted "; - break; - } - case 854: { - s += " medianTiming "; - break; - } - case 855: { - s += " medianTimingWeighted "; - break; - } - case 856: { - s += " MEDIUMBLOB "; - break; - } - case 857: { - s += " MEDIUMINT "; - break; - } - case 858: { - s += " MEDIUMINT SIGNED "; - break; - } - case 859: { - s += " MEDIUMINT UNSIGNED "; - break; - } - case 860: { - s += " MEDIUMTEXT "; - break; - } - case 861: { - s += " Merge "; - break; - } - case 862: { - s += " MERGES "; - break; - } - case 863: { - s += " metroHash64 "; - break; - } - case 864: { - s += " MI "; - break; - } - case 865: { - s += " mid "; - break; - } - case 866: { - s += " min "; - break; - } - case 867: { - s += " MIN "; - break; - } - case 868: { - s += " minMap "; - break; - } - case 869: { - s += " minus "; - break; - } - case 870: { - s += " MINUTE "; - break; - } - case 871: { - s += " MM "; - break; - } - case 872: { - s += " mod "; - break; - } - case 873: { - s += " MODIFY "; - break; - } - case 874: { - s += " MODIFY COLUMN "; - break; - } - case 875: { - s += " MODIFY ORDER BY "; - break; - } - case 876: { - s += " MODIFY QUERY "; - break; - } - case 877: { - s += " MODIFY SETTING "; - break; - } - case 878: { - s += " MODIFY TTL "; - break; - } - case 879: { - s += " modulo "; - break; - } - case 880: { - s += " moduloLegacy "; - break; - } - case 881: { - s += " moduloOrZero "; - break; - } - case 882: { - s += " MONTH "; - break; - } - case 883: { - s += " MOVE "; - break; - } - case 884: { - s += " MOVE PART "; - break; - } - case 885: { - s += " MOVE PARTITION "; - break; - } - case 886: { - s += " movingXXX "; - break; - } - case 887: { - s += " multiFuzzyMatchAllIndices "; - break; - } - case 888: { - s += " multiFuzzyMatchAny "; - break; - } - case 889: { - s += " multiFuzzyMatchAnyIndex "; - break; - } - case 890: { - s += " multiIf "; - break; - } - case 891: { - s += " multiMatchAllIndices "; - break; - } - case 892: { - s += " multiMatchAny "; - break; - } - case 893: { - s += " multiMatchAnyIndex "; - break; - } - case 894: { - s += " multiply "; - break; - } - case 895: { - s += " MultiPolygon "; - break; - } - case 896: { - s += " multiSearchAllPositions "; - break; - } - case 897: { - s += " multiSearchAllPositionsCaseInsensitive "; - break; - } - case 898: { - s += " multiSearchAllPositionsCaseInsensitiveUTF8 "; - break; - } - case 899: { - s += " multiSearchAllPositionsUTF8 "; - break; - } - case 900: { - s += " multiSearchAny "; - break; - } - case 901: { - s += " multiSearchAnyCaseInsensitive "; - break; - } - case 902: { - s += " multiSearchAnyCaseInsensitiveUTF8 "; - break; - } - case 903: { - s += " multiSearchAnyUTF8 "; - break; - } - case 904: { - s += " multiSearchFirstIndex "; - break; - } - case 905: { - s += " multiSearchFirstIndexCaseInsensitive "; - break; - } - case 906: { - s += " multiSearchFirstIndexCaseInsensitiveUTF8 "; - break; - } - case 907: { - s += " multiSearchFirstIndexUTF8 "; - break; - } - case 908: { - s += " multiSearchFirstPosition "; - break; - } - case 909: { - s += " multiSearchFirstPositionCaseInsensitive "; - break; - } - case 910: { - s += " multiSearchFirstPositionCaseInsensitiveUTF8 "; - break; - } - case 911: { - s += " multiSearchFirstPositionUTF8 "; - break; - } - case 912: { - s += " murmurHash2_32 "; - break; - } - case 913: { - s += " murmurHash2_64 "; - break; - } - case 914: { - s += " murmurHash3_128 "; - break; - } - case 915: { - s += " murmurHash3_32 "; - break; - } - case 916: { - s += " murmurHash3_64 "; - break; - } - case 917: { - s += " MUTATION "; - break; - } - case 918: { - s += " N "; - break; - } - case 919: { - s += " NAME "; - break; - } - case 920: { - s += " NAN_SQL "; - break; - } - case 921: { - s += " NATIONAL CHAR "; - break; - } - case 922: { - s += " NATIONAL CHARACTER "; - break; - } - case 923: { - s += " NATIONAL CHARACTER LARGE OBJECT "; - break; - } - case 924: { - s += " NATIONAL CHARACTER VARYING "; - break; - } - case 925: { - s += " NATIONAL CHAR VARYING "; - break; - } - case 926: { - s += " NCHAR "; - break; - } - case 927: { - s += " NCHAR LARGE OBJECT "; - break; - } - case 928: { - s += " NCHAR VARYING "; - break; - } - case 929: { - s += " negate "; - break; - } - case 930: { - s += " neighbor "; - break; - } - case 931: { - s += " Nested "; - break; - } - case 932: { - s += " netloc "; - break; - } - case 933: { - s += " ngramDistance "; - break; - } - case 934: { - s += " ngramDistanceCaseInsensitive "; - break; - } - case 935: { - s += " ngramDistanceCaseInsensitiveUTF8 "; - break; - } - case 936: { - s += " ngramDistanceUTF8 "; - break; - } - case 937: { - s += " ngramMinHash "; - break; - } - case 938: { - s += " ngramMinHashArg "; - break; - } - case 939: { - s += " ngramMinHashArgCaseInsensitive "; - break; - } - case 940: { - s += " ngramMinHashArgCaseInsensitiveUTF8 "; - break; - } - case 941: { - s += " ngramMinHashArgUTF8 "; - break; - } - case 942: { - s += " ngramMinHashCaseInsensitive "; - break; - } - case 943: { - s += " ngramMinHashCaseInsensitiveUTF8 "; - break; - } - case 944: { - s += " ngramMinHashUTF8 "; - break; - } - case 945: { - s += " ngramSearch "; - break; - } - case 946: { - s += " ngramSearchCaseInsensitive "; - break; - } - case 947: { - s += " ngramSearchCaseInsensitiveUTF8 "; - break; - } - case 948: { - s += " ngramSearchUTF8 "; - break; - } - case 949: { - s += " ngramSimHash "; - break; - } - case 950: { - s += " ngramSimHashCaseInsensitive "; - break; - } - case 951: { - s += " ngramSimHashCaseInsensitiveUTF8 "; - break; - } - case 952: { - s += " ngramSimHashUTF8 "; - break; - } - case 953: { - s += " NO "; - break; - } - case 954: { - s += " NO DELAY "; - break; - } - case 955: { - s += " NONE "; - break; - } - case 956: { - s += " normalizedQueryHash "; - break; - } - case 957: { - s += " normalizedQueryHashKeepNames "; - break; - } - case 958: { - s += " normalizeQuery "; - break; - } - case 959: { - s += " normalizeQueryKeepNames "; - break; - } - case 960: { - s += " not "; - break; - } - case 961: { - s += " NOT "; - break; - } - case 962: { - s += " notEmpty "; - break; - } - case 963: { - s += " notEquals "; - break; - } - case 964: { - s += " nothing "; - break; - } - case 965: { - s += " Nothing "; - break; - } - case 966: { - s += " notILike "; - break; - } - case 967: { - s += " notIn "; - break; - } - case 968: { - s += " notInIgnoreSet "; - break; - } - case 969: { - s += " notLike "; - break; - } - case 970: { - s += " notNullIn "; - break; - } - case 971: { - s += " notNullInIgnoreSet "; - break; - } - case 972: { - s += " now "; - break; - } - case 973: { - s += " now64 "; - break; - } - case 974: { - s += " Null "; - break; - } - case 975: { - s += " Nullable "; - break; - } - case 976: { - s += " nullIf "; - break; - } - case 977: { - s += " nullIn "; - break; - } - case 978: { - s += " nullInIgnoreSet "; - break; - } - case 979: { - s += " NULLS "; - break; - } - case 980: { - s += " NULL_SQL "; - break; - } - case 981: { - s += " NUMERIC "; - break; - } - case 982: { - s += " NVARCHAR "; - break; - } - case 983: { - s += " OFFSET "; - break; - } - case 984: { - s += " ON "; - break; - } - case 985: { - s += " ONLY "; - break; - } - case 986: { - s += " OPTIMIZE "; - break; - } - case 987: { - s += " OPTIMIZE TABLE "; - break; - } - case 988: { - s += " or "; - break; - } - case 989: { - s += " OR "; - break; - } - case 990: { - s += " ORDER "; - break; - } - case 991: { - s += " ORDER BY "; - break; - } - case 992: { - s += " OR REPLACE "; - break; - } - case 993: { - s += " OUTER "; - break; - } - case 994: { - s += " OUTFILE "; - break; - } - case 995: { - s += " parseDateTime32BestEffort "; - break; - } - case 996: { - s += " parseDateTime32BestEffortOrNull "; - break; - } - case 997: { - s += " parseDateTime32BestEffortOrZero "; - break; - } - case 998: { - s += " parseDateTime64BestEffort "; - break; - } - case 999: { - s += " parseDateTime64BestEffortOrNull "; - break; - } - case 1000: { - s += " parseDateTime64BestEffortOrZero "; - break; - } - case 1001: { - s += " parseDateTimeBestEffort "; - break; - } - case 1002: { - s += " parseDateTimeBestEffortOrNull "; - break; - } - case 1003: { - s += " parseDateTimeBestEffortOrZero "; - break; - } - case 1004: { - s += " parseDateTimeBestEffortUS "; - break; - } - case 1005: { - s += " parseDateTimeBestEffortUSOrNull "; - break; - } - case 1006: { - s += " parseDateTimeBestEffortUSOrZero "; - break; - } - case 1007: { - s += " parseTimeDelta "; - break; - } - case 1008: { - s += " PARTITION "; - break; - } - case 1009: { - s += " PARTITION BY "; - break; - } - case 1010: { - s += " partitionId "; - break; - } - case 1011: { - s += " path "; - break; - } - case 1012: { - s += " pathFull "; - break; - } - case 1013: { - s += " pi "; - break; - } - case 1014: { - s += " plus "; - break; - } - case 1015: { - s += " Point "; - break; - } - case 1016: { - s += " pointInEllipses "; - break; - } - case 1017: { - s += " pointInPolygon "; - break; - } - case 1018: { - s += " Polygon "; - break; - } - case 1019: { - s += " polygonAreaCartesian "; - break; - } - case 1020: { - s += " polygonAreaSpherical "; - break; - } - case 1021: { - s += " polygonConvexHullCartesian "; - break; - } - case 1022: { - s += " polygonPerimeterCartesian "; - break; - } - case 1023: { - s += " polygonPerimeterSpherical "; - break; - } - case 1024: { - s += " polygonsDistanceCartesian "; - break; - } - case 1025: { - s += " polygonsDistanceSpherical "; - break; - } - case 1026: { - s += " polygonsEqualsCartesian "; - break; - } - case 1027: { - s += " polygonsIntersectionCartesian "; - break; - } - case 1028: { - s += " polygonsIntersectionSpherical "; - break; - } - case 1029: { - s += " polygonsSymDifferenceCartesian "; - break; - } - case 1030: { - s += " polygonsSymDifferenceSpherical "; - break; - } - case 1031: { - s += " polygonsUnionCartesian "; - break; - } - case 1032: { - s += " polygonsUnionSpherical "; - break; - } - case 1033: { - s += " polygonsWithinCartesian "; - break; - } - case 1034: { - s += " polygonsWithinSpherical "; - break; - } - case 1035: { - s += " POPULATE "; - break; - } - case 1036: { - s += " port "; - break; - } - case 1037: { - s += " position "; - break; - } - case 1038: { - s += " positionCaseInsensitive "; - break; - } - case 1039: { - s += " positionCaseInsensitiveUTF8 "; - break; - } - case 1040: { - s += " positionUTF8 "; - break; - } - case 1041: { - s += " pow "; - break; - } - case 1042: { - s += " power "; - break; - } - case 1043: { - s += " PREWHERE "; - break; - } - case 1044: { - s += " PRIMARY "; - break; - } - case 1045: { - s += " PRIMARY KEY "; - break; - } - case 1046: { - s += " PROJECTION "; - break; - } - case 1047: { - s += " protocol "; - break; - } - case 1048: { - s += " Q "; - break; - } - case 1049: { - s += " QQ "; - break; - } - case 1050: { - s += " quantile "; - break; - } - case 1051: { - s += " quantileBFloat16 "; - break; - } - case 1052: { - s += " quantileBFloat16Weighted "; - break; - } - case 1053: { - s += " quantileDeterministic "; - break; - } - case 1054: { - s += " quantileExact "; - break; - } - case 1055: { - s += " quantileExactExclusive "; - break; - } - case 1056: { - s += " quantileExactHigh "; - break; - } - case 1057: { - s += " quantileExactInclusive "; - break; - } - case 1058: { - s += " quantileExactLow "; - break; - } - case 1059: { - s += " quantileExactWeighted "; - break; - } - case 1060: { - s += " quantiles "; - break; - } - case 1061: { - s += " quantilesBFloat16 "; - break; - } - case 1062: { - s += " quantilesBFloat16Weighted "; - break; - } - case 1063: { - s += " quantilesDeterministic "; - break; - } - case 1064: { - s += " quantilesExact "; - break; - } - case 1065: { - s += " quantilesExactExclusive "; - break; - } - case 1066: { - s += " quantilesExactHigh "; - break; - } - case 1067: { - s += " quantilesExactInclusive "; - break; - } - case 1068: { - s += " quantilesExactLow "; - break; - } - case 1069: { - s += " quantilesExactWeighted "; - break; - } - case 1070: { - s += " quantilesTDigest "; - break; - } - case 1071: { - s += " quantilesTDigestWeighted "; - break; - } - case 1072: { - s += " quantilesTiming "; - break; - } - case 1073: { - s += " quantilesTimingWeighted "; - break; - } - case 1074: { - s += " quantileTDigest "; - break; - } - case 1075: { - s += " quantileTDigestWeighted "; - break; - } - case 1076: { - s += " quantileTiming "; - break; - } - case 1077: { - s += " quantileTimingWeighted "; - break; - } - case 1078: { - s += " QUARTER "; - break; - } - case 1079: { - s += " query_id "; - break; - } - case 1080: { - s += " queryID "; - break; - } - case 1081: { - s += " queryString "; - break; - } - case 1082: { - s += " queryStringAndFragment "; - break; - } - case 1083: { - s += " rand "; - break; - } - case 1084: { - s += " rand32 "; - break; - } - case 1085: { - s += " rand64 "; - break; - } - case 1086: { - s += " randConstant "; - break; - } - case 1087: { - s += " randomFixedString "; - break; - } - case 1088: { - s += " randomPrintableASCII "; - break; - } - case 1089: { - s += " randomString "; - break; - } - case 1090: { - s += " randomStringUTF8 "; - break; - } - case 1091: { - s += " range "; - break; - } - case 1092: { - s += " RANGE "; - break; - } - case 1093: { - s += " rank "; - break; - } - case 1094: { - s += " rankCorr "; - break; - } - case 1095: { - s += " readWKTMultiPolygon "; - break; - } - case 1096: { - s += " readWKTPoint "; - break; - } - case 1097: { - s += " readWKTPolygon "; - break; - } - case 1098: { - s += " readWKTRing "; - break; - } - case 1099: { - s += " REAL "; - break; - } - case 1100: { - s += " REFRESH "; - break; - } - case 1101: { - s += " regexpQuoteMeta "; - break; - } - case 1102: { - s += " regionHierarchy "; - break; - } - case 1103: { - s += " regionIn "; - break; - } - case 1104: { - s += " regionToArea "; - break; - } - case 1105: { - s += " regionToCity "; - break; - } - case 1106: { - s += " regionToContinent "; - break; - } - case 1107: { - s += " regionToCountry "; - break; - } - case 1108: { - s += " regionToDistrict "; - break; - } - case 1109: { - s += " regionToName "; - break; - } - case 1110: { - s += " regionToPopulation "; - break; - } - case 1111: { - s += " regionToTopContinent "; - break; - } - case 1112: { - s += " reinterpret "; - break; - } - case 1113: { - s += " reinterpretAsDate "; - break; - } - case 1114: { - s += " reinterpretAsDateTime "; - break; - } - case 1115: { - s += " reinterpretAsFixedString "; - break; - } - case 1116: { - s += " reinterpretAsFloat32 "; - break; - } - case 1117: { - s += " reinterpretAsFloat64 "; - break; - } - case 1118: { - s += " reinterpretAsInt128 "; - break; - } - case 1119: { - s += " reinterpretAsInt16 "; - break; - } - case 1120: { - s += " reinterpretAsInt256 "; - break; - } - case 1121: { - s += " reinterpretAsInt32 "; - break; - } - case 1122: { - s += " reinterpretAsInt64 "; - break; - } - case 1123: { - s += " reinterpretAsInt8 "; - break; - } - case 1124: { - s += " reinterpretAsString "; - break; - } - case 1125: { - s += " reinterpretAsUInt128 "; - break; - } - case 1126: { - s += " reinterpretAsUInt16 "; - break; - } - case 1127: { - s += " reinterpretAsUInt256 "; - break; - } - case 1128: { - s += " reinterpretAsUInt32 "; - break; - } - case 1129: { - s += " reinterpretAsUInt64 "; - break; - } - case 1130: { - s += " reinterpretAsUInt8 "; - break; - } - case 1131: { - s += " reinterpretAsUUID "; - break; - } - case 1132: { - s += " RELOAD "; - break; - } - case 1133: { - s += " REMOVE "; - break; - } - case 1134: { - s += " RENAME "; - break; - } - case 1135: { - s += " RENAME COLUMN "; - break; - } - case 1136: { - s += " RENAME TABLE "; - break; - } - case 1137: { - s += " repeat "; - break; - } - case 1138: { - s += " replace "; - break; - } - case 1139: { - s += " REPLACE "; - break; - } - case 1140: { - s += " replaceAll "; - break; - } - case 1141: { - s += " replaceOne "; - break; - } - case 1142: { - s += " REPLACE PARTITION "; - break; - } - case 1143: { - s += " replaceRegexpAll "; - break; - } - case 1144: { - s += " replaceRegexpOne "; - break; - } - case 1145: { - s += " REPLICA "; - break; - } - case 1146: { - s += " replicate "; - break; - } - case 1147: { - s += " REPLICATED "; - break; - } - case 1148: { - s += " Resample "; - break; - } - case 1149: { - s += " RESUME "; - break; - } - case 1150: { - s += " retention "; - break; - } - case 1151: { - s += " reverse "; - break; - } - case 1152: { - s += " reverseUTF8 "; - break; - } - case 1153: { - s += " RIGHT "; - break; - } - case 1154: { - s += " rightPad "; - break; - } - case 1155: { - s += " rightPadUTF8 "; - break; - } - case 1156: { - s += " Ring "; - break; - } - case 1157: { - s += " ROLLUP "; - break; - } - case 1158: { - s += " round "; - break; - } - case 1159: { - s += " roundAge "; - break; - } - case 1160: { - s += " roundBankers "; - break; - } - case 1161: { - s += " roundDown "; - break; - } - case 1162: { - s += " roundDuration "; - break; - } - case 1163: { - s += " roundToExp2 "; - break; - } - case 1164: { - s += " row_number "; - break; - } - case 1165: { - s += " rowNumberInAllBlocks "; - break; - } - case 1166: { - s += " rowNumberInBlock "; - break; - } - case 1167: { - s += " rpad "; - break; - } - case 1168: { - s += " RTRIM "; - break; - } - case 1169: { - s += " runningAccumulate "; - break; - } - case 1170: { - s += " runningConcurrency "; - break; - } - case 1171: { - s += " runningDifference "; - break; - } - case 1172: { - s += " runningDifferenceStartingWithFirstValue "; - break; - } - case 1173: { - s += " S "; - break; - } - case 1174: { - s += " s2CapContains "; - break; - } - case 1175: { - s += " s2CapUnion "; - break; - } - case 1176: { - s += " s2CellsIntersect "; - break; - } - case 1177: { - s += " s2GetNeighbors "; - break; - } - case 1178: { - s += " s2RectAdd "; - break; - } - case 1179: { - s += " s2RectContains "; - break; - } - case 1180: { - s += " s2RectIntersection "; - break; - } - case 1181: { - s += " s2RectUnion "; - break; - } - case 1182: { - s += " s2ToGeo "; - break; - } - case 1183: { - s += " SAMPLE "; - break; - } - case 1184: { - s += " SAMPLE BY "; - break; - } - case 1185: { - s += " SECOND "; - break; - } - case 1186: { - s += " SELECT "; - break; - } - case 1187: { - s += " SEMI "; - break; - } - case 1188: { - s += " SENDS "; - break; - } - case 1189: { - s += " sequenceCount "; - break; - } - case 1190: { - s += " sequenceMatch "; - break; - } - case 1191: { - s += " sequenceNextNode "; - break; - } - case 1192: { - s += " serverUUID "; - break; - } - case 1193: { - s += " SET "; - break; - } - case 1194: { - s += " SETTINGS "; - break; - } - case 1195: { - s += " SHA1 "; - break; - } - case 1196: { - s += " SHA224 "; - break; - } - case 1197: { - s += " SHA256 "; - break; - } - case 1198: { - s += " SHA384 "; - break; - } - case 1199: { - s += " SHA512 "; - break; - } - case 1200: { - s += " shardCount "; - break; - } - case 1201: { - s += " shardNum "; - break; - } - case 1202: { - s += " SHOW "; - break; - } - case 1203: { - s += " SHOW PROCESSLIST "; - break; - } - case 1204: { - s += " sigmoid "; - break; - } - case 1205: { - s += " sign "; - break; - } - case 1206: { - s += " SimpleAggregateFunction "; - break; - } - case 1207: { - s += " simpleJSONExtractBool "; - break; - } - case 1208: { - s += " simpleJSONExtractFloat "; - break; - } - case 1209: { - s += " simpleJSONExtractInt "; - break; - } - case 1210: { - s += " simpleJSONExtractRaw "; - break; - } - case 1211: { - s += " simpleJSONExtractString "; - break; - } - case 1212: { - s += " simpleJSONExtractUInt "; - break; - } - case 1213: { - s += " simpleJSONHas "; - break; - } - case 1214: { - s += " simpleLinearRegression "; - break; - } - case 1215: { - s += " sin "; - break; - } - case 1216: { - s += " SINGLE "; - break; - } - case 1217: { - s += " singleValueOrNull "; - break; - } - case 1218: { - s += " sinh "; - break; - } - case 1219: { - s += " sipHash128 "; - break; - } - case 1220: { - s += " sipHash64 "; - break; - } - case 1221: { - s += " skewPop "; - break; - } - case 1222: { - s += " skewSamp "; - break; - } - case 1223: { - s += " sleep "; - break; - } - case 1224: { - s += " sleepEachRow "; - break; - } - case 1225: { - s += " SMALLINT "; - break; - } - case 1226: { - s += " SMALLINT SIGNED "; - break; - } - case 1227: { - s += " SMALLINT UNSIGNED "; - break; - } - case 1228: { - s += " snowflakeToDateTime "; - break; - } - case 1229: { - s += " snowflakeToDateTime64 "; - break; - } - case 1230: { - s += " SOURCE "; - break; - } - case 1231: { - s += " sparkbar "; - break; - } - case 1232: { - s += " splitByChar "; - break; - } - case 1233: { - s += " splitByNonAlpha "; - break; - } - case 1234: { - s += " splitByRegexp "; - break; - } - case 1235: { - s += " splitByString "; - break; - } - case 1236: { - s += " splitByWhitespace "; - break; - } - case 1237: { - s += " SQL_TSI_DAY "; - break; - } - case 1238: { - s += " SQL_TSI_HOUR "; - break; - } - case 1239: { - s += " SQL_TSI_MINUTE "; - break; - } - case 1240: { - s += " SQL_TSI_MONTH "; - break; - } - case 1241: { - s += " SQL_TSI_QUARTER "; - break; - } - case 1242: { - s += " SQL_TSI_SECOND "; - break; - } - case 1243: { - s += " SQL_TSI_WEEK "; - break; - } - case 1244: { - s += " SQL_TSI_YEAR "; - break; - } - case 1245: { - s += " sqrt "; - break; - } - case 1246: { - s += " SS "; - break; - } - case 1247: { - s += " START "; - break; - } - case 1248: { - s += " startsWith "; - break; - } - case 1249: { - s += " State "; - break; - } - case 1250: { - s += " stddevPop "; - break; - } - case 1251: { - s += " STDDEV_POP "; - break; - } - case 1252: { - s += " stddevPopStable "; - break; - } - case 1253: { - s += " stddevSamp "; - break; - } - case 1254: { - s += " STDDEV_SAMP "; - break; - } - case 1255: { - s += " stddevSampStable "; - break; - } - case 1256: { - s += " stem "; - break; - } - case 1257: { - s += " STEP "; - break; - } - case 1258: { - s += " stochasticLinearRegression "; - break; - } - case 1259: { - s += " stochasticLogisticRegression "; - break; - } - case 1260: { - s += " STOP "; - break; - } - case 1261: { - s += " String "; - break; - } - case 1262: { - s += " stringToH3 "; - break; - } - case 1263: { - s += " studentTTest "; - break; - } - case 1264: { - s += " subBitmap "; - break; - } - case 1265: { - s += " substr "; - break; - } - case 1266: { - s += " substring "; - break; - } - case 1267: { - s += " SUBSTRING "; - break; - } - case 1268: { - s += " substringUTF8 "; - break; - } - case 1269: { - s += " subtractDays "; - break; - } - case 1270: { - s += " subtractHours "; - break; - } - case 1271: { - s += " subtractMinutes "; - break; - } - case 1272: { - s += " subtractMonths "; - break; - } - case 1273: { - s += " subtractQuarters "; - break; - } - case 1274: { - s += " subtractSeconds "; - break; - } - case 1275: { - s += " subtractWeeks "; - break; - } - case 1276: { - s += " subtractYears "; - break; - } - case 1277: { - s += " sum "; - break; - } - case 1278: { - s += " sumCount "; - break; - } - case 1279: { - s += " sumKahan "; - break; - } - case 1280: { - s += " sumMap "; - break; - } - case 1281: { - s += " sumMapFiltered "; - break; - } - case 1282: { - s += " sumMapFilteredWithOverflow "; - break; - } - case 1283: { - s += " sumMapWithOverflow "; - break; - } - case 1284: { - s += " sumWithOverflow "; - break; - } - case 1285: { - s += " SUSPEND "; - break; - } - case 1286: { - s += " svg "; - break; - } - case 1287: { - s += " SVG "; - break; - } - case 1288: { - s += " SYNC "; - break; - } - case 1289: { - s += " synonyms "; - break; - } - case 1290: { - s += " SYNTAX "; - break; - } - case 1291: { - s += " SYSTEM "; - break; - } - case 1292: { - s += " TABLE "; - break; - } - case 1293: { - s += " TABLES "; - break; - } - case 1294: { - s += " tan "; - break; - } - case 1295: { - s += " tanh "; - break; - } - case 1296: { - s += " tcpPort "; - break; - } - case 1297: { - s += " TEMPORARY "; - break; - } - case 1298: { - s += " TEST "; - break; - } - case 1299: { - s += " TEXT "; - break; - } - case 1300: { - s += " tgamma "; - break; - } - case 1301: { - s += " THEN "; - break; - } - case 1302: { - s += " throwIf "; - break; - } - case 1303: { - s += " tid "; - break; - } - case 1304: { - s += " TIES "; - break; - } - case 1305: { - s += " TIMEOUT "; - break; - } - case 1306: { - s += " timeSlot "; - break; - } - case 1307: { - s += " timeSlots "; - break; - } - case 1308: { - s += " TIMESTAMP "; - break; - } - case 1309: { - s += " TIMESTAMP_ADD "; - break; - } - case 1310: { - s += " TIMESTAMPADD "; - break; - } - case 1311: { - s += " TIMESTAMP_DIFF "; - break; - } - case 1312: { - s += " TIMESTAMPDIFF "; - break; - } - case 1313: { - s += " TIMESTAMP_SUB "; - break; - } - case 1314: { - s += " TIMESTAMPSUB "; - break; - } - case 1315: { - s += " timezone "; - break; - } - case 1316: { - s += " timeZone "; - break; - } - case 1317: { - s += " timezoneOf "; - break; - } - case 1318: { - s += " timeZoneOf "; - break; - } - case 1319: { - s += " timezoneOffset "; - break; - } - case 1320: { - s += " timeZoneOffset "; - break; - } - case 1321: { - s += " TINYBLOB "; - break; - } - case 1322: { - s += " TINYINT "; - break; - } - case 1323: { - s += " TINYINT SIGNED "; - break; - } - case 1324: { - s += " TINYINT UNSIGNED "; - break; - } - case 1325: { - s += " TINYTEXT "; - break; - } - case 1326: { - s += " TO "; - break; - } - case 1327: { - s += " TO_BASE64 "; - break; - } - case 1328: { - s += " toColumnTypeName "; - break; - } - case 1329: { - s += " toDate "; - break; - } - case 1330: { - s += " toDate32 "; - break; - } - case 1331: { - s += " toDate32OrNull "; - break; - } - case 1332: { - s += " toDate32OrZero "; - break; - } - case 1333: { - s += " toDateOrNull "; - break; - } - case 1334: { - s += " toDateOrZero "; - break; - } - case 1335: { - s += " toDateTime "; - break; - } - case 1336: { - s += " toDateTime32 "; - break; - } - case 1337: { - s += " toDateTime64 "; - break; - } - case 1338: { - s += " toDateTime64OrNull "; - break; - } - case 1339: { - s += " toDateTime64OrZero "; - break; - } - case 1340: { - s += " toDateTimeOrNull "; - break; - } - case 1341: { - s += " toDateTimeOrZero "; - break; - } - case 1342: { - s += " today "; - break; - } - case 1343: { - s += " toDayOfMonth "; - break; - } - case 1344: { - s += " toDayOfWeek "; - break; - } - case 1345: { - s += " toDayOfYear "; - break; - } - case 1346: { - s += " toDecimal128 "; - break; - } - case 1347: { - s += " toDecimal128OrNull "; - break; - } - case 1348: { - s += " toDecimal128OrZero "; - break; - } - case 1349: { - s += " toDecimal256 "; - break; - } - case 1350: { - s += " toDecimal256OrNull "; - break; - } - case 1351: { - s += " toDecimal256OrZero "; - break; - } - case 1352: { - s += " toDecimal32 "; - break; - } - case 1353: { - s += " toDecimal32OrNull "; - break; - } - case 1354: { - s += " toDecimal32OrZero "; - break; - } - case 1355: { - s += " toDecimal64 "; - break; - } - case 1356: { - s += " toDecimal64OrNull "; - break; - } - case 1357: { - s += " toDecimal64OrZero "; - break; - } - case 1358: { - s += " TO DISK "; - break; - } - case 1359: { - s += " toFixedString "; - break; - } - case 1360: { - s += " toFloat32 "; - break; - } - case 1361: { - s += " toFloat32OrNull "; - break; - } - case 1362: { - s += " toFloat32OrZero "; - break; - } - case 1363: { - s += " toFloat64 "; - break; - } - case 1364: { - s += " toFloat64OrNull "; - break; - } - case 1365: { - s += " toFloat64OrZero "; - break; - } - case 1366: { - s += " toHour "; - break; - } - case 1367: { - s += " toInt128 "; - break; - } - case 1368: { - s += " toInt128OrNull "; - break; - } - case 1369: { - s += " toInt128OrZero "; - break; - } - case 1370: { - s += " toInt16 "; - break; - } - case 1371: { - s += " toInt16OrNull "; - break; - } - case 1372: { - s += " toInt16OrZero "; - break; - } - case 1373: { - s += " toInt256 "; - break; - } - case 1374: { - s += " toInt256OrNull "; - break; - } - case 1375: { - s += " toInt256OrZero "; - break; - } - case 1376: { - s += " toInt32 "; - break; - } - case 1377: { - s += " toInt32OrNull "; - break; - } - case 1378: { - s += " toInt32OrZero "; - break; - } - case 1379: { - s += " toInt64 "; - break; - } - case 1380: { - s += " toInt64OrNull "; - break; - } - case 1381: { - s += " toInt64OrZero "; - break; - } - case 1382: { - s += " toInt8 "; - break; - } - case 1383: { - s += " toInt8OrNull "; - break; - } - case 1384: { - s += " toInt8OrZero "; - break; - } - case 1385: { - s += " toIntervalDay "; - break; - } - case 1386: { - s += " toIntervalHour "; - break; - } - case 1387: { - s += " toIntervalMinute "; - break; - } - case 1388: { - s += " toIntervalMonth "; - break; - } - case 1389: { - s += " toIntervalQuarter "; - break; - } - case 1390: { - s += " toIntervalSecond "; - break; - } - case 1391: { - s += " toIntervalWeek "; - break; - } - case 1392: { - s += " toIntervalYear "; - break; - } - case 1393: { - s += " toIPv4 "; - break; - } - case 1394: { - s += " toIPv6 "; - break; - } - case 1395: { - s += " toISOWeek "; - break; - } - case 1396: { - s += " toISOYear "; - break; - } - case 1397: { - s += " toJSONString "; - break; - } - case 1398: { - s += " toLowCardinality "; - break; - } - case 1399: { - s += " toMinute "; - break; - } - case 1400: { - s += " toModifiedJulianDay "; - break; - } - case 1401: { - s += " toModifiedJulianDayOrNull "; - break; - } - case 1402: { - s += " toMonday "; - break; - } - case 1403: { - s += " toMonth "; - break; - } - case 1404: { - s += " toNullable "; - break; - } - case 1405: { - s += " TOP "; - break; - } - case 1406: { - s += " topK "; - break; - } - case 1407: { - s += " topKWeighted "; - break; - } - case 1408: { - s += " topLevelDomain "; - break; - } - case 1409: { - s += " toQuarter "; - break; - } - case 1410: { - s += " toRelativeDayNum "; - break; - } - case 1411: { - s += " toRelativeHourNum "; - break; - } - case 1412: { - s += " toRelativeMinuteNum "; - break; - } - case 1413: { - s += " toRelativeMonthNum "; - break; - } - case 1414: { - s += " toRelativeQuarterNum "; - break; - } - case 1415: { - s += " toRelativeSecondNum "; - break; - } - case 1416: { - s += " toRelativeWeekNum "; - break; - } - case 1417: { - s += " toRelativeYearNum "; - break; - } - case 1418: { - s += " toSecond "; - break; - } - case 1419: { - s += " toStartOfDay "; - break; - } - case 1420: { - s += " toStartOfFifteenMinutes "; - break; - } - case 1421: { - s += " toStartOfFiveMinutes "; - break; - } - case 1422: { - s += " toStartOfHour "; - break; - } - case 1423: { - s += " toStartOfInterval "; - break; - } - case 1424: { - s += " toStartOfISOYear "; - break; - } - case 1425: { - s += " toStartOfMinute "; - break; - } - case 1426: { - s += " toStartOfMonth "; - break; - } - case 1427: { - s += " toStartOfQuarter "; - break; - } - case 1428: { - s += " toStartOfSecond "; - break; - } - case 1429: { - s += " toStartOfTenMinutes "; - break; - } - case 1430: { - s += " toStartOfWeek "; - break; - } - case 1431: { - s += " toStartOfYear "; - break; - } - case 1432: { - s += " toString "; - break; - } - case 1433: { - s += " toStringCutToZero "; - break; - } - case 1434: { - s += " TO TABLE "; - break; - } - case 1435: { - s += " TOTALS "; - break; - } - case 1436: { - s += " toTime "; - break; - } - case 1437: { - s += " toTimezone "; - break; - } - case 1438: { - s += " toTimeZone "; - break; - } - case 1439: { - s += " toTypeName "; - break; - } - case 1440: { - s += " toUInt128 "; - break; - } - case 1441: { - s += " toUInt128OrNull "; - break; - } - case 1442: { - s += " toUInt128OrZero "; - break; - } - case 1443: { - s += " toUInt16 "; - break; - } - case 1444: { - s += " toUInt16OrNull "; - break; - } - case 1445: { - s += " toUInt16OrZero "; - break; - } - case 1446: { - s += " toUInt256 "; - break; - } - case 1447: { - s += " toUInt256OrNull "; - break; - } - case 1448: { - s += " toUInt256OrZero "; - break; - } - case 1449: { - s += " toUInt32 "; - break; - } - case 1450: { - s += " toUInt32OrNull "; - break; - } - case 1451: { - s += " toUInt32OrZero "; - break; - } - case 1452: { - s += " toUInt64 "; - break; - } - case 1453: { - s += " toUInt64OrNull "; - break; - } - case 1454: { - s += " toUInt64OrZero "; - break; - } - case 1455: { - s += " toUInt8 "; - break; - } - case 1456: { - s += " toUInt8OrNull "; - break; - } - case 1457: { - s += " toUInt8OrZero "; - break; - } - case 1458: { - s += " toUnixTimestamp "; - break; - } - case 1459: { - s += " toUnixTimestamp64Micro "; - break; - } - case 1460: { - s += " toUnixTimestamp64Milli "; - break; - } - case 1461: { - s += " toUnixTimestamp64Nano "; - break; - } - case 1462: { - s += " toUUID "; - break; - } - case 1463: { - s += " toUUIDOrNull "; - break; - } - case 1464: { - s += " toUUIDOrZero "; - break; - } - case 1465: { - s += " toValidUTF8 "; - break; - } - case 1466: { - s += " TO VOLUME "; - break; - } - case 1467: { - s += " toWeek "; - break; - } - case 1468: { - s += " toYear "; - break; - } - case 1469: { - s += " toYearWeek "; - break; - } - case 1470: { - s += " toYYYYMM "; - break; - } - case 1471: { - s += " toYYYYMMDD "; - break; - } - case 1472: { - s += " toYYYYMMDDhhmmss "; - break; - } - case 1473: { - s += " TRAILING "; - break; - } - case 1474: { - s += " transform "; - break; - } - case 1475: { - s += " TRIM "; - break; - } - case 1476: { - s += " trimBoth "; - break; - } - case 1477: { - s += " trimLeft "; - break; - } - case 1478: { - s += " trimRight "; - break; - } - case 1479: { - s += " trunc "; - break; - } - case 1480: { - s += " truncate "; - break; - } - case 1481: { - s += " TRUNCATE "; - break; - } - case 1482: { - s += " tryBase64Decode "; - break; - } - case 1483: { - s += " TTL "; - break; - } - case 1484: { - s += " tuple "; - break; - } - case 1485: { - s += " Tuple "; - break; - } - case 1486: { - s += " tupleElement "; - break; - } - case 1487: { - s += " tupleHammingDistance "; - break; - } - case 1488: { - s += " tupleToNameValuePairs "; - break; - } - case 1489: { - s += " TYPE "; - break; - } - case 1490: { - s += " ucase "; - break; - } - case 1491: { - s += " UInt128 "; - break; - } - case 1492: { - s += " UInt16 "; - break; - } - case 1493: { - s += " UInt256 "; - break; - } - case 1494: { - s += " UInt32 "; - break; - } - case 1495: { - s += " UInt64 "; - break; - } - case 1496: { - s += " UInt8 "; - break; - } - case 1497: { - s += " unbin "; - break; - } - case 1498: { - s += " unhex "; - break; - } - case 1499: { - s += " UNION "; - break; - } - case 1500: { - s += " uniq "; - break; - } - case 1501: { - s += " uniqCombined "; - break; - } - case 1502: { - s += " uniqCombined64 "; - break; - } - case 1503: { - s += " uniqExact "; - break; - } - case 1504: { - s += " uniqHLL12 "; - break; - } - case 1505: { - s += " uniqTheta "; - break; - } - case 1506: { - s += " uniqUpTo "; - break; - } - case 1507: { - s += " UPDATE "; - break; - } - case 1508: { - s += " upper "; - break; - } - case 1509: { - s += " upperUTF8 "; - break; - } - case 1510: { - s += " uptime "; - break; - } - case 1511: { - s += " URLHash "; - break; - } - case 1512: { - s += " URLHierarchy "; - break; - } - case 1513: { - s += " URLPathHierarchy "; - break; - } - case 1514: { - s += " USE "; - break; - } - case 1515: { - s += " user "; - break; - } - case 1516: { - s += " USING "; - break; - } - case 1517: { - s += " UUID "; - break; - } - case 1518: { - s += " UUIDNumToString "; - break; - } - case 1519: { - s += " UUIDStringToNum "; - break; - } - case 1520: { - s += " validateNestedArraySizes "; - break; - } - case 1521: { - s += " VALUES "; - break; - } - case 1522: { - s += " VARCHAR "; - break; - } - case 1523: { - s += " VARCHAR2 "; - break; - } - case 1524: { - s += " varPop "; - break; - } - case 1525: { - s += " VAR_POP "; - break; - } - case 1526: { - s += " varPopStable "; - break; - } - case 1527: { - s += " varSamp "; - break; - } - case 1528: { - s += " VAR_SAMP "; - break; - } - case 1529: { - s += " varSampStable "; - break; - } - case 1530: { - s += " version "; - break; - } - case 1531: { - s += " VIEW "; - break; - } - case 1532: { - s += " visibleWidth "; - break; - } - case 1533: { - s += " visitParamExtractBool "; - break; - } - case 1534: { - s += " visitParamExtractFloat "; - break; - } - case 1535: { - s += " visitParamExtractInt "; - break; - } - case 1536: { - s += " visitParamExtractRaw "; - break; - } - case 1537: { - s += " visitParamExtractString "; - break; - } - case 1538: { - s += " visitParamExtractUInt "; - break; - } - case 1539: { - s += " visitParamHas "; - break; - } - case 1540: { - s += " VOLUME "; - break; - } - case 1541: { - s += " WATCH "; - break; - } - case 1542: { - s += " week "; - break; - } - case 1543: { - s += " WEEK "; - break; - } - case 1544: { - s += " welchTTest "; - break; - } - case 1545: { - s += " WHEN "; - break; - } - case 1546: { - s += " WHERE "; - break; - } - case 1547: { - s += " windowFunnel "; - break; - } - case 1548: { - s += " WITH "; - break; - } - case 1549: { - s += " WITH FILL "; - break; - } - case 1550: { - s += " WITH TIES "; - break; - } - case 1551: { - s += " WK "; - break; - } - case 1552: { - s += " wkt "; - break; - } - case 1553: { - s += " wordShingleMinHash "; - break; - } - case 1554: { - s += " wordShingleMinHashArg "; - break; - } - case 1555: { - s += " wordShingleMinHashArgCaseInsensitive "; - break; - } - case 1556: { - s += " wordShingleMinHashArgCaseInsensitiveUTF8 "; - break; - } - case 1557: { - s += " wordShingleMinHashArgUTF8 "; - break; - } - case 1558: { - s += " wordShingleMinHashCaseInsensitive "; - break; - } - case 1559: { - s += " wordShingleMinHashCaseInsensitiveUTF8 "; - break; - } - case 1560: { - s += " wordShingleMinHashUTF8 "; - break; - } - case 1561: { - s += " wordShingleSimHash "; - break; - } - case 1562: { - s += " wordShingleSimHashCaseInsensitive "; - break; - } - case 1563: { - s += " wordShingleSimHashCaseInsensitiveUTF8 "; - break; - } - case 1564: { - s += " wordShingleSimHashUTF8 "; - break; - } - case 1565: { - s += " WW "; - break; - } - case 1566: { - s += " xor "; - break; - } - case 1567: { - s += " xxHash32 "; - break; - } - case 1568: { - s += " xxHash64 "; - break; - } - case 1569: { - s += " kostikConsistentHash "; - break; - } - case 1570: { - s += " YEAR "; - break; - } - case 1571: { - s += " yearweek "; - break; - } - case 1572: { - s += " yesterday "; - break; - } - case 1573: { - s += " YY "; - break; - } - case 1574: { - s += " YYYY "; - break; - } - case 1575: { - s += " zookeeperSessionUptime "; - break; - } - default: break; - } -} diff --git a/src/Parsers/fuzzers/codegen_fuzzer/out.proto b/src/Parsers/fuzzers/codegen_fuzzer/out.proto deleted file mode 100644 index 60992ca6a81..00000000000 --- a/src/Parsers/fuzzers/codegen_fuzzer/out.proto +++ /dev/null @@ -1,1587 +0,0 @@ -syntax = "proto3"; - -message Word { - enum Value { - value_0 = 0; - value_1 = 1; - value_2 = 2; - value_3 = 3; - value_4 = 4; - value_5 = 5; - value_6 = 6; - value_7 = 7; - value_8 = 8; - value_9 = 9; - value_10 = 10; - value_11 = 11; - value_12 = 12; - value_13 = 13; - value_14 = 14; - value_15 = 15; - value_16 = 16; - value_17 = 17; - value_18 = 18; - value_19 = 19; - value_20 = 20; - value_21 = 21; - value_22 = 22; - value_23 = 23; - value_24 = 24; - value_25 = 25; - value_26 = 26; - value_27 = 27; - value_28 = 28; - value_29 = 29; - value_30 = 30; - value_31 = 31; - value_32 = 32; - value_33 = 33; - value_34 = 34; - value_35 = 35; - value_36 = 36; - value_37 = 37; - value_38 = 38; - value_39 = 39; - value_40 = 40; - value_41 = 41; - value_42 = 42; - value_43 = 43; - value_44 = 44; - value_45 = 45; - value_46 = 46; - value_47 = 47; - value_48 = 48; - value_49 = 49; - value_50 = 50; - value_51 = 51; - value_52 = 52; - value_53 = 53; - value_54 = 54; - value_55 = 55; - value_56 = 56; - value_57 = 57; - value_58 = 58; - value_59 = 59; - value_60 = 60; - value_61 = 61; - value_62 = 62; - value_63 = 63; - value_64 = 64; - value_65 = 65; - value_66 = 66; - value_67 = 67; - value_68 = 68; - value_69 = 69; - value_70 = 70; - value_71 = 71; - value_72 = 72; - value_73 = 73; - value_74 = 74; - value_75 = 75; - value_76 = 76; - value_77 = 77; - value_78 = 78; - value_79 = 79; - value_80 = 80; - value_81 = 81; - value_82 = 82; - value_83 = 83; - value_84 = 84; - value_85 = 85; - value_86 = 86; - value_87 = 87; - value_88 = 88; - value_89 = 89; - value_90 = 90; - value_91 = 91; - value_92 = 92; - value_93 = 93; - value_94 = 94; - value_95 = 95; - value_96 = 96; - value_97 = 97; - value_98 = 98; - value_99 = 99; - value_100 = 100; - value_101 = 101; - value_102 = 102; - value_103 = 103; - value_104 = 104; - value_105 = 105; - value_106 = 106; - value_107 = 107; - value_108 = 108; - value_109 = 109; - value_110 = 110; - value_111 = 111; - value_112 = 112; - value_113 = 113; - value_114 = 114; - value_115 = 115; - value_116 = 116; - value_117 = 117; - value_118 = 118; - value_119 = 119; - value_120 = 120; - value_121 = 121; - value_122 = 122; - value_123 = 123; - value_124 = 124; - value_125 = 125; - value_126 = 126; - value_127 = 127; - value_128 = 128; - value_129 = 129; - value_130 = 130; - value_131 = 131; - value_132 = 132; - value_133 = 133; - value_134 = 134; - value_135 = 135; - value_136 = 136; - value_137 = 137; - value_138 = 138; - value_139 = 139; - value_140 = 140; - value_141 = 141; - value_142 = 142; - value_143 = 143; - value_144 = 144; - value_145 = 145; - value_146 = 146; - value_147 = 147; - value_148 = 148; - value_149 = 149; - value_150 = 150; - value_151 = 151; - value_152 = 152; - value_153 = 153; - value_154 = 154; - value_155 = 155; - value_156 = 156; - value_157 = 157; - value_158 = 158; - value_159 = 159; - value_160 = 160; - value_161 = 161; - value_162 = 162; - value_163 = 163; - value_164 = 164; - value_165 = 165; - value_166 = 166; - value_167 = 167; - value_168 = 168; - value_169 = 169; - value_170 = 170; - value_171 = 171; - value_172 = 172; - value_173 = 173; - value_174 = 174; - value_175 = 175; - value_176 = 176; - value_177 = 177; - value_178 = 178; - value_179 = 179; - value_180 = 180; - value_181 = 181; - value_182 = 182; - value_183 = 183; - value_184 = 184; - value_185 = 185; - value_186 = 186; - value_187 = 187; - value_188 = 188; - value_189 = 189; - value_190 = 190; - value_191 = 191; - value_192 = 192; - value_193 = 193; - value_194 = 194; - value_195 = 195; - value_196 = 196; - value_197 = 197; - value_198 = 198; - value_199 = 199; - value_200 = 200; - value_201 = 201; - value_202 = 202; - value_203 = 203; - value_204 = 204; - value_205 = 205; - value_206 = 206; - value_207 = 207; - value_208 = 208; - value_209 = 209; - value_210 = 210; - value_211 = 211; - value_212 = 212; - value_213 = 213; - value_214 = 214; - value_215 = 215; - value_216 = 216; - value_217 = 217; - value_218 = 218; - value_219 = 219; - value_220 = 220; - value_221 = 221; - value_222 = 222; - value_223 = 223; - value_224 = 224; - value_225 = 225; - value_226 = 226; - value_227 = 227; - value_228 = 228; - value_229 = 229; - value_230 = 230; - value_231 = 231; - value_232 = 232; - value_233 = 233; - value_234 = 234; - value_235 = 235; - value_236 = 236; - value_237 = 237; - value_238 = 238; - value_239 = 239; - value_240 = 240; - value_241 = 241; - value_242 = 242; - value_243 = 243; - value_244 = 244; - value_245 = 245; - value_246 = 246; - value_247 = 247; - value_248 = 248; - value_249 = 249; - value_250 = 250; - value_251 = 251; - value_252 = 252; - value_253 = 253; - value_254 = 254; - value_255 = 255; - value_256 = 256; - value_257 = 257; - value_258 = 258; - value_259 = 259; - value_260 = 260; - value_261 = 261; - value_262 = 262; - value_263 = 263; - value_264 = 264; - value_265 = 265; - value_266 = 266; - value_267 = 267; - value_268 = 268; - value_269 = 269; - value_270 = 270; - value_271 = 271; - value_272 = 272; - value_273 = 273; - value_274 = 274; - value_275 = 275; - value_276 = 276; - value_277 = 277; - value_278 = 278; - value_279 = 279; - value_280 = 280; - value_281 = 281; - value_282 = 282; - value_283 = 283; - value_284 = 284; - value_285 = 285; - value_286 = 286; - value_287 = 287; - value_288 = 288; - value_289 = 289; - value_290 = 290; - value_291 = 291; - value_292 = 292; - value_293 = 293; - value_294 = 294; - value_295 = 295; - value_296 = 296; - value_297 = 297; - value_298 = 298; - value_299 = 299; - value_300 = 300; - value_301 = 301; - value_302 = 302; - value_303 = 303; - value_304 = 304; - value_305 = 305; - value_306 = 306; - value_307 = 307; - value_308 = 308; - value_309 = 309; - value_310 = 310; - value_311 = 311; - value_312 = 312; - value_313 = 313; - value_314 = 314; - value_315 = 315; - value_316 = 316; - value_317 = 317; - value_318 = 318; - value_319 = 319; - value_320 = 320; - value_321 = 321; - value_322 = 322; - value_323 = 323; - value_324 = 324; - value_325 = 325; - value_326 = 326; - value_327 = 327; - value_328 = 328; - value_329 = 329; - value_330 = 330; - value_331 = 331; - value_332 = 332; - value_333 = 333; - value_334 = 334; - value_335 = 335; - value_336 = 336; - value_337 = 337; - value_338 = 338; - value_339 = 339; - value_340 = 340; - value_341 = 341; - value_342 = 342; - value_343 = 343; - value_344 = 344; - value_345 = 345; - value_346 = 346; - value_347 = 347; - value_348 = 348; - value_349 = 349; - value_350 = 350; - value_351 = 351; - value_352 = 352; - value_353 = 353; - value_354 = 354; - value_355 = 355; - value_356 = 356; - value_357 = 357; - value_358 = 358; - value_359 = 359; - value_360 = 360; - value_361 = 361; - value_362 = 362; - value_363 = 363; - value_364 = 364; - value_365 = 365; - value_366 = 366; - value_367 = 367; - value_368 = 368; - value_369 = 369; - value_370 = 370; - value_371 = 371; - value_372 = 372; - value_373 = 373; - value_374 = 374; - value_375 = 375; - value_376 = 376; - value_377 = 377; - value_378 = 378; - value_379 = 379; - value_380 = 380; - value_381 = 381; - value_382 = 382; - value_383 = 383; - value_384 = 384; - value_385 = 385; - value_386 = 386; - value_387 = 387; - value_388 = 388; - value_389 = 389; - value_390 = 390; - value_391 = 391; - value_392 = 392; - value_393 = 393; - value_394 = 394; - value_395 = 395; - value_396 = 396; - value_397 = 397; - value_398 = 398; - value_399 = 399; - value_400 = 400; - value_401 = 401; - value_402 = 402; - value_403 = 403; - value_404 = 404; - value_405 = 405; - value_406 = 406; - value_407 = 407; - value_408 = 408; - value_409 = 409; - value_410 = 410; - value_411 = 411; - value_412 = 412; - value_413 = 413; - value_414 = 414; - value_415 = 415; - value_416 = 416; - value_417 = 417; - value_418 = 418; - value_419 = 419; - value_420 = 420; - value_421 = 421; - value_422 = 422; - value_423 = 423; - value_424 = 424; - value_425 = 425; - value_426 = 426; - value_427 = 427; - value_428 = 428; - value_429 = 429; - value_430 = 430; - value_431 = 431; - value_432 = 432; - value_433 = 433; - value_434 = 434; - value_435 = 435; - value_436 = 436; - value_437 = 437; - value_438 = 438; - value_439 = 439; - value_440 = 440; - value_441 = 441; - value_442 = 442; - value_443 = 443; - value_444 = 444; - value_445 = 445; - value_446 = 446; - value_447 = 447; - value_448 = 448; - value_449 = 449; - value_450 = 450; - value_451 = 451; - value_452 = 452; - value_453 = 453; - value_454 = 454; - value_455 = 455; - value_456 = 456; - value_457 = 457; - value_458 = 458; - value_459 = 459; - value_460 = 460; - value_461 = 461; - value_462 = 462; - value_463 = 463; - value_464 = 464; - value_465 = 465; - value_466 = 466; - value_467 = 467; - value_468 = 468; - value_469 = 469; - value_470 = 470; - value_471 = 471; - value_472 = 472; - value_473 = 473; - value_474 = 474; - value_475 = 475; - value_476 = 476; - value_477 = 477; - value_478 = 478; - value_479 = 479; - value_480 = 480; - value_481 = 481; - value_482 = 482; - value_483 = 483; - value_484 = 484; - value_485 = 485; - value_486 = 486; - value_487 = 487; - value_488 = 488; - value_489 = 489; - value_490 = 490; - value_491 = 491; - value_492 = 492; - value_493 = 493; - value_494 = 494; - value_495 = 495; - value_496 = 496; - value_497 = 497; - value_498 = 498; - value_499 = 499; - value_500 = 500; - value_501 = 501; - value_502 = 502; - value_503 = 503; - value_504 = 504; - value_505 = 505; - value_506 = 506; - value_507 = 507; - value_508 = 508; - value_509 = 509; - value_510 = 510; - value_511 = 511; - value_512 = 512; - value_513 = 513; - value_514 = 514; - value_515 = 515; - value_516 = 516; - value_517 = 517; - value_518 = 518; - value_519 = 519; - value_520 = 520; - value_521 = 521; - value_522 = 522; - value_523 = 523; - value_524 = 524; - value_525 = 525; - value_526 = 526; - value_527 = 527; - value_528 = 528; - value_529 = 529; - value_530 = 530; - value_531 = 531; - value_532 = 532; - value_533 = 533; - value_534 = 534; - value_535 = 535; - value_536 = 536; - value_537 = 537; - value_538 = 538; - value_539 = 539; - value_540 = 540; - value_541 = 541; - value_542 = 542; - value_543 = 543; - value_544 = 544; - value_545 = 545; - value_546 = 546; - value_547 = 547; - value_548 = 548; - value_549 = 549; - value_550 = 550; - value_551 = 551; - value_552 = 552; - value_553 = 553; - value_554 = 554; - value_555 = 555; - value_556 = 556; - value_557 = 557; - value_558 = 558; - value_559 = 559; - value_560 = 560; - value_561 = 561; - value_562 = 562; - value_563 = 563; - value_564 = 564; - value_565 = 565; - value_566 = 566; - value_567 = 567; - value_568 = 568; - value_569 = 569; - value_570 = 570; - value_571 = 571; - value_572 = 572; - value_573 = 573; - value_574 = 574; - value_575 = 575; - value_576 = 576; - value_577 = 577; - value_578 = 578; - value_579 = 579; - value_580 = 580; - value_581 = 581; - value_582 = 582; - value_583 = 583; - value_584 = 584; - value_585 = 585; - value_586 = 586; - value_587 = 587; - value_588 = 588; - value_589 = 589; - value_590 = 590; - value_591 = 591; - value_592 = 592; - value_593 = 593; - value_594 = 594; - value_595 = 595; - value_596 = 596; - value_597 = 597; - value_598 = 598; - value_599 = 599; - value_600 = 600; - value_601 = 601; - value_602 = 602; - value_603 = 603; - value_604 = 604; - value_605 = 605; - value_606 = 606; - value_607 = 607; - value_608 = 608; - value_609 = 609; - value_610 = 610; - value_611 = 611; - value_612 = 612; - value_613 = 613; - value_614 = 614; - value_615 = 615; - value_616 = 616; - value_617 = 617; - value_618 = 618; - value_619 = 619; - value_620 = 620; - value_621 = 621; - value_622 = 622; - value_623 = 623; - value_624 = 624; - value_625 = 625; - value_626 = 626; - value_627 = 627; - value_628 = 628; - value_629 = 629; - value_630 = 630; - value_631 = 631; - value_632 = 632; - value_633 = 633; - value_634 = 634; - value_635 = 635; - value_636 = 636; - value_637 = 637; - value_638 = 638; - value_639 = 639; - value_640 = 640; - value_641 = 641; - value_642 = 642; - value_643 = 643; - value_644 = 644; - value_645 = 645; - value_646 = 646; - value_647 = 647; - value_648 = 648; - value_649 = 649; - value_650 = 650; - value_651 = 651; - value_652 = 652; - value_653 = 653; - value_654 = 654; - value_655 = 655; - value_656 = 656; - value_657 = 657; - value_658 = 658; - value_659 = 659; - value_660 = 660; - value_661 = 661; - value_662 = 662; - value_663 = 663; - value_664 = 664; - value_665 = 665; - value_666 = 666; - value_667 = 667; - value_668 = 668; - value_669 = 669; - value_670 = 670; - value_671 = 671; - value_672 = 672; - value_673 = 673; - value_674 = 674; - value_675 = 675; - value_676 = 676; - value_677 = 677; - value_678 = 678; - value_679 = 679; - value_680 = 680; - value_681 = 681; - value_682 = 682; - value_683 = 683; - value_684 = 684; - value_685 = 685; - value_686 = 686; - value_687 = 687; - value_688 = 688; - value_689 = 689; - value_690 = 690; - value_691 = 691; - value_692 = 692; - value_693 = 693; - value_694 = 694; - value_695 = 695; - value_696 = 696; - value_697 = 697; - value_698 = 698; - value_699 = 699; - value_700 = 700; - value_701 = 701; - value_702 = 702; - value_703 = 703; - value_704 = 704; - value_705 = 705; - value_706 = 706; - value_707 = 707; - value_708 = 708; - value_709 = 709; - value_710 = 710; - value_711 = 711; - value_712 = 712; - value_713 = 713; - value_714 = 714; - value_715 = 715; - value_716 = 716; - value_717 = 717; - value_718 = 718; - value_719 = 719; - value_720 = 720; - value_721 = 721; - value_722 = 722; - value_723 = 723; - value_724 = 724; - value_725 = 725; - value_726 = 726; - value_727 = 727; - value_728 = 728; - value_729 = 729; - value_730 = 730; - value_731 = 731; - value_732 = 732; - value_733 = 733; - value_734 = 734; - value_735 = 735; - value_736 = 736; - value_737 = 737; - value_738 = 738; - value_739 = 739; - value_740 = 740; - value_741 = 741; - value_742 = 742; - value_743 = 743; - value_744 = 744; - value_745 = 745; - value_746 = 746; - value_747 = 747; - value_748 = 748; - value_749 = 749; - value_750 = 750; - value_751 = 751; - value_752 = 752; - value_753 = 753; - value_754 = 754; - value_755 = 755; - value_756 = 756; - value_757 = 757; - value_758 = 758; - value_759 = 759; - value_760 = 760; - value_761 = 761; - value_762 = 762; - value_763 = 763; - value_764 = 764; - value_765 = 765; - value_766 = 766; - value_767 = 767; - value_768 = 768; - value_769 = 769; - value_770 = 770; - value_771 = 771; - value_772 = 772; - value_773 = 773; - value_774 = 774; - value_775 = 775; - value_776 = 776; - value_777 = 777; - value_778 = 778; - value_779 = 779; - value_780 = 780; - value_781 = 781; - value_782 = 782; - value_783 = 783; - value_784 = 784; - value_785 = 785; - value_786 = 786; - value_787 = 787; - value_788 = 788; - value_789 = 789; - value_790 = 790; - value_791 = 791; - value_792 = 792; - value_793 = 793; - value_794 = 794; - value_795 = 795; - value_796 = 796; - value_797 = 797; - value_798 = 798; - value_799 = 799; - value_800 = 800; - value_801 = 801; - value_802 = 802; - value_803 = 803; - value_804 = 804; - value_805 = 805; - value_806 = 806; - value_807 = 807; - value_808 = 808; - value_809 = 809; - value_810 = 810; - value_811 = 811; - value_812 = 812; - value_813 = 813; - value_814 = 814; - value_815 = 815; - value_816 = 816; - value_817 = 817; - value_818 = 818; - value_819 = 819; - value_820 = 820; - value_821 = 821; - value_822 = 822; - value_823 = 823; - value_824 = 824; - value_825 = 825; - value_826 = 826; - value_827 = 827; - value_828 = 828; - value_829 = 829; - value_830 = 830; - value_831 = 831; - value_832 = 832; - value_833 = 833; - value_834 = 834; - value_835 = 835; - value_836 = 836; - value_837 = 837; - value_838 = 838; - value_839 = 839; - value_840 = 840; - value_841 = 841; - value_842 = 842; - value_843 = 843; - value_844 = 844; - value_845 = 845; - value_846 = 846; - value_847 = 847; - value_848 = 848; - value_849 = 849; - value_850 = 850; - value_851 = 851; - value_852 = 852; - value_853 = 853; - value_854 = 854; - value_855 = 855; - value_856 = 856; - value_857 = 857; - value_858 = 858; - value_859 = 859; - value_860 = 860; - value_861 = 861; - value_862 = 862; - value_863 = 863; - value_864 = 864; - value_865 = 865; - value_866 = 866; - value_867 = 867; - value_868 = 868; - value_869 = 869; - value_870 = 870; - value_871 = 871; - value_872 = 872; - value_873 = 873; - value_874 = 874; - value_875 = 875; - value_876 = 876; - value_877 = 877; - value_878 = 878; - value_879 = 879; - value_880 = 880; - value_881 = 881; - value_882 = 882; - value_883 = 883; - value_884 = 884; - value_885 = 885; - value_886 = 886; - value_887 = 887; - value_888 = 888; - value_889 = 889; - value_890 = 890; - value_891 = 891; - value_892 = 892; - value_893 = 893; - value_894 = 894; - value_895 = 895; - value_896 = 896; - value_897 = 897; - value_898 = 898; - value_899 = 899; - value_900 = 900; - value_901 = 901; - value_902 = 902; - value_903 = 903; - value_904 = 904; - value_905 = 905; - value_906 = 906; - value_907 = 907; - value_908 = 908; - value_909 = 909; - value_910 = 910; - value_911 = 911; - value_912 = 912; - value_913 = 913; - value_914 = 914; - value_915 = 915; - value_916 = 916; - value_917 = 917; - value_918 = 918; - value_919 = 919; - value_920 = 920; - value_921 = 921; - value_922 = 922; - value_923 = 923; - value_924 = 924; - value_925 = 925; - value_926 = 926; - value_927 = 927; - value_928 = 928; - value_929 = 929; - value_930 = 930; - value_931 = 931; - value_932 = 932; - value_933 = 933; - value_934 = 934; - value_935 = 935; - value_936 = 936; - value_937 = 937; - value_938 = 938; - value_939 = 939; - value_940 = 940; - value_941 = 941; - value_942 = 942; - value_943 = 943; - value_944 = 944; - value_945 = 945; - value_946 = 946; - value_947 = 947; - value_948 = 948; - value_949 = 949; - value_950 = 950; - value_951 = 951; - value_952 = 952; - value_953 = 953; - value_954 = 954; - value_955 = 955; - value_956 = 956; - value_957 = 957; - value_958 = 958; - value_959 = 959; - value_960 = 960; - value_961 = 961; - value_962 = 962; - value_963 = 963; - value_964 = 964; - value_965 = 965; - value_966 = 966; - value_967 = 967; - value_968 = 968; - value_969 = 969; - value_970 = 970; - value_971 = 971; - value_972 = 972; - value_973 = 973; - value_974 = 974; - value_975 = 975; - value_976 = 976; - value_977 = 977; - value_978 = 978; - value_979 = 979; - value_980 = 980; - value_981 = 981; - value_982 = 982; - value_983 = 983; - value_984 = 984; - value_985 = 985; - value_986 = 986; - value_987 = 987; - value_988 = 988; - value_989 = 989; - value_990 = 990; - value_991 = 991; - value_992 = 992; - value_993 = 993; - value_994 = 994; - value_995 = 995; - value_996 = 996; - value_997 = 997; - value_998 = 998; - value_999 = 999; - value_1000 = 1000; - value_1001 = 1001; - value_1002 = 1002; - value_1003 = 1003; - value_1004 = 1004; - value_1005 = 1005; - value_1006 = 1006; - value_1007 = 1007; - value_1008 = 1008; - value_1009 = 1009; - value_1010 = 1010; - value_1011 = 1011; - value_1012 = 1012; - value_1013 = 1013; - value_1014 = 1014; - value_1015 = 1015; - value_1016 = 1016; - value_1017 = 1017; - value_1018 = 1018; - value_1019 = 1019; - value_1020 = 1020; - value_1021 = 1021; - value_1022 = 1022; - value_1023 = 1023; - value_1024 = 1024; - value_1025 = 1025; - value_1026 = 1026; - value_1027 = 1027; - value_1028 = 1028; - value_1029 = 1029; - value_1030 = 1030; - value_1031 = 1031; - value_1032 = 1032; - value_1033 = 1033; - value_1034 = 1034; - value_1035 = 1035; - value_1036 = 1036; - value_1037 = 1037; - value_1038 = 1038; - value_1039 = 1039; - value_1040 = 1040; - value_1041 = 1041; - value_1042 = 1042; - value_1043 = 1043; - value_1044 = 1044; - value_1045 = 1045; - value_1046 = 1046; - value_1047 = 1047; - value_1048 = 1048; - value_1049 = 1049; - value_1050 = 1050; - value_1051 = 1051; - value_1052 = 1052; - value_1053 = 1053; - value_1054 = 1054; - value_1055 = 1055; - value_1056 = 1056; - value_1057 = 1057; - value_1058 = 1058; - value_1059 = 1059; - value_1060 = 1060; - value_1061 = 1061; - value_1062 = 1062; - value_1063 = 1063; - value_1064 = 1064; - value_1065 = 1065; - value_1066 = 1066; - value_1067 = 1067; - value_1068 = 1068; - value_1069 = 1069; - value_1070 = 1070; - value_1071 = 1071; - value_1072 = 1072; - value_1073 = 1073; - value_1074 = 1074; - value_1075 = 1075; - value_1076 = 1076; - value_1077 = 1077; - value_1078 = 1078; - value_1079 = 1079; - value_1080 = 1080; - value_1081 = 1081; - value_1082 = 1082; - value_1083 = 1083; - value_1084 = 1084; - value_1085 = 1085; - value_1086 = 1086; - value_1087 = 1087; - value_1088 = 1088; - value_1089 = 1089; - value_1090 = 1090; - value_1091 = 1091; - value_1092 = 1092; - value_1093 = 1093; - value_1094 = 1094; - value_1095 = 1095; - value_1096 = 1096; - value_1097 = 1097; - value_1098 = 1098; - value_1099 = 1099; - value_1100 = 1100; - value_1101 = 1101; - value_1102 = 1102; - value_1103 = 1103; - value_1104 = 1104; - value_1105 = 1105; - value_1106 = 1106; - value_1107 = 1107; - value_1108 = 1108; - value_1109 = 1109; - value_1110 = 1110; - value_1111 = 1111; - value_1112 = 1112; - value_1113 = 1113; - value_1114 = 1114; - value_1115 = 1115; - value_1116 = 1116; - value_1117 = 1117; - value_1118 = 1118; - value_1119 = 1119; - value_1120 = 1120; - value_1121 = 1121; - value_1122 = 1122; - value_1123 = 1123; - value_1124 = 1124; - value_1125 = 1125; - value_1126 = 1126; - value_1127 = 1127; - value_1128 = 1128; - value_1129 = 1129; - value_1130 = 1130; - value_1131 = 1131; - value_1132 = 1132; - value_1133 = 1133; - value_1134 = 1134; - value_1135 = 1135; - value_1136 = 1136; - value_1137 = 1137; - value_1138 = 1138; - value_1139 = 1139; - value_1140 = 1140; - value_1141 = 1141; - value_1142 = 1142; - value_1143 = 1143; - value_1144 = 1144; - value_1145 = 1145; - value_1146 = 1146; - value_1147 = 1147; - value_1148 = 1148; - value_1149 = 1149; - value_1150 = 1150; - value_1151 = 1151; - value_1152 = 1152; - value_1153 = 1153; - value_1154 = 1154; - value_1155 = 1155; - value_1156 = 1156; - value_1157 = 1157; - value_1158 = 1158; - value_1159 = 1159; - value_1160 = 1160; - value_1161 = 1161; - value_1162 = 1162; - value_1163 = 1163; - value_1164 = 1164; - value_1165 = 1165; - value_1166 = 1166; - value_1167 = 1167; - value_1168 = 1168; - value_1169 = 1169; - value_1170 = 1170; - value_1171 = 1171; - value_1172 = 1172; - value_1173 = 1173; - value_1174 = 1174; - value_1175 = 1175; - value_1176 = 1176; - value_1177 = 1177; - value_1178 = 1178; - value_1179 = 1179; - value_1180 = 1180; - value_1181 = 1181; - value_1182 = 1182; - value_1183 = 1183; - value_1184 = 1184; - value_1185 = 1185; - value_1186 = 1186; - value_1187 = 1187; - value_1188 = 1188; - value_1189 = 1189; - value_1190 = 1190; - value_1191 = 1191; - value_1192 = 1192; - value_1193 = 1193; - value_1194 = 1194; - value_1195 = 1195; - value_1196 = 1196; - value_1197 = 1197; - value_1198 = 1198; - value_1199 = 1199; - value_1200 = 1200; - value_1201 = 1201; - value_1202 = 1202; - value_1203 = 1203; - value_1204 = 1204; - value_1205 = 1205; - value_1206 = 1206; - value_1207 = 1207; - value_1208 = 1208; - value_1209 = 1209; - value_1210 = 1210; - value_1211 = 1211; - value_1212 = 1212; - value_1213 = 1213; - value_1214 = 1214; - value_1215 = 1215; - value_1216 = 1216; - value_1217 = 1217; - value_1218 = 1218; - value_1219 = 1219; - value_1220 = 1220; - value_1221 = 1221; - value_1222 = 1222; - value_1223 = 1223; - value_1224 = 1224; - value_1225 = 1225; - value_1226 = 1226; - value_1227 = 1227; - value_1228 = 1228; - value_1229 = 1229; - value_1230 = 1230; - value_1231 = 1231; - value_1232 = 1232; - value_1233 = 1233; - value_1234 = 1234; - value_1235 = 1235; - value_1236 = 1236; - value_1237 = 1237; - value_1238 = 1238; - value_1239 = 1239; - value_1240 = 1240; - value_1241 = 1241; - value_1242 = 1242; - value_1243 = 1243; - value_1244 = 1244; - value_1245 = 1245; - value_1246 = 1246; - value_1247 = 1247; - value_1248 = 1248; - value_1249 = 1249; - value_1250 = 1250; - value_1251 = 1251; - value_1252 = 1252; - value_1253 = 1253; - value_1254 = 1254; - value_1255 = 1255; - value_1256 = 1256; - value_1257 = 1257; - value_1258 = 1258; - value_1259 = 1259; - value_1260 = 1260; - value_1261 = 1261; - value_1262 = 1262; - value_1263 = 1263; - value_1264 = 1264; - value_1265 = 1265; - value_1266 = 1266; - value_1267 = 1267; - value_1268 = 1268; - value_1269 = 1269; - value_1270 = 1270; - value_1271 = 1271; - value_1272 = 1272; - value_1273 = 1273; - value_1274 = 1274; - value_1275 = 1275; - value_1276 = 1276; - value_1277 = 1277; - value_1278 = 1278; - value_1279 = 1279; - value_1280 = 1280; - value_1281 = 1281; - value_1282 = 1282; - value_1283 = 1283; - value_1284 = 1284; - value_1285 = 1285; - value_1286 = 1286; - value_1287 = 1287; - value_1288 = 1288; - value_1289 = 1289; - value_1290 = 1290; - value_1291 = 1291; - value_1292 = 1292; - value_1293 = 1293; - value_1294 = 1294; - value_1295 = 1295; - value_1296 = 1296; - value_1297 = 1297; - value_1298 = 1298; - value_1299 = 1299; - value_1300 = 1300; - value_1301 = 1301; - value_1302 = 1302; - value_1303 = 1303; - value_1304 = 1304; - value_1305 = 1305; - value_1306 = 1306; - value_1307 = 1307; - value_1308 = 1308; - value_1309 = 1309; - value_1310 = 1310; - value_1311 = 1311; - value_1312 = 1312; - value_1313 = 1313; - value_1314 = 1314; - value_1315 = 1315; - value_1316 = 1316; - value_1317 = 1317; - value_1318 = 1318; - value_1319 = 1319; - value_1320 = 1320; - value_1321 = 1321; - value_1322 = 1322; - value_1323 = 1323; - value_1324 = 1324; - value_1325 = 1325; - value_1326 = 1326; - value_1327 = 1327; - value_1328 = 1328; - value_1329 = 1329; - value_1330 = 1330; - value_1331 = 1331; - value_1332 = 1332; - value_1333 = 1333; - value_1334 = 1334; - value_1335 = 1335; - value_1336 = 1336; - value_1337 = 1337; - value_1338 = 1338; - value_1339 = 1339; - value_1340 = 1340; - value_1341 = 1341; - value_1342 = 1342; - value_1343 = 1343; - value_1344 = 1344; - value_1345 = 1345; - value_1346 = 1346; - value_1347 = 1347; - value_1348 = 1348; - value_1349 = 1349; - value_1350 = 1350; - value_1351 = 1351; - value_1352 = 1352; - value_1353 = 1353; - value_1354 = 1354; - value_1355 = 1355; - value_1356 = 1356; - value_1357 = 1357; - value_1358 = 1358; - value_1359 = 1359; - value_1360 = 1360; - value_1361 = 1361; - value_1362 = 1362; - value_1363 = 1363; - value_1364 = 1364; - value_1365 = 1365; - value_1366 = 1366; - value_1367 = 1367; - value_1368 = 1368; - value_1369 = 1369; - value_1370 = 1370; - value_1371 = 1371; - value_1372 = 1372; - value_1373 = 1373; - value_1374 = 1374; - value_1375 = 1375; - value_1376 = 1376; - value_1377 = 1377; - value_1378 = 1378; - value_1379 = 1379; - value_1380 = 1380; - value_1381 = 1381; - value_1382 = 1382; - value_1383 = 1383; - value_1384 = 1384; - value_1385 = 1385; - value_1386 = 1386; - value_1387 = 1387; - value_1388 = 1388; - value_1389 = 1389; - value_1390 = 1390; - value_1391 = 1391; - value_1392 = 1392; - value_1393 = 1393; - value_1394 = 1394; - value_1395 = 1395; - value_1396 = 1396; - value_1397 = 1397; - value_1398 = 1398; - value_1399 = 1399; - value_1400 = 1400; - value_1401 = 1401; - value_1402 = 1402; - value_1403 = 1403; - value_1404 = 1404; - value_1405 = 1405; - value_1406 = 1406; - value_1407 = 1407; - value_1408 = 1408; - value_1409 = 1409; - value_1410 = 1410; - value_1411 = 1411; - value_1412 = 1412; - value_1413 = 1413; - value_1414 = 1414; - value_1415 = 1415; - value_1416 = 1416; - value_1417 = 1417; - value_1418 = 1418; - value_1419 = 1419; - value_1420 = 1420; - value_1421 = 1421; - value_1422 = 1422; - value_1423 = 1423; - value_1424 = 1424; - value_1425 = 1425; - value_1426 = 1426; - value_1427 = 1427; - value_1428 = 1428; - value_1429 = 1429; - value_1430 = 1430; - value_1431 = 1431; - value_1432 = 1432; - value_1433 = 1433; - value_1434 = 1434; - value_1435 = 1435; - value_1436 = 1436; - value_1437 = 1437; - value_1438 = 1438; - value_1439 = 1439; - value_1440 = 1440; - value_1441 = 1441; - value_1442 = 1442; - value_1443 = 1443; - value_1444 = 1444; - value_1445 = 1445; - value_1446 = 1446; - value_1447 = 1447; - value_1448 = 1448; - value_1449 = 1449; - value_1450 = 1450; - value_1451 = 1451; - value_1452 = 1452; - value_1453 = 1453; - value_1454 = 1454; - value_1455 = 1455; - value_1456 = 1456; - value_1457 = 1457; - value_1458 = 1458; - value_1459 = 1459; - value_1460 = 1460; - value_1461 = 1461; - value_1462 = 1462; - value_1463 = 1463; - value_1464 = 1464; - value_1465 = 1465; - value_1466 = 1466; - value_1467 = 1467; - value_1468 = 1468; - value_1469 = 1469; - value_1470 = 1470; - value_1471 = 1471; - value_1472 = 1472; - value_1473 = 1473; - value_1474 = 1474; - value_1475 = 1475; - value_1476 = 1476; - value_1477 = 1477; - value_1478 = 1478; - value_1479 = 1479; - value_1480 = 1480; - value_1481 = 1481; - value_1482 = 1482; - value_1483 = 1483; - value_1484 = 1484; - value_1485 = 1485; - value_1486 = 1486; - value_1487 = 1487; - value_1488 = 1488; - value_1489 = 1489; - value_1490 = 1490; - value_1491 = 1491; - value_1492 = 1492; - value_1493 = 1493; - value_1494 = 1494; - value_1495 = 1495; - value_1496 = 1496; - value_1497 = 1497; - value_1498 = 1498; - value_1499 = 1499; - value_1500 = 1500; - value_1501 = 1501; - value_1502 = 1502; - value_1503 = 1503; - value_1504 = 1504; - value_1505 = 1505; - value_1506 = 1506; - value_1507 = 1507; - value_1508 = 1508; - value_1509 = 1509; - value_1510 = 1510; - value_1511 = 1511; - value_1512 = 1512; - value_1513 = 1513; - value_1514 = 1514; - value_1515 = 1515; - value_1516 = 1516; - value_1517 = 1517; - value_1518 = 1518; - value_1519 = 1519; - value_1520 = 1520; - value_1521 = 1521; - value_1522 = 1522; - value_1523 = 1523; - value_1524 = 1524; - value_1525 = 1525; - value_1526 = 1526; - value_1527 = 1527; - value_1528 = 1528; - value_1529 = 1529; - value_1530 = 1530; - value_1531 = 1531; - value_1532 = 1532; - value_1533 = 1533; - value_1534 = 1534; - value_1535 = 1535; - value_1536 = 1536; - value_1537 = 1537; - value_1538 = 1538; - value_1539 = 1539; - value_1540 = 1540; - value_1541 = 1541; - value_1542 = 1542; - value_1543 = 1543; - value_1544 = 1544; - value_1545 = 1545; - value_1546 = 1546; - value_1547 = 1547; - value_1548 = 1548; - value_1549 = 1549; - value_1550 = 1550; - value_1551 = 1551; - value_1552 = 1552; - value_1553 = 1553; - value_1554 = 1554; - value_1555 = 1555; - value_1556 = 1556; - value_1557 = 1557; - value_1558 = 1558; - value_1559 = 1559; - value_1560 = 1560; - value_1561 = 1561; - value_1562 = 1562; - value_1563 = 1563; - value_1564 = 1564; - value_1565 = 1565; - value_1566 = 1566; - value_1567 = 1567; - value_1568 = 1568; - value_1569 = 1569; - value_1570 = 1570; - value_1571 = 1571; - value_1572 = 1572; - value_1573 = 1573; - value_1574 = 1574; - value_1575 = 1575; - } - Value value = 1; - Sentence inner = 2; -} -message Sentence { - repeated Word words = 1; -} From 6c68269458a7d01a6fef4c6757e1e4c9419fec08 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 4 Jul 2023 00:25:51 +0200 Subject: [PATCH 34/63] Update Field.h --- src/Core/Field.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Field.h b/src/Core/Field.h index 97a32ab5bb1..686bfafc397 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -739,7 +739,7 @@ private: using StorageType = NearestFieldType; /// Incrementing the depth since we create a new Field. - auto depth = calculateAndCheckFieldDepth(x) + 1; + auto depth = calculateAndCheckFieldDepth(x); new (&storage) StorageType(std::forward(x)); if constexpr (std::is_same_v From 9d11678f8486c81bc38638c7144e705ad46af304 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 4 Jul 2023 00:54:50 +0200 Subject: [PATCH 35/63] Polishing --- src/Core/Field.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Core/Field.h b/src/Core/Field.h index 686bfafc397..cc0083e02d8 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -48,7 +48,7 @@ using FieldVector = std::vector>; struct X : public FieldVector \ { \ using FieldVector::FieldVector; \ - size_t nested_field_depth = 0; \ + uint8_t nested_field_depth = 0; \ } DEFINE_FIELD_VECTOR(Array); @@ -65,7 +65,7 @@ using FieldMap = std::map, AllocatorWithMemoryTrackin struct X : public FieldMap \ { \ using FieldMap::FieldMap; \ - size_t nested_field_depth = 0; \ + uint8_t nested_field_depth = 0; \ } DEFINE_FIELD_MAP(Object); @@ -296,10 +296,11 @@ decltype(auto) castToNearestFieldType(T && x) */ #define DBMS_MIN_FIELD_SIZE 32 +/// Note: uint8_t is used for storing depth value. #if defined(SANITIZER) || !defined(NDEBUG) #define DBMS_MAX_NESTED_FIELD_DEPTH 64 #else - #define DBMS_MAX_NESTED_FIELD_DEPTH 256 + #define DBMS_MAX_NESTED_FIELD_DEPTH 255 #endif /** Discriminated union of several types. @@ -683,9 +684,9 @@ private: /// StorageType and Original are the same for Array, Tuple, Map, Object template - size_t calculateAndCheckFieldDepth(Original && x) + uint8_t calculateAndCheckFieldDepth(Original && x) { - size_t result = 0; + uint8_t result = 0; if constexpr (std::is_same_v || std::is_same_v @@ -694,29 +695,29 @@ private: { result = x.nested_field_depth; - auto calculate_max = [](const Field & elem, size_t result) + auto get_depth = [](const Field & elem) { switch (elem.which) { case Types::Array: - return std::max(result, elem.template get().nested_field_depth); + return elem.template get().nested_field_depth; case Types::Tuple: - return std::max(result, elem.template get().nested_field_depth); + return elem.template get().nested_field_depth; case Types::Map: - return std::max(result, elem.template get().nested_field_depth); + return elem.template get().nested_field_depth; case Types::Object: - return std::max(result, elem.template get().nested_field_depth); + return elem.template get().nested_field_depth; default: - return result; + return static_cast(0); } }; if constexpr (std::is_same_v) for (auto & [_, value] : x) - result = calculate_max(value, result); + result = std::max(get_depth(value), result); else for (auto & value : x) - result = calculate_max(value, result); + result = std::max(get_depth(value), result); } if (result >= DBMS_MAX_NESTED_FIELD_DEPTH) From 0094919c436dacc4f52c97efedf2b6a166cf198b Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Tue, 4 Jul 2023 12:53:03 +0300 Subject: [PATCH 36/63] Add line --- tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql index 5350ef99ed3..155596dd1d5 100644 --- a/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql +++ b/tests/queries/0_stateless/02810_convert_uuid_to_uint128.sql @@ -5,4 +5,4 @@ SELECT toUInt64(toUUID('00000000-0000-0000-0000-000000000000')); -- { serverErro SELECT toInt128(toUUID('00000000-0000-0000-0000-000000000000')); -- { serverError NOT_IMPLEMENTED } SELECT cast(toUUID('f82aef31-279e-431f-8b00-2899ad387aea'), 'UInt128'); select accurateCast(toUUID('f82aef31-279e-431f-8b00-2899ad387aea'), 'UInt128'); -select toUUID('f82aef31-279e-431f-8b00-2899ad387aea')::UInt128; \ No newline at end of file +select toUUID('f82aef31-279e-431f-8b00-2899ad387aea')::UInt128; From 9c8cb9f77ee3f087e3799b2a14a4d0db6f75f367 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Tue, 4 Jul 2023 13:20:48 +0300 Subject: [PATCH 37/63] Add comment to docs --- docs/en/sql-reference/functions/array-functions.md | 3 ++- docs/ru/sql-reference/functions/array-functions.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/sql-reference/functions/array-functions.md b/docs/en/sql-reference/functions/array-functions.md index 7f2b8f3c605..763a61d43f2 100644 --- a/docs/en/sql-reference/functions/array-functions.md +++ b/docs/en/sql-reference/functions/array-functions.md @@ -142,6 +142,7 @@ range([start, ] end [, step]) - All arguments `start`, `end`, `step` must be below data types: `UInt8`, `UInt16`, `UInt32`, `UInt64`,`Int8`, `Int16`, `Int32`, `Int64`, as well as elements of the returned array, which's type is a super type of all arguments. - An exception is thrown if query results in arrays with a total length of more than number of elements specified by the [function_range_max_elements_in_block](../../operations/settings/settings.md#settings-function_range_max_elements_in_block) setting. +- Returns Null if any argument has Nullable(Nothing) type. An exception is thrown if any argument has Null value (Nullable(T) type). **Examples** @@ -878,7 +879,7 @@ A special function. See the section [“ArrayJoin function”](../../sql-referen ## arrayDifference -Calculates an array of differences between adjacent array elements. The first element of the result array will be 0, the second `a[1] - a[0]`, the third `a[2] - a[1]`, etc. The type of elements in the result array is determined by the type inference rules for subtraction (e.g. `UInt8` - `UInt8` = `Int16`). +Calculates an array of differences between adjacent array elements. The first element of the result array will be 0, the second `a[1] - a[0]`, the third `a[2] - a[1]`, etc. The type of elements in the result array is determined by the type inference rules for subtraction (e.g. `UInt8` - `UInt8` = `Int16`). **Syntax** diff --git a/docs/ru/sql-reference/functions/array-functions.md b/docs/ru/sql-reference/functions/array-functions.md index c43323d68fd..439eddfd752 100644 --- a/docs/ru/sql-reference/functions/array-functions.md +++ b/docs/ru/sql-reference/functions/array-functions.md @@ -145,6 +145,8 @@ range([start, ] end [, step]) - Если в результате запроса создаются массивы суммарной длиной больше, чем количество элементов, указанное настройкой [function_range_max_elements_in_block](../../operations/settings/settings.md#settings-function_range_max_elements_in_block), то генерируется исключение. +- Возвращает Null если любой аргумент Nullable(Nothing) типа. Генерируется исключение если любой аргумент Null (Nullable(T) тип). + **Примеры** Запрос: From 99f02e0f6bfb4682e972b8258fea7be02c0f2691 Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Tue, 4 Jul 2023 22:06:17 +0300 Subject: [PATCH 38/63] Add const to trying to fix build --- src/Functions/array/range.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Functions/array/range.cpp b/src/Functions/array/range.cpp index 47e90de2e2b..b14f2baca15 100644 --- a/src/Functions/array/range.cpp +++ b/src/Functions/array/range.cpp @@ -414,7 +414,7 @@ private: if (arguments.size() == 1) { throwIfNullValue(arguments[0]); - auto * col = arguments[0].column.get(); + const auto * col = arguments[0].column.get(); if (arguments[0].type->isNullable()) { const auto * nullable = checkAndGetColumn(*arguments[0].column); From 7c3c48c8c44a1c53902dd24d540e25e2634a986b Mon Sep 17 00:00:00 2001 From: flynn Date: Wed, 5 Jul 2023 11:20:03 +0000 Subject: [PATCH 39/63] Fix use_structure_from_insertion_table_in_table_functions does not work for materialized and alias columns --- src/Interpreters/Context.cpp | 6 +++++- .../0_stateless/02811_insert_schema_inference.reference | 0 .../0_stateless/02811_insert_schema_inference.sql | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/queries/0_stateless/02811_insert_schema_inference.reference create mode 100644 tests/queries/0_stateless/02811_insert_schema_inference.sql diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 7482450d529..a0abab349b3 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -1519,7 +1519,11 @@ StoragePtr Context::executeTableFunction(const ASTPtr & table_expression, const uint64_t use_structure_from_insertion_table_in_table_functions = getSettingsRef().use_structure_from_insertion_table_in_table_functions; if (use_structure_from_insertion_table_in_table_functions && table_function_ptr->needStructureHint() && hasInsertionTable()) { - const auto & insert_structure = DatabaseCatalog::instance().getTable(getInsertionTable(), shared_from_this())->getInMemoryMetadataPtr()->getColumns(); + const auto & insert_structure = DatabaseCatalog::instance() + .getTable(getInsertionTable(), shared_from_this()) + ->getInMemoryMetadataPtr() + ->getColumns() + .getInsertable(); DB::ColumnsDescription structure_hint; bool use_columns_from_insert_query = true; diff --git a/tests/queries/0_stateless/02811_insert_schema_inference.reference b/tests/queries/0_stateless/02811_insert_schema_inference.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/02811_insert_schema_inference.sql b/tests/queries/0_stateless/02811_insert_schema_inference.sql new file mode 100644 index 00000000000..9de710047f7 --- /dev/null +++ b/tests/queries/0_stateless/02811_insert_schema_inference.sql @@ -0,0 +1,9 @@ +drop table if exists test; +create table test +( + n1 UInt32, + n2 UInt32 alias murmurHash3_32(n1), + n3 UInt32 materialized n2 + 1 +)engine=MergeTree order by n1; +insert into test select * from generateRandom() limit 10; +drop table test; From c178a362c573f7212c8f9986f78e78b209713bee Mon Sep 17 00:00:00 2001 From: flynn Date: Thu, 6 Jul 2023 02:30:37 +0000 Subject: [PATCH 40/63] Fix for new analyzer --- src/Analyzer/Passes/QueryAnalysisPass.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Analyzer/Passes/QueryAnalysisPass.cpp b/src/Analyzer/Passes/QueryAnalysisPass.cpp index 163092f1b7f..34286c266c9 100644 --- a/src/Analyzer/Passes/QueryAnalysisPass.cpp +++ b/src/Analyzer/Passes/QueryAnalysisPass.cpp @@ -6238,7 +6238,11 @@ void QueryAnalyzer::resolveTableFunction(QueryTreeNodePtr & table_function_node, const auto & insertion_table = scope_context->getInsertionTable(); if (!insertion_table.empty()) { - const auto & insert_structure = DatabaseCatalog::instance().getTable(insertion_table, scope_context)->getInMemoryMetadataPtr()->getColumns(); + const auto & insert_structure = DatabaseCatalog::instance() + .getTable(insertion_table, scope_context) + ->getInMemoryMetadataPtr() + ->getColumns() + .getInsertable(); DB::ColumnsDescription structure_hint; bool use_columns_from_insert_query = true; From bea58a2780d030e5d84dd8a6d29a36fe40ce75c2 Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Mon, 10 Jul 2023 17:21:37 -0400 Subject: [PATCH 41/63] Docs: added two methods for user profile --- docs/en/operations/settings/index.md | 91 +++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 3 deletions(-) diff --git a/docs/en/operations/settings/index.md b/docs/en/operations/settings/index.md index eb1d5db5676..022b50925c4 100644 --- a/docs/en/operations/settings/index.md +++ b/docs/en/operations/settings/index.md @@ -11,9 +11,9 @@ There are multiple ways to define ClickHouse settings. Settings are configured i The order of priority for defining a setting is: -1. Settings in the `users.xml` server configuration file - - - Set in the element ``. +1. Settings in user profiles. Set user profiles either by: + - SQL (recommended) + - adding one or more XML or YAML files to `/etc/clickhouse-server/users.d` 2. Session settings @@ -28,6 +28,91 @@ The order of priority for defining a setting is: View the [Settings](./settings.md) page for a description of the ClickHouse settings. +## Examples + +These examples all set the value of the `async_insert` setting to `1`, and show how to examine +the settings in a running system. + +### Using SQL to create a user profile + +```sql +CREATE +SETTINGS PROFILE log_ingest SETTINGS async_insert = 1 +``` + +```sql +CREATE USER ingester +IDENTIFIED WITH sha256_hash BY '7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3' +# highlight-next-line +SETTINGS PROFILE log_ingest +``` + +#### Examine the user profile and assignment + +```sql +SHOW ACCESS +``` + +```response +┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ +│ CREATE USER default IDENTIFIED WITH sha256_password │ +# highlight-next-line +│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ +│ CREATE SETTINGS PROFILE default │ +# highlight-next-line +│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ +│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ +│ ... │ +└────────────────────────────────────────────────────────────────────────────────────┘ +``` + +### Using XML to create a user profile + +```xml title=/etc/clickhouse-server/users.d/users.xml + +# highlight-start + + + 1 + + +# highlight-end + + + + 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 +# highlight-start + log_ingest +# highlight-end + + + 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 + 1 + 1 + + + +``` + +#### Examine the user profile and assignment + +```sql +SHOW ACCESS +``` + +```response +┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ +│ CREATE USER default IDENTIFIED WITH sha256_password │ +# highlight-next-line +│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ +│ CREATE SETTINGS PROFILE default │ +# highlight-next-line +│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ +│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ +│ ... │ +└────────────────────────────────────────────────────────────────────────────────────┘ +``` + ## Converting a Setting to its Default Value If you change a setting and would like to revert it back to its default value, set the value to `DEFAULT`. The syntax looks like: From 2eccead2d421833857222bbe05e084512653386c Mon Sep 17 00:00:00 2001 From: Dmitry Kardymon Date: Tue, 11 Jul 2023 16:27:28 +0000 Subject: [PATCH 42/63] Fix const(Nullable) case, add test --- src/Functions/array/range.cpp | 8 ++++++-- tests/queries/0_stateless/02797_range_nullable.reference | 1 + tests/queries/0_stateless/02797_range_nullable.sql | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Functions/array/range.cpp b/src/Functions/array/range.cpp index b14f2baca15..57679ccb180 100644 --- a/src/Functions/array/range.cpp +++ b/src/Functions/array/range.cpp @@ -404,8 +404,12 @@ private: { if (!col.type->isNullable()) return; - const auto & nullable_col = assert_cast(*col.column); - const auto & null_map = nullable_col.getNullMapData(); + const ColumnNullable * nullable_col = checkAndGetColumn(*col.column); + if (!nullable_col) + nullable_col = checkAndGetColumnConstData(col.column.get()); + if (!nullable_col) + return; + const auto & null_map = nullable_col->getNullMapData(); if (!memoryIsZero(null_map.data(), 0, null_map.size())) throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName()); }; diff --git a/tests/queries/0_stateless/02797_range_nullable.reference b/tests/queries/0_stateless/02797_range_nullable.reference index a082a71f4ec..0e01ba9984c 100644 --- a/tests/queries/0_stateless/02797_range_nullable.reference +++ b/tests/queries/0_stateless/02797_range_nullable.reference @@ -5,3 +5,4 @@ [0] [0,2,4,6,8] [0,2,4,6,8] +[0,2,4,6,8] diff --git a/tests/queries/0_stateless/02797_range_nullable.sql b/tests/queries/0_stateless/02797_range_nullable.sql index 2b0fe69b123..ae35eb6fb57 100644 --- a/tests/queries/0_stateless/02797_range_nullable.sql +++ b/tests/queries/0_stateless/02797_range_nullable.sql @@ -5,6 +5,8 @@ select range('string', Null); SELECT range(toNullable(1)); SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); SELECT range(0::Nullable(Int64), 10::Nullable(Int64), 2::Nullable(Int64)); +SELECT range(materialize(0), 10::Nullable(UInt64), 2::Nullable(UInt64)); SELECT range(Null::Nullable(UInt64), 10::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } SELECT range(0::Nullable(UInt64), Null::Nullable(UInt64), 2::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } SELECT range(0::Nullable(UInt64), 10::Nullable(UInt64), Null::Nullable(UInt64)); -- { serverError BAD_ARGUMENTS } +SELECT range(Null::Nullable(UInt8), materialize(1)); -- { serverError BAD_ARGUMENTS } From 6086787957ce27de5510c964eff8f4c24a6bf088 Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Tue, 11 Jul 2023 16:59:16 -0400 Subject: [PATCH 43/63] add overview --- .../settings.md | 4 +- docs/en/operations/settings/index.md | 175 +--------------- .../settings/settings-query-level.md | 188 ++++++++++++++++++ 3 files changed, 198 insertions(+), 169 deletions(-) create mode 100644 docs/en/operations/settings/settings-query-level.md diff --git a/docs/en/operations/server-configuration-parameters/settings.md b/docs/en/operations/server-configuration-parameters/settings.md index bad7e388377..8bb7c5cb037 100644 --- a/docs/en/operations/server-configuration-parameters/settings.md +++ b/docs/en/operations/server-configuration-parameters/settings.md @@ -1,11 +1,11 @@ --- slug: /en/operations/server-configuration-parameters/settings sidebar_position: 57 -sidebar_label: Server Settings +sidebar_label: Global Server Settings description: This section contains descriptions of server settings that cannot be changed at the session or query level. --- -# Server Settings +# Global Server Settings This section contains descriptions of server settings that cannot be changed at the session or query level. diff --git a/docs/en/operations/settings/index.md b/docs/en/operations/settings/index.md index 022b50925c4..6863d7f3191 100644 --- a/docs/en/operations/settings/index.md +++ b/docs/en/operations/settings/index.md @@ -7,175 +7,16 @@ pagination_next: en/operations/settings/settings # Settings Overview -There are multiple ways to define ClickHouse settings. Settings are configured in layers, and each subsequent layer redefines the previous values of a setting. +There are two main groups of ClickHouse settings: -The order of priority for defining a setting is: +- Global server settings +- Query-level settings -1. Settings in user profiles. Set user profiles either by: - - SQL (recommended) - - adding one or more XML or YAML files to `/etc/clickhouse-server/users.d` +The main distinction between global server settings and query-level settings is that +global server settings must be set in configuration files while query-level settings +can be set in configuration files or with SQL queries. -2. Session settings +Read about [global server settings](/docs/en/operations/server-configuration-parameters/settings.md) to learn more about configuring your ClickHouse server at the global server level. - - Send `SET setting=value` from the ClickHouse console client in interactive mode. - Similarly, you can use ClickHouse sessions in the HTTP protocol. To do this, you need to specify the `session_id` HTTP parameter. +Read about [query-level settings](/docs/en/operations/settings/settings-query-level.md) to learn more about configuring your ClickHouse server at the query-level. -3. Query settings - - - When starting the ClickHouse console client in non-interactive mode, set the startup parameter `--setting=value`. - - When using the HTTP API, pass CGI parameters (`URL?setting_1=value&setting_2=value...`). - - Define settings in the [SETTINGS](../../sql-reference/statements/select/index.md#settings-in-select-query) clause of the SELECT query. The setting value is applied only to that query and is reset to the default or previous value after the query is executed. - -View the [Settings](./settings.md) page for a description of the ClickHouse settings. - -## Examples - -These examples all set the value of the `async_insert` setting to `1`, and show how to examine -the settings in a running system. - -### Using SQL to create a user profile - -```sql -CREATE -SETTINGS PROFILE log_ingest SETTINGS async_insert = 1 -``` - -```sql -CREATE USER ingester -IDENTIFIED WITH sha256_hash BY '7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3' -# highlight-next-line -SETTINGS PROFILE log_ingest -``` - -#### Examine the user profile and assignment - -```sql -SHOW ACCESS -``` - -```response -┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ -│ CREATE USER default IDENTIFIED WITH sha256_password │ -# highlight-next-line -│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ -│ CREATE SETTINGS PROFILE default │ -# highlight-next-line -│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ -│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ -│ ... │ -└────────────────────────────────────────────────────────────────────────────────────┘ -``` - -### Using XML to create a user profile - -```xml title=/etc/clickhouse-server/users.d/users.xml - -# highlight-start - - - 1 - - -# highlight-end - - - - 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 -# highlight-start - log_ingest -# highlight-end - - - 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 - 1 - 1 - - - -``` - -#### Examine the user profile and assignment - -```sql -SHOW ACCESS -``` - -```response -┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ -│ CREATE USER default IDENTIFIED WITH sha256_password │ -# highlight-next-line -│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ -│ CREATE SETTINGS PROFILE default │ -# highlight-next-line -│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ -│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ -│ ... │ -└────────────────────────────────────────────────────────────────────────────────────┘ -``` - -## Converting a Setting to its Default Value - -If you change a setting and would like to revert it back to its default value, set the value to `DEFAULT`. The syntax looks like: - -```sql -SET setting_name = DEFAULT -``` - -For example, the default value of `max_insert_block_size` is 1048449. Suppose you change its value to 100000: - -```sql -SET max_insert_block_size=100000; - -SELECT value FROM system.settings where name='max_insert_block_size'; -``` - -The response is: - -```response -┌─value──┐ -│ 100000 │ -└────────┘ -``` - -The following command sets its value back to 1048449: - -```sql -SET max_insert_block_size=DEFAULT; - -SELECT value FROM system.settings where name='max_insert_block_size'; -``` - -The setting is now back to its default: - -```response -┌─value───┐ -│ 1048449 │ -└─────────┘ -``` - - -## Custom Settings {#custom_settings} - -In addition to the common [settings](../../operations/settings/settings.md), users can define custom settings. - -A custom setting name must begin with one of predefined prefixes. The list of these prefixes must be declared in the [custom_settings_prefixes](../../operations/server-configuration-parameters/settings.md#custom_settings_prefixes) parameter in the server configuration file. - -```xml -custom_ -``` - -To define a custom setting use `SET` command: - -```sql -SET custom_a = 123; -``` - -To get the current value of a custom setting use `getSetting()` function: - -```sql -SELECT getSetting('custom_a'); -``` - -**See Also** - -- [Server Configuration Settings](../../operations/server-configuration-parameters/settings.md) diff --git a/docs/en/operations/settings/settings-query-level.md b/docs/en/operations/settings/settings-query-level.md new file mode 100644 index 00000000000..99b18e5e49f --- /dev/null +++ b/docs/en/operations/settings/settings-query-level.md @@ -0,0 +1,188 @@ +--- +sidebar_label: Query-level Settings +title: Query-level Settings +slug: /en/operations/settings/query-level +--- + +There are multiple ways to set ClickHouse query-level settings. Settings are configured in layers, and each subsequent layer redefines the previous values of a setting. + +The order of priority for defining a setting is: + +1. Settings in user profiles. Set user profiles either by: + + - SQL (recommended) + - adding one or more XML or YAML files to `/etc/clickhouse-server/users.d` + +2. Session settings + + - Send `SET setting=value` from the ClickHouse Cloud SQL console or + `clickhouse client` in interactive mode. Similarly, you can use ClickHouse + sessions in the HTTP protocol. To do this, you need to specify the + `session_id` HTTP parameter. + +3. Query settings + + - When starting `clickhouse client` in non-interactive mode, set the startup + parameter `--setting=value`. + - When using the HTTP API, pass CGI parameters (`URL?setting_1=value&setting_2=value...`). + - Define settings in the + [SETTINGS](../../sql-reference/statements/select/index.md#settings-in-select-query) + clause of the SELECT query. The setting value is applied only to that query + and is reset to the default or previous value after the query is executed. + +## Examples + +These examples all set the value of the `async_insert` setting to `1`, and +show how to examine the settings in a running system. + +### Using SQL to create a settings profile + +This creates the profile `log_ingest` with the setting `async_inset = 1`: + +```sql +CREATE +SETTINGS PROFILE log_ingest SETTINGS async_insert = 1 +``` + +This creates the user `ingester` and assigns the user the settings profile `log_ingest`: + +```sql +CREATE USER ingester +IDENTIFIED WITH sha256_hash BY '7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3' +# highlight-next-line +SETTINGS PROFILE log_ingest +``` + +#### Examine the settings profile and assignment + +```sql +SHOW ACCESS +``` + +```response +┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ +│ CREATE USER default IDENTIFIED WITH sha256_password │ +# highlight-next-line +│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ +│ CREATE SETTINGS PROFILE default │ +# highlight-next-line +│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ +│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ +│ ... │ +└────────────────────────────────────────────────────────────────────────────────────┘ +``` + +### Using XML to create a settings profile + +```xml title=/etc/clickhouse-server/users.d/users.xml + +# highlight-start + + + 1 + + +# highlight-end + + + + 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 +# highlight-start + log_ingest +# highlight-end + + + 7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3 + 1 + 1 + + + +``` + +#### Examine the settings profile and assignment + +```sql +SHOW ACCESS +``` + +```response +┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ +│ CREATE USER default IDENTIFIED WITH sha256_password │ +# highlight-next-line +│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ +│ CREATE SETTINGS PROFILE default │ +# highlight-next-line +│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ +│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ +│ ... │ +└────────────────────────────────────────────────────────────────────────────────────┘ +``` + +## Converting a Setting to its Default Value + +If you change a setting and would like to revert it back to its default value, set the value to `DEFAULT`. The syntax looks like: + +```sql +SET setting_name = DEFAULT +``` + +For example, the default value of `max_insert_block_size` is 1048449. Suppose you change its value to 100000: + +```sql +SET max_insert_block_size=100000; + +SELECT value FROM system.settings where name='max_insert_block_size'; +``` + +The response is: + +```response +┌─value──┐ +│ 100000 │ +└────────┘ +``` + +The following command sets its value back to 1048449: + +```sql +SET max_insert_block_size=DEFAULT; + +SELECT value FROM system.settings where name='max_insert_block_size'; +``` + +The setting is now back to its default: + +```response +┌─value───┐ +│ 1048449 │ +└─────────┘ +``` + + +## Custom Settings {#custom_settings} + +In addition to the common [settings](../../operations/settings/settings.md), users can define custom settings. + +A custom setting name must begin with one of predefined prefixes. The list of these prefixes must be declared in the [custom_settings_prefixes](../../operations/server-configuration-parameters/settings.md#custom_settings_prefixes) parameter in the server configuration file. + +```xml +custom_ +``` + +To define a custom setting use `SET` command: + +```sql +SET custom_a = 123; +``` + +To get the current value of a custom setting use `getSetting()` function: + +```sql +SELECT getSetting('custom_a'); +``` + +**See Also** + +- View the [Settings](./settings.md) page for a description of the ClickHouse settings. +- [Global server settings](../../operations/server-configuration-parameters/settings.md) From 46fd88dca4bbcf6b83843780c4579de4212e0222 Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Tue, 11 Jul 2023 17:50:52 -0400 Subject: [PATCH 44/63] add session setting --- .../settings/settings-query-level.md | 89 ++++++++++++------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/docs/en/operations/settings/settings-query-level.md b/docs/en/operations/settings/settings-query-level.md index 99b18e5e49f..81cc2294a4c 100644 --- a/docs/en/operations/settings/settings-query-level.md +++ b/docs/en/operations/settings/settings-query-level.md @@ -8,7 +8,7 @@ There are multiple ways to set ClickHouse query-level settings. Settings are con The order of priority for defining a setting is: -1. Settings in user profiles. Set user profiles either by: +1. Applying a setting to a user directly, or within a settings profile - SQL (recommended) - adding one or more XML or YAML files to `/etc/clickhouse-server/users.d` @@ -35,7 +35,32 @@ The order of priority for defining a setting is: These examples all set the value of the `async_insert` setting to `1`, and show how to examine the settings in a running system. -### Using SQL to create a settings profile +### Using SQL to apply a setting to a user directly + +This creates the user `ingester` with the setting `async_inset = 1`: + +```sql +CREATE USER ingester +IDENTIFIED WITH sha256_hash BY '7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3' +# highlight-next-line +SETTINGS async_insert = 1 +``` + +#### Examine the settings profile and assignment + +```sql +SHOW ACCESS +``` + +```response +┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ +│ ... │ +# highlight-next-line +│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS async_insert = true │ +│ ... │ +└────────────────────────────────────────────────────────────────────────────────────┘ +``` +### Using SQL to create a settings profile and assign to a user This creates the profile `log_ingest` with the setting `async_inset = 1`: @@ -53,26 +78,8 @@ IDENTIFIED WITH sha256_hash BY '7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f2 SETTINGS PROFILE log_ingest ``` -#### Examine the settings profile and assignment -```sql -SHOW ACCESS -``` - -```response -┌─ACCESS─────────────────────────────────────────────────────────────────────────────┐ -│ CREATE USER default IDENTIFIED WITH sha256_password │ -# highlight-next-line -│ CREATE USER ingester IDENTIFIED WITH sha256_password SETTINGS PROFILE log_ingest │ -│ CREATE SETTINGS PROFILE default │ -# highlight-next-line -│ CREATE SETTINGS PROFILE log_ingest SETTINGS async_insert = true │ -│ CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1 │ -│ ... │ -└────────────────────────────────────────────────────────────────────────────────────┘ -``` - -### Using XML to create a settings profile +### Using XML to create a settings profile and user ```xml title=/etc/clickhouse-server/users.d/users.xml @@ -119,6 +126,29 @@ SHOW ACCESS └────────────────────────────────────────────────────────────────────────────────────┘ ``` +### Assign a setting to a session + +```sql +SET async_insert =1; +SELECT value FROM system.settings where name='async_insert'; +``` + +```response +┌─value──┐ +│ 1 │ +└────────┘ +``` + +### Assign a setting during a query + +```sql +INSERT INTO YourTable +# highlight-next-line +SETTINGS async_insert=1 +VALUES (...) +``` + + ## Converting a Setting to its Default Value If you change a setting and would like to revert it back to its default value, set the value to `DEFAULT`. The syntax looks like: @@ -127,39 +157,38 @@ If you change a setting and would like to revert it back to its default value, s SET setting_name = DEFAULT ``` -For example, the default value of `max_insert_block_size` is 1048449. Suppose you change its value to 100000: +For example, the default value of `async_insert` is `0`. Suppose you change its value to `1`: ```sql -SET max_insert_block_size=100000; +SET async_insert = 1; -SELECT value FROM system.settings where name='max_insert_block_size'; +SELECT value FROM system.settings where name='async_insert'; ``` The response is: ```response ┌─value──┐ -│ 100000 │ +│ 1 │ └────────┘ ``` -The following command sets its value back to 1048449: +The following command sets its value back to 0: ```sql -SET max_insert_block_size=DEFAULT; +SET async_insert = DEFAULT; -SELECT value FROM system.settings where name='max_insert_block_size'; +SELECT value FROM system.settings where name='async_insert'; ``` The setting is now back to its default: ```response ┌─value───┐ -│ 1048449 │ +│ 0 │ └─────────┘ ``` - ## Custom Settings {#custom_settings} In addition to the common [settings](../../operations/settings/settings.md), users can define custom settings. From d891c4c9a218784d1717710a676b3a132339b14b Mon Sep 17 00:00:00 2001 From: Lars Eidnes Date: Wed, 12 Jul 2023 15:06:01 +0200 Subject: [PATCH 45/63] MaterializedMySQL: Delay disconnection of mysqlxx::Pool::Entry until refcount==0 If Entry::disconnect() is called, it is removed from its pool and underlying mysqlxx::Connection is disconnected. Since Entry objects are copyable and some of them could be alive when disconnect() is called which would lead to undefined behavior. Suggesting to disconnect it when the last object is being destroyed. --- src/Common/mysqlxx/Pool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Common/mysqlxx/Pool.cpp b/src/Common/mysqlxx/Pool.cpp index d10889d1f97..64a69c48e1d 100644 --- a/src/Common/mysqlxx/Pool.cpp +++ b/src/Common/mysqlxx/Pool.cpp @@ -25,8 +25,6 @@ void Pool::Entry::incrementRefCount() /// First reference, initialize thread if (data->ref_count.fetch_add(1) == 0) mysql_thread_init(); - - chassert(!data->removed_from_pool); } @@ -43,7 +41,10 @@ void Pool::Entry::decrementRefCount() /// In Pool::Entry::disconnect() we remove connection from the list of pool's connections. /// So now we must deallocate the memory. if (data->removed_from_pool) + { + data->conn.disconnect(); ::delete data; + } } } @@ -230,8 +231,6 @@ void Pool::removeConnection(Connection* connection) std::lock_guard lock(mutex); if (connection) { - if (!connection->removed_from_pool) - connection->conn.disconnect(); connections.remove(connection); connection->removed_from_pool = true; } @@ -240,6 +239,7 @@ void Pool::removeConnection(Connection* connection) void Pool::Entry::disconnect() { + // Remove the Entry from the Pool. Actual disconnection is delayed until refcount == 0. pool->removeConnection(data); } From 132052fbf2404d8faa5e14fbc2cbd5f8e16bdc1f Mon Sep 17 00:00:00 2001 From: ltrk2 <107155950+ltrk2@users.noreply.github.com> Date: Thu, 29 Jun 2023 12:16:40 -0700 Subject: [PATCH 46/63] Implement partial support for endianness-independent serialization --- .../AggregateFunctionGroupArray.h | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/AggregateFunctions/AggregateFunctionGroupArray.h b/src/AggregateFunctions/AggregateFunctionGroupArray.h index 7a5e6a8cb2d..b5905105457 100644 --- a/src/AggregateFunctions/AggregateFunctionGroupArray.h +++ b/src/AggregateFunctions/AggregateFunctionGroupArray.h @@ -266,19 +266,20 @@ public: void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional /* version */) const override { const auto & value = this->data(place).value; - size_t size = value.size(); + const size_t size = value.size(); writeVarUInt(size, buf); - buf.write(reinterpret_cast(value.data()), size * sizeof(value[0])); + for (const auto & element : value) + writeBinaryLittleEndian(element, buf); if constexpr (Trait::last) - DB::writeIntBinary(this->data(place).total_values, buf); + writeBinaryLittleEndian(this->data(place).total_values, buf); if constexpr (Trait::sampler == Sampler::RNG) { - DB::writeIntBinary(this->data(place).total_values, buf); + writeBinaryLittleEndian(this->data(place).total_values, buf); WriteBufferFromOwnString rng_buf; rng_buf << this->data(place).rng; - DB::writeStringBinary(rng_buf.str(), buf); + writeStringBinary(rng_buf.str(), buf); } } @@ -297,16 +298,17 @@ public: auto & value = this->data(place).value; value.resize_exact(size, arena); - buf.readStrict(reinterpret_cast(value.data()), size * sizeof(value[0])); + for (auto & element : value) + readBinaryLittleEndian(element, buf); if constexpr (Trait::last) - DB::readIntBinary(this->data(place).total_values, buf); + readBinaryLittleEndian(this->data(place).total_values, buf); if constexpr (Trait::sampler == Sampler::RNG) { - DB::readIntBinary(this->data(place).total_values, buf); + readBinaryLittleEndian(this->data(place).total_values, buf); std::string rng_string; - DB::readStringBinary(rng_string, buf); + readStringBinary(rng_string, buf); ReadBufferFromString rng_buf(rng_string); rng_buf >> this->data(place).rng; } @@ -603,14 +605,14 @@ public: node->write(buf); if constexpr (Trait::last) - DB::writeIntBinary(data(place).total_values, buf); + writeBinaryLittleEndian(data(place).total_values, buf); if constexpr (Trait::sampler == Sampler::RNG) { - DB::writeIntBinary(data(place).total_values, buf); + writeBinaryLittleEndian(data(place).total_values, buf); WriteBufferFromOwnString rng_buf; rng_buf << data(place).rng; - DB::writeStringBinary(rng_buf.str(), buf); + writeStringBinary(rng_buf.str(), buf); } } @@ -636,13 +638,13 @@ public: value[i] = Node::read(buf, arena); if constexpr (Trait::last) - DB::readIntBinary(data(place).total_values, buf); + readBinaryLittleEndian(data(place).total_values, buf); if constexpr (Trait::sampler == Sampler::RNG) { - DB::readIntBinary(data(place).total_values, buf); + readBinaryLittleEndian(data(place).total_values, buf); std::string rng_string; - DB::readStringBinary(rng_string, buf); + readStringBinary(rng_string, buf); ReadBufferFromString rng_buf(rng_string); rng_buf >> data(place).rng; } From 0527a32282f7d9153eecbb9c740be18140f741c4 Mon Sep 17 00:00:00 2001 From: ltrk2 <107155950+ltrk2@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:27:38 -0700 Subject: [PATCH 47/63] Implement platform-independent serialization for further aggregate functions --- .../AggregateFunctionBoundingRatio.h | 51 +++++++++++-------- .../AggregateFunctionDeltaSum.h | 16 +++--- .../AggregateFunctionDeltaSumTimestamp.h | 24 ++++----- src/AggregateFunctions/QuantileApprox.h | 28 +++++----- src/AggregateFunctions/ReservoirSampler.h | 12 ++--- src/Common/TransformEndianness.hpp | 6 +++ 6 files changed, 76 insertions(+), 61 deletions(-) diff --git a/src/AggregateFunctions/AggregateFunctionBoundingRatio.h b/src/AggregateFunctions/AggregateFunctionBoundingRatio.h index 935adbf2b7d..82e4f1122a8 100644 --- a/src/AggregateFunctions/AggregateFunctionBoundingRatio.h +++ b/src/AggregateFunctions/AggregateFunctionBoundingRatio.h @@ -67,29 +67,38 @@ struct AggregateFunctionBoundingRatioData } } - void serialize(WriteBuffer & buf) const - { - writeBinary(empty, buf); - - if (!empty) - { - writePODBinary(left, buf); - writePODBinary(right, buf); - } - } - - void deserialize(ReadBuffer & buf) - { - readBinary(empty, buf); - - if (!empty) - { - readPODBinary(left, buf); - readPODBinary(right, buf); - } - } + void serialize(WriteBuffer & buf) const; + void deserialize(ReadBuffer & buf); }; +template +inline void transformEndianness(AggregateFunctionBoundingRatioData::Point & p) +{ + transformEndianness(p.x); + transformEndianness(p.y); +} + +void AggregateFunctionBoundingRatioData::serialize(WriteBuffer & buf) const +{ + writeBinaryLittleEndian(empty, buf); + + if (!empty) + { + writeBinaryLittleEndian(left, buf); + writeBinaryLittleEndian(right, buf); + } +} + +void AggregateFunctionBoundingRatioData::deserialize(ReadBuffer & buf) +{ + readBinaryLittleEndian(empty, buf); + + if (!empty) + { + readBinaryLittleEndian(left, buf); + readBinaryLittleEndian(right, buf); + } +} class AggregateFunctionBoundingRatio final : public IAggregateFunctionDataHelper { diff --git a/src/AggregateFunctions/AggregateFunctionDeltaSum.h b/src/AggregateFunctions/AggregateFunctionDeltaSum.h index 199d2706d3a..d64f949825a 100644 --- a/src/AggregateFunctions/AggregateFunctionDeltaSum.h +++ b/src/AggregateFunctions/AggregateFunctionDeltaSum.h @@ -103,18 +103,18 @@ public: void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional /* version */) const override { - writeIntBinary(this->data(place).sum, buf); - writeIntBinary(this->data(place).first, buf); - writeIntBinary(this->data(place).last, buf); - writePODBinary(this->data(place).seen, buf); + writeBinaryLittleEndian(this->data(place).sum, buf); + writeBinaryLittleEndian(this->data(place).first, buf); + writeBinaryLittleEndian(this->data(place).last, buf); + writeBinaryLittleEndian(this->data(place).seen, buf); } void deserialize(AggregateDataPtr __restrict place, ReadBuffer & buf, std::optional /* version */, Arena *) const override { - readIntBinary(this->data(place).sum, buf); - readIntBinary(this->data(place).first, buf); - readIntBinary(this->data(place).last, buf); - readPODBinary(this->data(place).seen, buf); + readBinaryLittleEndian(this->data(place).sum, buf); + readBinaryLittleEndian(this->data(place).first, buf); + readBinaryLittleEndian(this->data(place).last, buf); + readBinaryLittleEndian(this->data(place).seen, buf); } void insertResultInto(AggregateDataPtr __restrict place, IColumn & to, Arena *) const override diff --git a/src/AggregateFunctions/AggregateFunctionDeltaSumTimestamp.h b/src/AggregateFunctions/AggregateFunctionDeltaSumTimestamp.h index 5ca07bb0bdf..5eeb1425afb 100644 --- a/src/AggregateFunctions/AggregateFunctionDeltaSumTimestamp.h +++ b/src/AggregateFunctions/AggregateFunctionDeltaSumTimestamp.h @@ -144,22 +144,22 @@ public: void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional /* version */) const override { - writeIntBinary(this->data(place).sum, buf); - writeIntBinary(this->data(place).first, buf); - writeIntBinary(this->data(place).first_ts, buf); - writeIntBinary(this->data(place).last, buf); - writeIntBinary(this->data(place).last_ts, buf); - writePODBinary(this->data(place).seen, buf); + writeBinaryLittleEndian(this->data(place).sum, buf); + writeBinaryLittleEndian(this->data(place).first, buf); + writeBinaryLittleEndian(this->data(place).first_ts, buf); + writeBinaryLittleEndian(this->data(place).last, buf); + writeBinaryLittleEndian(this->data(place).last_ts, buf); + writeBinaryLittleEndian(this->data(place).seen, buf); } void deserialize(AggregateDataPtr __restrict place, ReadBuffer & buf, std::optional /* version */, Arena *) const override { - readIntBinary(this->data(place).sum, buf); - readIntBinary(this->data(place).first, buf); - readIntBinary(this->data(place).first_ts, buf); - readIntBinary(this->data(place).last, buf); - readIntBinary(this->data(place).last_ts, buf); - readPODBinary(this->data(place).seen, buf); + readBinaryLittleEndian(this->data(place).sum, buf); + readBinaryLittleEndian(this->data(place).first, buf); + readBinaryLittleEndian(this->data(place).first_ts, buf); + readBinaryLittleEndian(this->data(place).last, buf); + readBinaryLittleEndian(this->data(place).last_ts, buf); + readBinaryLittleEndian(this->data(place).seen, buf); } void insertResultInto(AggregateDataPtr __restrict place, IColumn & to, Arena *) const override diff --git a/src/AggregateFunctions/QuantileApprox.h b/src/AggregateFunctions/QuantileApprox.h index f58f1396fb4..6b2a6cf4398 100644 --- a/src/AggregateFunctions/QuantileApprox.h +++ b/src/AggregateFunctions/QuantileApprox.h @@ -233,35 +233,35 @@ public: void write(WriteBuffer & buf) const { - writeIntBinary(compress_threshold, buf); - writeFloatBinary(relative_error, buf); - writeIntBinary(count, buf); - writeIntBinary(sampled.size(), buf); + writeBinaryLittleEndian(compress_threshold, buf); + writeBinaryLittleEndian(relative_error, buf); + writeBinaryLittleEndian(count, buf); + writeBinaryLittleEndian(sampled.size(), buf); for (const auto & stats : sampled) { - writeFloatBinary(stats.value, buf); - writeIntBinary(stats.g, buf); - writeIntBinary(stats.delta, buf); + writeBinaryLittleEndian(stats.value, buf); + writeBinaryLittleEndian(stats.g, buf); + writeBinaryLittleEndian(stats.delta, buf); } } void read(ReadBuffer & buf) { - readIntBinary(compress_threshold, buf); - readFloatBinary(relative_error, buf); - readIntBinary(count, buf); + readBinaryLittleEndian(compress_threshold, buf); + readBinaryLittleEndian(relative_error, buf); + readBinaryLittleEndian(count, buf); size_t sampled_len = 0; - readIntBinary(sampled_len, buf); + readBinaryLittleEndian(sampled_len, buf); sampled.resize(sampled_len); for (size_t i = 0; i < sampled_len; ++i) { auto stats = sampled[i]; - readFloatBinary(stats.value, buf); - readIntBinary(stats.g, buf); - readIntBinary(stats.delta, buf); + readBinaryLittleEndian(stats.value, buf); + readBinaryLittleEndian(stats.g, buf); + readBinaryLittleEndian(stats.delta, buf); } } diff --git a/src/AggregateFunctions/ReservoirSampler.h b/src/AggregateFunctions/ReservoirSampler.h index 3d723d5aace..7409a3fa0dd 100644 --- a/src/AggregateFunctions/ReservoirSampler.h +++ b/src/AggregateFunctions/ReservoirSampler.h @@ -207,8 +207,8 @@ public: void read(DB::ReadBuffer & buf) { - DB::readIntBinary(sample_count, buf); - DB::readIntBinary(total_values, buf); + DB::readBinaryLittleEndian(sample_count, buf); + DB::readBinaryLittleEndian(total_values, buf); size_t size = std::min(total_values, sample_count); static constexpr size_t MAX_RESERVOIR_SIZE = 1_GiB; @@ -224,22 +224,22 @@ public: rng_buf >> rng; for (size_t i = 0; i < samples.size(); ++i) - DB::readBinary(samples[i], buf); + DB::readBinaryLittleEndian(samples[i], buf); sorted = false; } void write(DB::WriteBuffer & buf) const { - DB::writeIntBinary(sample_count, buf); - DB::writeIntBinary(total_values, buf); + DB::writeBinaryLittleEndian(sample_count, buf); + DB::writeBinaryLittleEndian(total_values, buf); DB::WriteBufferFromOwnString rng_buf; rng_buf << rng; DB::writeStringBinary(rng_buf.str(), buf); for (size_t i = 0; i < std::min(sample_count, total_values); ++i) - DB::writeBinary(samples[i], buf); + DB::writeBinaryLittleEndian(samples[i], buf); } private: diff --git a/src/Common/TransformEndianness.hpp b/src/Common/TransformEndianness.hpp index 4d690d75d9e..0a9055dde15 100644 --- a/src/Common/TransformEndianness.hpp +++ b/src/Common/TransformEndianness.hpp @@ -59,4 +59,10 @@ inline void transformEndianness(std::pair & pair) transformEndianness(pair.first); transformEndianness(pair.second); } + +template +inline void transformEndianness(StrongTypedef & x) +{ + transformEndianness(x.toUnderType()); +} } From 299149b68207294b5347ed1c2bcf82b68bfda9c8 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 17 Jul 2023 01:49:43 +0200 Subject: [PATCH 48/63] Fix slow test 02317_distinct_in_order_optimization --- .../02317_distinct_in_order_optimization.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/queries/0_stateless/02317_distinct_in_order_optimization.sql b/tests/queries/0_stateless/02317_distinct_in_order_optimization.sql index a794709caba..d05a25882a7 100644 --- a/tests/queries/0_stateless/02317_distinct_in_order_optimization.sql +++ b/tests/queries/0_stateless/02317_distinct_in_order_optimization.sql @@ -18,7 +18,7 @@ select distinct a from distinct_in_order settings max_block_size=10, max_threads select '-- create table with not only primary key columns'; drop table if exists distinct_in_order sync; -create table distinct_in_order (a int, b int, c int) engine=MergeTree() order by (a, b); +create table distinct_in_order (a int, b int, c int) engine=MergeTree() order by (a, b) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into distinct_in_order select number % number, number % 5, number % 10 from numbers(1,1000000); select '-- distinct with primary key prefix only'; @@ -59,16 +59,16 @@ drop table if exists distinct_in_order sync; select '-- check that distinct in order returns the same result as ordinary distinct'; drop table if exists distinct_cardinality_low sync; -CREATE TABLE distinct_cardinality_low (low UInt64, medium UInt64, high UInt64) ENGINE MergeTree() ORDER BY (low, medium); +CREATE TABLE distinct_cardinality_low (low UInt64, medium UInt64, high UInt64) ENGINE MergeTree() ORDER BY (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; INSERT INTO distinct_cardinality_low SELECT number % 1e1, number % 1e2, number % 1e3 FROM numbers_mt(1e4); drop table if exists distinct_in_order sync; drop table if exists ordinary_distinct sync; select '-- check that distinct in order WITH order by returns the same result as ordinary distinct'; -create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into distinct_in_order select distinct * from distinct_cardinality_low order by high settings optimize_distinct_in_order=1; -create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into ordinary_distinct select distinct * from distinct_cardinality_low order by high settings optimize_distinct_in_order=0; select count() as diff from (select distinct * from distinct_in_order except select * from ordinary_distinct); @@ -76,9 +76,9 @@ drop table if exists distinct_in_order sync; drop table if exists ordinary_distinct sync; select '-- check that distinct in order WITHOUT order by returns the same result as ordinary distinct'; -create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into distinct_in_order select distinct * from distinct_cardinality_low settings optimize_distinct_in_order=1; -create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into ordinary_distinct select distinct * from distinct_cardinality_low settings optimize_distinct_in_order=0; select count() as diff from (select distinct * from distinct_in_order except select * from ordinary_distinct); @@ -86,9 +86,9 @@ drop table if exists distinct_in_order; drop table if exists ordinary_distinct; select '-- check that distinct in order WITHOUT order by and WITH filter returns the same result as ordinary distinct'; -create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table distinct_in_order (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into distinct_in_order select distinct * from distinct_cardinality_low where low > 0 settings optimize_distinct_in_order=1; -create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium); +create table ordinary_distinct (low UInt64, medium UInt64, high UInt64) engine=MergeTree() order by (low, medium) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into ordinary_distinct select distinct * from distinct_cardinality_low where low > 0 settings optimize_distinct_in_order=0; select count() as diff from (select distinct * from distinct_in_order except select * from ordinary_distinct); @@ -102,12 +102,12 @@ drop table if exists sorting_key_contain_function; select '-- bug 42185, distinct in order and empty sort description'; select '-- distinct in order, sorting key tuple()'; -create table sorting_key_empty_tuple (a int, b int) engine=MergeTree() order by tuple(); +create table sorting_key_empty_tuple (a int, b int) engine=MergeTree() order by tuple() SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into sorting_key_empty_tuple select number % 2, number % 5 from numbers(1,10); select distinct a from sorting_key_empty_tuple; select '-- distinct in order, sorting key contains function'; -create table sorting_key_contain_function (datetime DateTime, a int) engine=MergeTree() order by (toDate(datetime)); +create table sorting_key_contain_function (datetime DateTime, a int) engine=MergeTree() order by (toDate(datetime)) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi'; insert into sorting_key_contain_function values ('2000-01-01', 1); insert into sorting_key_contain_function values ('2000-01-01', 2); select distinct datetime from sorting_key_contain_function; From 1cebf03cabd591adfd5cd9df600fbaae42551b21 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 17 Jul 2023 10:41:18 +0800 Subject: [PATCH 49/63] add length alias --- src/Functions/array/length.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Functions/array/length.cpp b/src/Functions/array/length.cpp index f09ad17892b..91a5e5fdec2 100644 --- a/src/Functions/array/length.cpp +++ b/src/Functions/array/length.cpp @@ -101,6 +101,7 @@ It is ok to have ASCII NUL bytes in strings, and they will be counted as well. .categories{"String", "Array"} }, FunctionFactory::CaseInsensitive); + factory.registerAlias("OCTET_LENGTH", "length", FunctionFactory::CaseInsensitive); } } From 0cdb1d1466367c355660ff4b217e41d605b39dcf Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 17 Jul 2023 10:52:05 +0800 Subject: [PATCH 50/63] add docs --- docs/en/sql-reference/functions/array-functions.md | 2 ++ docs/en/sql-reference/functions/string-functions.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/en/sql-reference/functions/array-functions.md b/docs/en/sql-reference/functions/array-functions.md index 7f2b8f3c605..7aeb1af8f6b 100644 --- a/docs/en/sql-reference/functions/array-functions.md +++ b/docs/en/sql-reference/functions/array-functions.md @@ -102,6 +102,8 @@ The function also works for strings. Can be optimized by enabling the [optimize_functions_to_subcolumns](../../operations/settings/settings.md#optimize-functions-to-subcolumns) setting. With `optimize_functions_to_subcolumns = 1` the function reads only [size0](../../sql-reference/data-types/array.md#array-size) subcolumn instead of reading and processing the whole array column. The query `SELECT length(arr) FROM table` transforms to `SELECT arr.size0 FROM TABLE`. +Alias: `OCTET_LENGTH` + ## emptyArrayUInt8, emptyArrayUInt16, emptyArrayUInt32, emptyArrayUInt64 ## emptyArrayInt8, emptyArrayInt16, emptyArrayInt32, emptyArrayInt64 diff --git a/docs/en/sql-reference/functions/string-functions.md b/docs/en/sql-reference/functions/string-functions.md index 5175bbf0615..28dcf1c6b77 100644 --- a/docs/en/sql-reference/functions/string-functions.md +++ b/docs/en/sql-reference/functions/string-functions.md @@ -90,6 +90,8 @@ Returns the length of a string in bytes (not: in characters or Unicode code poin The function also works for arrays. +Alias: `OCTET_LENGTH` + ## lengthUTF8 Returns the length of a string in Unicode code points (not: in bytes or characters). It assumes that the string contains valid UTF-8 encoded text. If this assumption is violated, no exception is thrown and the result is undefined. From ebfc9c25f7e22bce3dc78ee5195799ea2c0ca3d8 Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 17 Jul 2023 10:59:40 +0800 Subject: [PATCH 51/63] add test --- tests/queries/0_stateless/02815_alias_to_length.reference | 2 ++ tests/queries/0_stateless/02815_alias_to_length.sql | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/queries/0_stateless/02815_alias_to_length.reference create mode 100644 tests/queries/0_stateless/02815_alias_to_length.sql diff --git a/tests/queries/0_stateless/02815_alias_to_length.reference b/tests/queries/0_stateless/02815_alias_to_length.reference new file mode 100644 index 00000000000..7290ba859f4 --- /dev/null +++ b/tests/queries/0_stateless/02815_alias_to_length.reference @@ -0,0 +1,2 @@ +4 +4 diff --git a/tests/queries/0_stateless/02815_alias_to_length.sql b/tests/queries/0_stateless/02815_alias_to_length.sql new file mode 100644 index 00000000000..531bb92f8f0 --- /dev/null +++ b/tests/queries/0_stateless/02815_alias_to_length.sql @@ -0,0 +1,2 @@ +SELECT OCTET_LENGTH([1,2,3,4]); +SELECT OCTET_LENGTH('1234'); From 3df812f4f03fa8149a009cad3f6735d8d702627e Mon Sep 17 00:00:00 2001 From: FFFFFFFHHHHHHH <916677625@qq.com> Date: Mon, 17 Jul 2023 11:18:30 +0800 Subject: [PATCH 52/63] fix --- tests/queries/0_stateless/02815_alias_to_length.reference | 2 ++ tests/queries/0_stateless/02815_alias_to_length.sql | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02815_alias_to_length.reference b/tests/queries/0_stateless/02815_alias_to_length.reference index 7290ba859f4..de958a364ef 100644 --- a/tests/queries/0_stateless/02815_alias_to_length.reference +++ b/tests/queries/0_stateless/02815_alias_to_length.reference @@ -1,2 +1,4 @@ 4 4 +15 +4 diff --git a/tests/queries/0_stateless/02815_alias_to_length.sql b/tests/queries/0_stateless/02815_alias_to_length.sql index 531bb92f8f0..780ac7dac6d 100644 --- a/tests/queries/0_stateless/02815_alias_to_length.sql +++ b/tests/queries/0_stateless/02815_alias_to_length.sql @@ -1,2 +1,6 @@ -SELECT OCTET_LENGTH([1,2,3,4]); SELECT OCTET_LENGTH('1234'); +SELECT OcTet_lenGtH('1234'); +SELECT OCTET_LENGTH('你好,世界'); + +-- This is a implementation-specific behavior of getting the length of an array. +SELECT OCTET_LENGTH([1,2,3,4]); From dfc1cc13c8bb58fbb224e5ed0651fcdb3c10c36d Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Mon, 17 Jul 2023 08:54:55 +0000 Subject: [PATCH 53/63] Better oldest part selection --- tests/integration/test_multiple_disks/test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_multiple_disks/test.py b/tests/integration/test_multiple_disks/test.py index 5561d63840b..bc7ac6683af 100644 --- a/tests/integration/test_multiple_disks/test.py +++ b/tests/integration/test_multiple_disks/test.py @@ -818,9 +818,10 @@ def test_start_stop_moves(start_cluster, name, engine): node1.query(f"SYSTEM STOP MOVES {name}") node1.query(f"SYSTEM STOP MERGES {name}") + first_part = None for i in range(5): data = [] # 5MB in total - for i in range(5): + for _ in range(5): data.append(get_random_string(1024 * 1024)) # 1MB row # jbod size is 40MB, so lets insert 5MB batch 7 times node1.query_with_retry( @@ -829,7 +830,13 @@ def test_start_stop_moves(start_cluster, name, engine): ) ) - first_part = get_oldest_part(node1, name) + # we cannot rely simply on modification time of part because it can be changed + # by different background operations so we explicitly check after the first + # part is inserted + if i == 0: + first_part = get_oldest_part(node1, name) + + assert first_part is not None used_disks = get_used_disks_for_table(node1, name) From 10c15a6548a27bbb51eb04082a11fd110a4642a5 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 10:33:09 +0000 Subject: [PATCH 54/63] Refactor limit_jobs.cmake --- cmake/limit_jobs.cmake | 53 ++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index 3a33b3b9989..b2a54fb8d1a 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -1,16 +1,14 @@ -# Usage: -# set (MAX_COMPILER_MEMORY 2000 CACHE INTERNAL "") # In megabytes -# set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "") +# Usage from CMake: +# set (MAX_COMPILER_MEMORY 2000 CACHE INTERNAL "") # megabyte +# set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "") # megabyte # include (cmake/limit_jobs.cmake) cmake_host_system_information(RESULT TOTAL_PHYSICAL_MEMORY QUERY TOTAL_PHYSICAL_MEMORY) # Not available under freebsd cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) -# 1 if not set -option(PARALLEL_COMPILE_JOBS "Maximum number of concurrent compilation jobs" "") - -# 1 if not set -option(PARALLEL_LINK_JOBS "Maximum number of concurrent link jobs" "") +# Set to disable the automatic job-limiting +option(PARALLEL_COMPILE_JOBS "Maximum number of concurrent compilation jobs" OFF) +option(PARALLEL_LINK_JOBS "Maximum number of concurrent link jobs" OFF) if (NOT PARALLEL_COMPILE_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_COMPILER_MEMORY) math(EXPR PARALLEL_COMPILE_JOBS ${TOTAL_PHYSICAL_MEMORY}/${MAX_COMPILER_MEMORY}) @@ -19,17 +17,10 @@ if (NOT PARALLEL_COMPILE_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_COMPILER_MEMORY) set (PARALLEL_COMPILE_JOBS 1) endif () if (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) - set (PARALLEL_COMPILE_JOBS_LESS TRUE) + set (PARALLEL_COMPILE_JOBS_UNDERUTILIZING TRUE) endif() endif () -if (PARALLEL_COMPILE_JOBS AND (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) - set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) - string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_COMPILE ${CMAKE_JOB_POOL_COMPILE}) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_COMPILE}=${PARALLEL_COMPILE_JOBS}) -endif () - - if (NOT PARALLEL_LINK_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_LINKER_MEMORY) math(EXPR PARALLEL_LINK_JOBS ${TOTAL_PHYSICAL_MEMORY}/${MAX_LINKER_MEMORY}) @@ -37,7 +28,7 @@ if (NOT PARALLEL_LINK_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_LINKER_MEMORY) set (PARALLEL_LINK_JOBS 1) endif () if (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) - set (PARALLEL_LINK_JOBS_LESS TRUE) + set (PARALLEL_LINK_JOBS_UNDERUTILIZING TRUE) endif() endif () @@ -52,20 +43,26 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" AND ENABLE_THINLTO AND PARALLE set (PARALLEL_LINK_JOBS 2) endif() +message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_COMPILE_JOBS} linker jobs.") + +if (PARALLEL_COMPILE_JOBS OR PARALLEL_LINK_JOBS) + if (PARALLEL_COMPILE_JOBS_UNDERUTILIZING) + message(WARNING "The autocalculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") + endif() + if (PARALLEL_LINK_JOBS_UNDERUTILIZING) + message(WARNING "The autocalculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") + endif() +endif () + +if (PARALLEL_COMPILE_JOBS AND (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) + set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) + string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_COMPILE ${CMAKE_JOB_POOL_COMPILE}) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_COMPILE}=${PARALLEL_COMPILE_JOBS}) +endif () + if (PARALLEL_LINK_JOBS AND (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES)) set(CMAKE_JOB_POOL_LINK link_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_LINK ${CMAKE_JOB_POOL_LINK}) set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_LINK}=${PARALLEL_LINK_JOBS}) endif () -if (PARALLEL_COMPILE_JOBS OR PARALLEL_LINK_JOBS) - message(STATUS - "${CMAKE_CURRENT_SOURCE_DIR}: Have ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. - Limiting concurrent linkers jobs to ${PARALLEL_LINK_JOBS} and compiler jobs to ${PARALLEL_COMPILE_JOBS} (system has ${NUMBER_OF_LOGICAL_CORES} logical cores)") - if (PARALLEL_COMPILE_JOBS_LESS) - message(WARNING "The autocalculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") - endif() - if (PARALLEL_LINK_JOBS_LESS) - message(WARNING "The autocalculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") - endif() -endif () From 7204f7054788302e37be3e79ddd3a0ff87b93f01 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 11:52:00 +0000 Subject: [PATCH 55/63] cmake_host_system_information provides TOTAL_PHYSICAL_MEMORY on all platforms, including FreeBSD --- cmake/limit_jobs.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index b2a54fb8d1a..2ca9e5519d7 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -3,14 +3,14 @@ # set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "") # megabyte # include (cmake/limit_jobs.cmake) -cmake_host_system_information(RESULT TOTAL_PHYSICAL_MEMORY QUERY TOTAL_PHYSICAL_MEMORY) # Not available under freebsd +cmake_host_system_information(RESULT TOTAL_PHYSICAL_MEMORY QUERY TOTAL_PHYSICAL_MEMORY) cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) # Set to disable the automatic job-limiting option(PARALLEL_COMPILE_JOBS "Maximum number of concurrent compilation jobs" OFF) option(PARALLEL_LINK_JOBS "Maximum number of concurrent link jobs" OFF) -if (NOT PARALLEL_COMPILE_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_COMPILER_MEMORY) +if (NOT PARALLEL_COMPILE_JOBS AND MAX_COMPILER_MEMORY) math(EXPR PARALLEL_COMPILE_JOBS ${TOTAL_PHYSICAL_MEMORY}/${MAX_COMPILER_MEMORY}) if (NOT PARALLEL_COMPILE_JOBS) @@ -21,7 +21,7 @@ if (NOT PARALLEL_COMPILE_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_COMPILER_MEMORY) endif() endif () -if (NOT PARALLEL_LINK_JOBS AND TOTAL_PHYSICAL_MEMORY AND MAX_LINKER_MEMORY) +if (NOT PARALLEL_LINK_JOBS AND MAX_LINKER_MEMORY) math(EXPR PARALLEL_LINK_JOBS ${TOTAL_PHYSICAL_MEMORY}/${MAX_LINKER_MEMORY}) if (NOT PARALLEL_LINK_JOBS) From 8f1e56167c430783841abca00dd16c217cfcec13 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 11:53:12 +0000 Subject: [PATCH 56/63] NUMBER_OF_TOTAL_CORES is on all platforms != 0 --- cmake/limit_jobs.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index 2ca9e5519d7..b145c069e37 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -16,7 +16,7 @@ if (NOT PARALLEL_COMPILE_JOBS AND MAX_COMPILER_MEMORY) if (NOT PARALLEL_COMPILE_JOBS) set (PARALLEL_COMPILE_JOBS 1) endif () - if (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) + if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) set (PARALLEL_COMPILE_JOBS_UNDERUTILIZING TRUE) endif() endif () @@ -27,7 +27,7 @@ if (NOT PARALLEL_LINK_JOBS AND MAX_LINKER_MEMORY) if (NOT PARALLEL_LINK_JOBS) set (PARALLEL_LINK_JOBS 1) endif () - if (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) + if (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) set (PARALLEL_LINK_JOBS_UNDERUTILIZING TRUE) endif() endif () @@ -54,13 +54,13 @@ if (PARALLEL_COMPILE_JOBS OR PARALLEL_LINK_JOBS) endif() endif () -if (PARALLEL_COMPILE_JOBS AND (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) +if (PARALLEL_COMPILE_JOBS AND (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_COMPILE ${CMAKE_JOB_POOL_COMPILE}) set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_COMPILE}=${PARALLEL_COMPILE_JOBS}) endif () -if (PARALLEL_LINK_JOBS AND (NOT NUMBER_OF_LOGICAL_CORES OR PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES)) +if (PARALLEL_LINK_JOBS AND (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES)) set(CMAKE_JOB_POOL_LINK link_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_LINK ${CMAKE_JOB_POOL_LINK}) set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_LINK}=${PARALLEL_LINK_JOBS}) From 96c399ff7b623cbebcf7a8e1ae036df5b0f57767 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 11:58:18 +0000 Subject: [PATCH 57/63] Simplify a bit further --- cmake/limit_jobs.cmake | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index b145c069e37..b7cc5cf0967 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -17,7 +17,7 @@ if (NOT PARALLEL_COMPILE_JOBS AND MAX_COMPILER_MEMORY) set (PARALLEL_COMPILE_JOBS 1) endif () if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) - set (PARALLEL_COMPILE_JOBS_UNDERUTILIZING TRUE) + message(WARNING "The autocalculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") endif() endif () @@ -28,7 +28,7 @@ if (NOT PARALLEL_LINK_JOBS AND MAX_LINKER_MEMORY) set (PARALLEL_LINK_JOBS 1) endif () if (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) - set (PARALLEL_LINK_JOBS_UNDERUTILIZING TRUE) + message(WARNING "The autocalculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") endif() endif () @@ -45,15 +45,6 @@ endif() message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_COMPILE_JOBS} linker jobs.") -if (PARALLEL_COMPILE_JOBS OR PARALLEL_LINK_JOBS) - if (PARALLEL_COMPILE_JOBS_UNDERUTILIZING) - message(WARNING "The autocalculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") - endif() - if (PARALLEL_LINK_JOBS_UNDERUTILIZING) - message(WARNING "The autocalculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") - endif() -endif () - if (PARALLEL_COMPILE_JOBS AND (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_COMPILE ${CMAKE_JOB_POOL_COMPILE}) From 152f5527a906d048df2e727e3e592735f8844508 Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Mon, 17 Jul 2023 11:58:22 +0000 Subject: [PATCH 58/63] Remove wrong assert --- tests/integration/ci-runner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/ci-runner.py b/tests/integration/ci-runner.py index 9629a5821b5..31f4a7666c8 100755 --- a/tests/integration/ci-runner.py +++ b/tests/integration/ci-runner.py @@ -810,7 +810,6 @@ class ClickhouseIntegrationTestsRunner: result_state = "failure" if not should_fail: break - assert should_fail logging.info("Try is OK, all tests passed, going to clear env") clear_ip_tables_and_restart_daemons() logging.info("And going to sleep for some time") From a2e63404b3ffc9a1a9a5e6380918ab4c033e55a2 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 12:01:17 +0000 Subject: [PATCH 59/63] Further simplify logic --- cmake/limit_jobs.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index b7cc5cf0967..4d81619aa13 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -45,15 +45,14 @@ endif() message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_COMPILE_JOBS} linker jobs.") -if (PARALLEL_COMPILE_JOBS AND (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES)) +if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_COMPILE ${CMAKE_JOB_POOL_COMPILE}) set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_COMPILE}=${PARALLEL_COMPILE_JOBS}) endif () -if (PARALLEL_LINK_JOBS AND (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES)) +if (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) set(CMAKE_JOB_POOL_LINK link_job_pool${CMAKE_CURRENT_SOURCE_DIR}) string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" CMAKE_JOB_POOL_LINK ${CMAKE_JOB_POOL_LINK}) set_property(GLOBAL APPEND PROPERTY JOB_POOLS ${CMAKE_JOB_POOL_LINK}=${PARALLEL_LINK_JOBS}) endif () - From 8f8cb5eb8289af1f720b976158da364227619250 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 15:48:12 +0200 Subject: [PATCH 60/63] Update cmake/limit_jobs.cmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: János Benjamin Antal --- cmake/limit_jobs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index 4d81619aa13..39a6f688488 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -43,7 +43,7 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" AND ENABLE_THINLTO AND PARALLE set (PARALLEL_LINK_JOBS 2) endif() -message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_COMPILE_JOBS} linker jobs.") +message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_LINK_JOBS} linker jobs.") if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR}) From 9a30aaa9aa1924d35d79806fb2090570e0d9df49 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Mon, 17 Jul 2023 16:14:58 +0200 Subject: [PATCH 61/63] Revert "Fixed several issues found by OSS-Fuzz" --- ..._function_state_deserialization_fuzzer.cpp | 1 - .../fuzzers/delta_decompress_fuzzer.cpp | 2 +- .../double_delta_decompress_fuzzer.cpp | 2 +- .../fuzzers/encrypted_decompress_fuzzer.cpp | 4 +- .../fuzzers/lz4_decompress_fuzzer.cpp | 4 +- src/Core/Field.h | 66 +------------------ src/DataTypes/DataTypeFactory.cpp | 2 +- src/Functions/DateTimeTransforms.h | 4 +- .../fuzzers/codegen_fuzzer/CMakeLists.txt | 2 +- 9 files changed, 10 insertions(+), 77 deletions(-) diff --git a/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp b/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp index 3db1afb7a92..2ea01e1d5bc 100644 --- a/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp +++ b/src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp @@ -8,7 +8,6 @@ #include #include -#include #include diff --git a/src/Compression/fuzzers/delta_decompress_fuzzer.cpp b/src/Compression/fuzzers/delta_decompress_fuzzer.cpp index 451606843e2..b039777da15 100644 --- a/src/Compression/fuzzers/delta_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/delta_decompress_fuzzer.cpp @@ -34,7 +34,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + codec->getAdditionalSizeAtTheEndOfBuffer()); - codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); + codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); return 0; } diff --git a/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp b/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp index f7e685d68ad..f9822daa3bd 100644 --- a/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/double_delta_decompress_fuzzer.cpp @@ -34,7 +34,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + codec->getAdditionalSizeAtTheEndOfBuffer()); - codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); + codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); return 0; } diff --git a/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp b/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp index 207cce21e3b..3e3d0e164fe 100644 --- a/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/encrypted_decompress_fuzzer.cpp @@ -292,10 +292,10 @@ try DB::Memory<> memory; memory.resize(input.size() + codec_128->getAdditionalSizeAtTheEndOfBuffer()); - codec_128->doDecompressData(input.data(), static_cast(input.size()), memory.data(), static_cast(input.size() - 31)); + codec_128->doDecompressData(input.data(), input.size(), memory.data(), input.size() - 31); memory.resize(input.size() + codec_128->getAdditionalSizeAtTheEndOfBuffer()); - codec_256->doDecompressData(input.data(), static_cast(input.size()), memory.data(), static_cast(input.size() - 31)); + codec_256->doDecompressData(input.data(), input.size(), memory.data(), input.size() - 31); return 0; } catch (...) diff --git a/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp b/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp index f6d4c51f18b..85c4c9bd329 100644 --- a/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp +++ b/src/Compression/fuzzers/lz4_decompress_fuzzer.cpp @@ -24,7 +24,7 @@ try return 0; const auto * p = reinterpret_cast(data); - auto codec = DB::getCompressionCodecLZ4(static_cast(p->level)); + auto codec = DB::getCompressionCodecLZ4(p->level); size_t output_buffer_size = p->decompressed_size % 65536; size -= sizeof(AuxiliaryRandomData); @@ -37,7 +37,7 @@ try DB::Memory<> memory; memory.resize(output_buffer_size + LZ4::ADDITIONAL_BYTES_AT_END_OF_BUFFER); - codec->doDecompressData(reinterpret_cast(data), static_cast(size), memory.data(), static_cast(output_buffer_size)); + codec->doDecompressData(reinterpret_cast(data), size, memory.data(), output_buffer_size); return 0; } diff --git a/src/Core/Field.h b/src/Core/Field.h index cc0083e02d8..ef1bd9a895d 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -28,7 +28,6 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int LOGICAL_ERROR; extern const int ILLEGAL_TYPE_OF_ARGUMENT; - extern const int TOO_DEEP_RECURSION; } constexpr Null NEGATIVE_INFINITY{Null::Value::NegativeInfinity}; @@ -42,13 +41,10 @@ using FieldVector = std::vector>; /// construct a Field of Array or a Tuple type. An alternative approach would be /// to construct both of these types from FieldVector, and have the caller /// specify the desired Field type explicitly. -/// As the result stack overflow on destruction is possible -/// and to avoid it we need to count the depth and have a threshold. #define DEFINE_FIELD_VECTOR(X) \ struct X : public FieldVector \ { \ using FieldVector::FieldVector; \ - uint8_t nested_field_depth = 0; \ } DEFINE_FIELD_VECTOR(Array); @@ -65,7 +61,6 @@ using FieldMap = std::map, AllocatorWithMemoryTrackin struct X : public FieldMap \ { \ using FieldMap::FieldMap; \ - uint8_t nested_field_depth = 0; \ } DEFINE_FIELD_MAP(Object); @@ -296,12 +291,6 @@ decltype(auto) castToNearestFieldType(T && x) */ #define DBMS_MIN_FIELD_SIZE 32 -/// Note: uint8_t is used for storing depth value. -#if defined(SANITIZER) || !defined(NDEBUG) - #define DBMS_MAX_NESTED_FIELD_DEPTH 64 -#else - #define DBMS_MAX_NESTED_FIELD_DEPTH 255 -#endif /** Discriminated union of several types. * Made for replacement of `boost::variant` @@ -682,49 +671,6 @@ private: Types::Which which; - /// StorageType and Original are the same for Array, Tuple, Map, Object - template - uint8_t calculateAndCheckFieldDepth(Original && x) - { - uint8_t result = 0; - - if constexpr (std::is_same_v - || std::is_same_v - || std::is_same_v - || std::is_same_v) - { - result = x.nested_field_depth; - - auto get_depth = [](const Field & elem) - { - switch (elem.which) - { - case Types::Array: - return elem.template get().nested_field_depth; - case Types::Tuple: - return elem.template get().nested_field_depth; - case Types::Map: - return elem.template get().nested_field_depth; - case Types::Object: - return elem.template get().nested_field_depth; - default: - return static_cast(0); - } - }; - - if constexpr (std::is_same_v) - for (auto & [_, value] : x) - result = std::max(get_depth(value), result); - else - for (auto & value : x) - result = std::max(get_depth(value), result); - } - - if (result >= DBMS_MAX_NESTED_FIELD_DEPTH) - throw Exception(ErrorCodes::TOO_DEEP_RECURSION, "Too deep Field"); - - return result; - } /// Assuming there was no allocated state or it was deallocated (see destroy). template @@ -738,17 +684,7 @@ private: // we must initialize the entire wide stored type, and not just the // nominal type. using StorageType = NearestFieldType; - - /// Incrementing the depth since we create a new Field. - auto depth = calculateAndCheckFieldDepth(x); new (&storage) StorageType(std::forward(x)); - - if constexpr (std::is_same_v - || std::is_same_v - || std::is_same_v - || std::is_same_v) - reinterpret_cast(&storage)->nested_field_depth = depth + 1; - which = TypeToEnum::value; } @@ -845,7 +781,7 @@ private: } template - ALWAYS_INLINE void destroy() + void destroy() { T * MAY_ALIAS ptr = reinterpret_cast(&storage); ptr->~T(); diff --git a/src/DataTypes/DataTypeFactory.cpp b/src/DataTypes/DataTypeFactory.cpp index 89dacae59ff..415f24d8151 100644 --- a/src/DataTypes/DataTypeFactory.cpp +++ b/src/DataTypes/DataTypeFactory.cpp @@ -62,7 +62,7 @@ DataTypePtr DataTypeFactory::getImpl(const String & full_name) const } else { - ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", DBMS_DEFAULT_MAX_QUERY_SIZE, data_type_max_parse_depth); + ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", false, data_type_max_parse_depth); } return getImpl(ast); diff --git a/src/Functions/DateTimeTransforms.h b/src/Functions/DateTimeTransforms.h index 0d71e802bf0..510a88db2b6 100644 --- a/src/Functions/DateTimeTransforms.h +++ b/src/Functions/DateTimeTransforms.h @@ -1521,10 +1521,8 @@ struct Transformer if constexpr (std::is_same_v || std::is_same_v) { -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion" bool is_valid_input = vec_from[i] >= 0 && vec_from[i] <= 0xFFFFFFFFL; -# pragma clang diagnostic pop + if (!is_valid_input) { if constexpr (std::is_same_v) diff --git a/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt b/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt index 30f0e91a75b..727c49cfc4d 100644 --- a/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt +++ b/src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt @@ -42,4 +42,4 @@ clickhouse_add_executable(codegen_select_fuzzer ${FUZZER_SRCS}) set_source_files_properties("${PROTO_SRCS}" "out.cpp" PROPERTIES COMPILE_FLAGS "-Wno-reserved-identifier") target_include_directories(codegen_select_fuzzer SYSTEM BEFORE PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") -target_link_libraries(codegen_select_fuzzer PRIVATE ch_contrib::protobuf ch_contrib::protobuf_mutator ch_contrib::protoc dbms ${LIB_FUZZING_ENGINE}) +target_link_libraries(codegen_select_fuzzer PRIVATE ch_contrib::protobuf_mutator ch_contrib::protoc dbms ${LIB_FUZZING_ENGINE}) From 2a2ebb1f318ce665885ac2c5f711d6a29fbed582 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Mon, 17 Jul 2023 14:26:11 +0000 Subject: [PATCH 62/63] Bump From 1dbc88630d56f2b815c2c5746f6706d2ff76a6bc Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Mon, 17 Jul 2023 17:09:13 +0000 Subject: [PATCH 63/63] Cosmetics --- cmake/limit_jobs.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index 39a6f688488..acc38b6fa2a 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -1,7 +1,11 @@ +# Limit compiler/linker job concurrency to avoid OOMs on subtrees where compilation/linking is memory-intensive. +# # Usage from CMake: -# set (MAX_COMPILER_MEMORY 2000 CACHE INTERNAL "") # megabyte -# set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "") # megabyte -# include (cmake/limit_jobs.cmake) +# set (MAX_COMPILER_MEMORY 2000 CACHE INTERNAL "") # megabyte +# set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "") # megabyte +# include (cmake/limit_jobs.cmake) +# +# (bigger values mean fewer jobs) cmake_host_system_information(RESULT TOTAL_PHYSICAL_MEMORY QUERY TOTAL_PHYSICAL_MEMORY) cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) @@ -17,7 +21,7 @@ if (NOT PARALLEL_COMPILE_JOBS AND MAX_COMPILER_MEMORY) set (PARALLEL_COMPILE_JOBS 1) endif () if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) - message(WARNING "The autocalculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") + message(WARNING "The auto-calculated compile jobs limit (${PARALLEL_COMPILE_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_COMPILE_JOBS to override.") endif() endif () @@ -28,7 +32,7 @@ if (NOT PARALLEL_LINK_JOBS AND MAX_LINKER_MEMORY) set (PARALLEL_LINK_JOBS 1) endif () if (PARALLEL_LINK_JOBS LESS NUMBER_OF_LOGICAL_CORES) - message(WARNING "The autocalculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") + message(WARNING "The auto-calculated link jobs limit (${PARALLEL_LINK_JOBS}) underutilizes CPU cores (${NUMBER_OF_LOGICAL_CORES}). Set PARALLEL_LINK_JOBS to override.") endif() endif () @@ -43,7 +47,7 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" AND ENABLE_THINLTO AND PARALLE set (PARALLEL_LINK_JOBS 2) endif() -message(STATUS "System has ${NUMBER_OF_LOGICAL_CORES} logical cores and ${TOTAL_PHYSICAL_MEMORY} megabytes of memory. Building with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_LINK_JOBS} linker jobs.") +message(STATUS "Building sub-tree with ${PARALLEL_COMPILE_JOBS} compile jobs and ${PARALLEL_LINK_JOBS} linker jobs (system: ${NUMBER_OF_LOGICAL_CORES} cores, ${TOTAL_PHYSICAL_MEMORY} MB DRAM, 'OFF' means the native core count).") if (PARALLEL_COMPILE_JOBS LESS NUMBER_OF_LOGICAL_CORES) set(CMAKE_JOB_POOL_COMPILE compile_job_pool${CMAKE_CURRENT_SOURCE_DIR})