fix: groupby bug for ut (#30272)

related: #29965

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
pull/30292/head
MrPresent-Han 2024-01-25 20:57:00 +08:00 committed by GitHub
parent c02fb64ad6
commit 116d0f20b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -168,7 +168,7 @@ GroupIteratorResult(
auto dis_closer = [&](float l, float r) {
if (PositivelyRelated(metrics_type))
return l > r;
return l <= r;
return l < r;
};
while (iterator->HasNext() && groupMap.size() < topK) {
auto [offset, dis] = iterator->Next();
@ -191,8 +191,8 @@ GroupIteratorResult(
//4. save groupBy results
group_by_values.reserve(sortedGroupVals.size());
offsets.push_back(sortedGroupVals.size());
distances.push_back(sortedGroupVals.size());
offsets.reserve(sortedGroupVals.size());
distances.reserve(sortedGroupVals.size());
for (auto iter = sortedGroupVals.cbegin(); iter != sortedGroupVals.cend();
iter++) {
group_by_values.emplace_back(iter->first);