diff options
author | AlexSm <alex@ydb.tech> | 2023-12-27 23:31:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 23:31:58 +0100 |
commit | d67bfb4b4b7549081543e87a31bc6cb5c46ac973 (patch) | |
tree | 8674f2f1570877cb653e7ddcff37ba00288de15a /contrib/clickhouse | |
parent | 1f6bef05ed441c3aa2d565ac792b26cded704ac7 (diff) | |
download | ydb-d67bfb4b4b7549081543e87a31bc6cb5c46ac973.tar.gz |
Import libs 4 (#758)
Diffstat (limited to 'contrib/clickhouse')
4 files changed, 4 insertions, 22 deletions
diff --git a/contrib/clickhouse/src/Formats/registerFormats.cpp b/contrib/clickhouse/src/Formats/registerFormats.cpp index 5e91f433fe..fc2d54ba7c 100644 --- a/contrib/clickhouse/src/Formats/registerFormats.cpp +++ b/contrib/clickhouse/src/Formats/registerFormats.cpp @@ -14,7 +14,6 @@ void registerFileSegmentationEngineJSONEachRow(FormatFactory & factory); void registerFileSegmentationEngineRegexp(FormatFactory & factory); void registerFileSegmentationEngineJSONAsString(FormatFactory & factory); void registerFileSegmentationEngineJSONAsObject(FormatFactory & factory); -void registerFileSegmentationEngineJSONCompactEachRow(FormatFactory & factory); #if USE_HIVE void registerFileSegmentationEngineHiveText(FormatFactory & factory); #endif @@ -157,7 +156,6 @@ void registerFormats() registerFileSegmentationEngineJSONEachRow(factory); registerFileSegmentationEngineJSONAsString(factory); registerFileSegmentationEngineJSONAsObject(factory); - registerFileSegmentationEngineJSONCompactEachRow(factory); #if USE_HIVE registerFileSegmentationEngineHiveText(factory); #endif @@ -286,4 +284,3 @@ void registerFormats() } } - diff --git a/contrib/clickhouse/src/Interpreters/InterpreterCreateFunctionQuery.cpp b/contrib/clickhouse/src/Interpreters/InterpreterCreateFunctionQuery.cpp index b155476fd7..ea59115b07 100644 --- a/contrib/clickhouse/src/Interpreters/InterpreterCreateFunctionQuery.cpp +++ b/contrib/clickhouse/src/Interpreters/InterpreterCreateFunctionQuery.cpp @@ -6,6 +6,7 @@ #include <Interpreters/Context.h> #include <Interpreters/executeDDLQueryOnCluster.h> #include <Interpreters/removeOnClusterClauseIfNeeded.h> +#include <Interpreters/FunctionNameNormalizer.h> #include <Parsers/ASTCreateFunctionQuery.h> @@ -19,6 +20,7 @@ namespace ErrorCodes BlockIO InterpreterCreateFunctionQuery::execute() { + FunctionNameNormalizer().visit(query_ptr.get()); const auto updated_query_ptr = removeOnClusterClauseIfNeeded(query_ptr, getContext()); ASTCreateFunctionQuery & create_function_query = updated_query_ptr->as<ASTCreateFunctionQuery &>(); diff --git a/contrib/clickhouse/src/Interpreters/InterpreterCreateIndexQuery.cpp b/contrib/clickhouse/src/Interpreters/InterpreterCreateIndexQuery.cpp index 3b47a002e5..ed29c82a0f 100644 --- a/contrib/clickhouse/src/Interpreters/InterpreterCreateIndexQuery.cpp +++ b/contrib/clickhouse/src/Interpreters/InterpreterCreateIndexQuery.cpp @@ -4,6 +4,7 @@ #include <Databases/DatabaseReplicated.h> #include <Interpreters/Context.h> #include <Interpreters/executeDDLQueryOnCluster.h> +#include <Interpreters/FunctionNameNormalizer.h> #include <Parsers/ASTCreateIndexQuery.h> #include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIndexDeclaration.h> @@ -22,6 +23,7 @@ namespace ErrorCodes BlockIO InterpreterCreateIndexQuery::execute() { + FunctionNameNormalizer().visit(query_ptr.get()); auto current_context = getContext(); const auto & create_index = query_ptr->as<ASTCreateIndexQuery &>(); diff --git a/contrib/clickhouse/src/Processors/Formats/Impl/JSONCompactEachRowRowInputFormat.cpp b/contrib/clickhouse/src/Processors/Formats/Impl/JSONCompactEachRowRowInputFormat.cpp index 1a8dddab83..efd90e05cd 100644 --- a/contrib/clickhouse/src/Processors/Formats/Impl/JSONCompactEachRowRowInputFormat.cpp +++ b/contrib/clickhouse/src/Processors/Formats/Impl/JSONCompactEachRowRowInputFormat.cpp @@ -279,23 +279,4 @@ void registerJSONCompactEachRowSchemaReader(FormatFactory & factory) } } -void registerFileSegmentationEngineJSONCompactEachRow(FormatFactory & factory) -{ - auto register_func = [&](const String & format_name, bool with_names, bool with_types) - { - /// In case when we have names and/or types in the first two/one rows, - /// we need to read at least one more row of actual data. So, set - /// the minimum of rows for segmentation engine according to - /// parameters with_names and with_types. - size_t min_rows = 1 + int(with_names) + int(with_types); - factory.registerFileSegmentationEngine(format_name, [min_rows](ReadBuffer & in, DB::Memory<> & memory, size_t min_bytes, size_t max_rows) - { - return JSONUtils::fileSegmentationEngineJSONCompactEachRow(in, memory, min_bytes, min_rows, max_rows); - }); - }; - - registerWithNamesAndTypes("JSONCompactEachRow", register_func); - registerWithNamesAndTypes("JSONCompactStringsEachRow", register_func); -} - } |