Cosmetics: add assert

This commit is contained in:
Robert Schulze 2023-06-05 10:22:34 +00:00
parent 06329fb08b
commit cdb5997339
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
2 changed files with 3 additions and 3 deletions

View File

@ -1693,9 +1693,7 @@ MarkRanges MergeTreeDataSelectExecutor::filterMarksUsingIndex(
// vector of indexes of useful ranges
auto result = ann_condition->getUsefulRanges(granule);
if (result.empty())
{
++granules_dropped;
}
for (auto range : result)
{

View File

@ -251,7 +251,7 @@ std::vector<size_t> MergeTreeIndexConditionAnnoy::getUsefulRangesImpl(MergeTreeI
if (granule == nullptr)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Granule has the wrong type");
const AnnoyIndexWithSerializationPtr<Distance> & annoy = granule->index;
AnnoyIndexWithSerializationPtr<Distance> annoy = granule->index;
if (ann_condition.getNumOfDimensions() != annoy->getNumOfDimensions())
throw Exception(ErrorCodes::INCORRECT_QUERY, "The dimension of the space in the request ({}) "
@ -265,6 +265,8 @@ std::vector<size_t> MergeTreeIndexConditionAnnoy::getUsefulRangesImpl(MergeTreeI
annoy->get_nns_by_vector(reference_vector.data(), limit, static_cast<int>(search_k), &neighbors, &distances);
chassert(neighbors.size() == distances.size());
std::vector<size_t> granule_numbers;
granule_numbers.reserve(neighbors.size());
for (size_t i = 0; i < neighbors.size(); ++i)