Updates to YAMLParser and FileChecker

This commit is contained in:
Alexey Milovidov 2021-09-21 21:05:08 +03:00
parent 08bce94c39
commit 087d0683c9
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ Poco::AutoPtr<Poco::XML::Document> YAMLParser::parse(const String& path)
throw Exception(ErrorCodes::CANNOT_OPEN_FILE, "Unable to open YAML configuration file {}", path);
}
Poco::AutoPtr<Poco::XML::Document> xml = new Document;
Poco::AutoPtr<Poco::XML::Element> root_node = xml->createElement("yandex");
Poco::AutoPtr<Poco::XML::Element> root_node = xml->createElement("clickhouse");
xml->appendChild(root_node);
try
{

View File

@ -111,7 +111,7 @@ void FileChecker::save() const
std::unique_ptr<WriteBuffer> out = disk->writeFile(tmp_files_info_path);
/// So complex JSON structure - for compatibility with the old format.
writeCString("{\"yandex\":{", *out);
writeCString("{\"clickhouse\":{", *out);
auto settings = FormatSettings();
for (auto it = map.begin(); it != map.end(); ++it)
@ -153,7 +153,7 @@ void FileChecker::load()
}
JSON json(out.str());
JSON files = json["yandex"];
JSON files = json.has("clickhouse") ? json["clickhouse"] : json["yandex"];
for (const JSON file : files) // NOLINT
map[unescapeForFileName(file.getName())] = file.getValue()["size"].toUInt();
}