fix tests

This commit is contained in:
Anton Popov 2021-11-19 17:14:56 +03:00
parent 69559a4fd9
commit 099c40d251
5 changed files with 21 additions and 23 deletions

View File

@ -116,7 +116,7 @@ private:
std::vector<std::vector<Edge>> edges;
};
/// Recieves graph, in which each vertex corresponds to one expression.
/// Receives graph, in which each vertex corresponds to one expression.
/// Then finds strongly connected components and builds graph on them.
static Graph buildGraphFromAstsGraph(const Graph & asts_graph);

View File

@ -90,12 +90,6 @@ struct ColumnPrice
return std::tie(compressed_size, uncompressed_size) < std::tie(that.compressed_size, that.uncompressed_size);
}
ColumnPrice operator+(ColumnPrice that) const
{
that += *this;
return that;
}
ColumnPrice & operator+=(const ColumnPrice & that)
{
compressed_size += that.compressed_size;
@ -156,7 +150,12 @@ ColumnPrice calculatePrice(
{
ColumnPrice result(0, 0);
for (const auto & ident : identifiers)
result = result + column_prices.at(ident);
{
auto it = column_prices.find(ident);
if (it != column_prices.end())
result += it->second;
}
return result;
}

View File

@ -151,7 +151,7 @@ public:
/// @max_growth_multipler means that it's allowed to grow size of formula only
/// in that amount of times. It's needed to avoid exponential explosion of formula.
/// CNF of boolean formula with N clauses can have 2^N clauses.
/// If amout of atomic formulas will be exceded nullopt will be returned.
/// If amount of atomic formulas will be exceeded nullopt will be returned.
/// 0 - means unlimited.
static std::optional<CNFQuery> tryConvertToCNF(
const ASTPtr & query, size_t max_growth_multipler = DEFAULT_MAX_GROWTH_MULTIPLIER);

View File

@ -1061,21 +1061,21 @@ RangesInDataParts MergeTreeDataSelectExecutor::filterPartsByPrimaryKeyAndSkipInd
}
for (const auto & [granularity, index_and_condition] : merged_indices)
{
const auto & index_name = "Merged";
LOG_DEBUG(log, "Index {} has dropped {}/{} granules.",
backQuote(index_name),
index_and_condition->granules_dropped, index_and_condition->total_granules);
{
const auto & index_name = "Merged";
LOG_DEBUG(log, "Index {} has dropped {}/{} granules.",
backQuote(index_name),
index_and_condition->granules_dropped, index_and_condition->total_granules);
std::string description = "MERGED GRANULARITY " + std::to_string(granularity);
std::string description = "MERGED GRANULARITY " + std::to_string(granularity);
index_stats.emplace_back(ReadFromMergeTree::IndexStat{
.type = ReadFromMergeTree::IndexType::Skip,
.name = index_name,
.description = std::move(description),
.num_parts_after = index_and_condition->total_parts - index_and_condition->parts_dropped,
.num_granules_after = index_and_condition->total_granules - index_and_condition->granules_dropped});
}
index_stats.emplace_back(ReadFromMergeTree::IndexStat{
.type = ReadFromMergeTree::IndexType::Skip,
.name = index_name,
.description = std::move(description), //-V1030
.num_parts_after = index_and_condition->total_parts - index_and_condition->parts_dropped,
.num_granules_after = index_and_condition->total_granules - index_and_condition->granules_dropped});
}
return parts_with_ranges;
}

View File

@ -104,5 +104,4 @@ void hypothesisIndexValidator(const IndexDescription & index, bool /*attach*/)
throw Exception("Hypothesis index needs exactly one expression", ErrorCodes::LOGICAL_ERROR);
}
}