From f8c1f2bd33898e2fbc1bb4a963458a781778f722 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Thu, 25 May 2023 19:48:12 +0000 Subject: [PATCH] Cosmetics: Remove absolute namespace qualification of Annoy library internals --- src/Storages/MergeTree/MergeTreeIndexAnnoy.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Storages/MergeTree/MergeTreeIndexAnnoy.cpp b/src/Storages/MergeTree/MergeTreeIndexAnnoy.cpp index 54df6f46ef2..716624b7453 100644 --- a/src/Storages/MergeTree/MergeTreeIndexAnnoy.cpp +++ b/src/Storages/MergeTree/MergeTreeIndexAnnoy.cpp @@ -226,9 +226,9 @@ bool MergeTreeIndexConditionAnnoy::alwaysUnknownOrTrue() const std::vector MergeTreeIndexConditionAnnoy::getUsefulRanges(MergeTreeIndexGranulePtr idx_granule) const { if (distance_name == "L2Distance") - return getUsefulRangesImpl<::Annoy::Euclidean>(idx_granule); + return getUsefulRangesImpl(idx_granule); else if (distance_name == "cosineDistance") - return getUsefulRangesImpl<::Annoy::Angular>(idx_granule); + return getUsefulRangesImpl(idx_granule); else throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown distance name. Must be 'L2Distance' or 'cosineDistance'. Got {}", distance_name); } @@ -305,9 +305,9 @@ MergeTreeIndexAnnoy::MergeTreeIndexAnnoy(const IndexDescription & index_, uint64 MergeTreeIndexGranulePtr MergeTreeIndexAnnoy::createIndexGranule() const { if (distance_name == "L2Distance") - return std::make_shared>(index.name, index.sample_block); + return std::make_shared>(index.name, index.sample_block); else if (distance_name == "cosineDistance") - return std::make_shared>(index.name, index.sample_block); + return std::make_shared>(index.name, index.sample_block); throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown distance name. Must be 'L2Distance' or 'cosineDistance'. Got {}", distance_name); } @@ -315,9 +315,9 @@ MergeTreeIndexAggregatorPtr MergeTreeIndexAnnoy::createIndexAggregator() const { /// TODO: Support more metrics. Available metrics: https://github.com/spotify/annoy/blob/master/src/annoymodule.cc#L151-L171 if (distance_name == "L2Distance") - return std::make_shared>(index.name, index.sample_block, trees); + return std::make_shared>(index.name, index.sample_block, trees); if (distance_name == "cosineDistance") - return std::make_shared>(index.name, index.sample_block, trees); + return std::make_shared>(index.name, index.sample_block, trees); throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown distance name. Must be 'L2Distance' or 'cosineDistance'. Got {}", distance_name); }