Skip to content

Commit 450fba5

Browse files
authored
Merge 88f4184 into b4d276d
2 parents b4d276d + 88f4184 commit 450fba5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ydb/core/formats/arrow/permutations.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::vector<std::s
4141
}
4242

4343
if (haveNulls) {
44-
std::sort(points.begin(), points.end());
44+
std::sort(points.begin(), points.end(), [](const TRawReplaceKey& a, const TRawReplaceKey& b) {
45+
auto cmp = a <=> b;
46+
return cmp == std::partial_ordering::equivalent ? a.GetPosition() > b.GetPosition() : cmp == std::partial_ordering::less;
47+
});
4548
} else {
4649
std::sort(points.begin(), points.end(), [](const TRawReplaceKey& a, const TRawReplaceKey& b) {
47-
return a.CompareNotNull(b) == std::partial_ordering::less;
50+
auto cmp = a.CompareNotNull(b);
51+
return cmp == std::partial_ordering::equivalent ? a.GetPosition() > b.GetPosition() : cmp == std::partial_ordering::less;
4852
});
4953
}
5054

0 commit comments

Comments
 (0)