From aa86fac4e7ec81aa88c7fd4bb2fac7e7d036fa74 Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 7 Jul 2021 14:07:20 +0300 Subject: [PATCH] Fix unbundled build --- docker/packager/unbundled/Dockerfile | 1 + src/Functions/synonyms.cpp | 2 +- src/Interpreters/Lemmatizers.cpp | 3 +- src/Interpreters/SynonymsExtensions.cpp | 7 +- tests/integration/test_nlp/configs/config.xml | 48 ------- .../test_nlp/configs/dicts_config.xml | 22 ++++ tests/integration/test_nlp/configs/users.xml | 119 ------------------ tests/integration/test_nlp/test.py | 2 +- 8 files changed, 29 insertions(+), 175 deletions(-) delete mode 100644 tests/integration/test_nlp/configs/config.xml create mode 100644 tests/integration/test_nlp/configs/dicts_config.xml delete mode 100644 tests/integration/test_nlp/configs/users.xml diff --git a/docker/packager/unbundled/Dockerfile b/docker/packager/unbundled/Dockerfile index 4dd6dbc61d8..2c1465d9d9f 100644 --- a/docker/packager/unbundled/Dockerfile +++ b/docker/packager/unbundled/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get update \ libboost-regex-dev \ libboost-context-dev \ libboost-coroutine-dev \ + libboost-graph-dev \ zlib1g-dev \ liblz4-dev \ libdouble-conversion-dev \ diff --git a/src/Functions/synonyms.cpp b/src/Functions/synonyms.cpp index b846a2e0486..ea8b36dd2e2 100644 --- a/src/Functions/synonyms.cpp +++ b/src/Functions/synonyms.cpp @@ -96,7 +96,7 @@ public: if (synset) { - for (const auto &token : *synset) + for (const auto & token : *synset) out_data.insert(Field(token.data(), token.size())); current_offset += synset->size(); diff --git a/src/Interpreters/Lemmatizers.cpp b/src/Interpreters/Lemmatizers.cpp index 3e43d0aa090..0d4ad8b0c95 100644 --- a/src/Interpreters/Lemmatizers.cpp +++ b/src/Interpreters/Lemmatizers.cpp @@ -41,8 +41,7 @@ Lemmatizers::Lemmatizers(const Poco::Util::AbstractConfiguration & config) Poco::Util::AbstractConfiguration::Keys keys; if (!config.has(prefix)) - throw Exception("You should specify list of lemmatizers in " + prefix, - ErrorCodes::INVALID_CONFIG_PARAMETER); + throw Exception(ErrorCodes::INVALID_CONFIG_PARAMETER, "No lemmatizers specified in server config on prefix '{}'", prefix); config.keys(prefix, keys); diff --git a/src/Interpreters/SynonymsExtensions.cpp b/src/Interpreters/SynonymsExtensions.cpp index b2698e8f652..6991d8897be 100644 --- a/src/Interpreters/SynonymsExtensions.cpp +++ b/src/Interpreters/SynonymsExtensions.cpp @@ -86,8 +86,8 @@ SynonymsExtensions::SynonymsExtensions(const Poco::Util::AbstractConfiguration & Poco::Util::AbstractConfiguration::Keys keys; if (!config.has(prefix)) - throw Exception("You should specify list of synonyms extensions in " + prefix, - ErrorCodes::INVALID_CONFIG_PARAMETER); + throw Exception(ErrorCodes::INVALID_CONFIG_PARAMETER, + "No synonims extensions specified in server config on prefix '{}'", prefix); config.keys(prefix, keys); @@ -108,8 +108,7 @@ SynonymsExtensions::SynonymsExtensions(const Poco::Util::AbstractConfiguration & if (ext_type.empty()) throw Exception("Extension type in config is not specified here: " + prefix + "." + key + ".type", ErrorCodes::INVALID_CONFIG_PARAMETER); - if (ext_type != "plain" && - ext_type != "wordnet") + if (ext_type != "plain" && ext_type != "wordnet") throw Exception("Unknown extension type in config: " + prefix + "." + key + ".type, must be 'plain' or 'wordnet'", ErrorCodes::INVALID_CONFIG_PARAMETER); diff --git a/tests/integration/test_nlp/configs/config.xml b/tests/integration/test_nlp/configs/config.xml deleted file mode 100644 index 4932feda600..00000000000 --- a/tests/integration/test_nlp/configs/config.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - trace - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M - 10 - - - 9000 - 127.0.0.1 - - - - true - none - - AcceptCertificateHandler - - - - - 500 - 5368709120 - ./clickhouse/ - users.xml - - - - en - plain - /etc/clickhouse-server/dictionaries/ext-en.txt - - - ru - plain - /etc/clickhouse-server/dictionaries/ext-ru.txt - - - - - - en - /etc/clickhouse-server/dictionaries/lem-en.bin - - - diff --git a/tests/integration/test_nlp/configs/dicts_config.xml b/tests/integration/test_nlp/configs/dicts_config.xml new file mode 100644 index 00000000000..435507ce1d8 --- /dev/null +++ b/tests/integration/test_nlp/configs/dicts_config.xml @@ -0,0 +1,22 @@ + + + + + en + plain + /etc/clickhouse-server/dictionaries/ext-en.txt + + + ru + plain + /etc/clickhouse-server/dictionaries/ext-ru.txt + + + + + + en + /etc/clickhouse-server/dictionaries/lem-en.bin + + + diff --git a/tests/integration/test_nlp/configs/users.xml b/tests/integration/test_nlp/configs/users.xml deleted file mode 100644 index b33dc0628d1..00000000000 --- a/tests/integration/test_nlp/configs/users.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - 10000000000 - - - random - - - - - 1 - - - - - - - - - - - - - ::/0 - - - - default - - - default - - - - - - - - - - - - - - 3600 - - - 0 - 0 - 0 - 0 - 0 - - - - diff --git a/tests/integration/test_nlp/test.py b/tests/integration/test_nlp/test.py index a6af979f067..a0a6f279994 100644 --- a/tests/integration/test_nlp/test.py +++ b/tests/integration/test_nlp/test.py @@ -10,7 +10,7 @@ from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) -instance = cluster.add_instance('instance', base_config_dir='configs/') +instance = cluster.add_instance('instance', main_configs=['configs/dicts_config.xml']) def copy_file_to_container(local_path, dist_path, container_id): os.system("docker cp {local} {cont_id}:{dist}".format(local=local_path, cont_id=container_id, dist=dist_path))