Skip to content

Commit

Permalink
Write last record with the same key from batch (#12048)
Browse files Browse the repository at this point in the history
  • Loading branch information
aavdonkin authored Nov 28, 2024
1 parent 31e0e46 commit 4da9280
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ydb/core/formats/arrow/permutations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::vector<std::s
}

if (haveNulls) {
std::sort(points.begin(), points.end());
std::sort(points.begin(), points.end(), [](const TRawReplaceKey& a, const TRawReplaceKey& b) {
auto cmp = a <=> b;
return cmp == std::partial_ordering::equivalent ? a.GetPosition() > b.GetPosition() : cmp == std::partial_ordering::less;
});
} else {
std::sort(points.begin(), points.end(), [](const TRawReplaceKey& a, const TRawReplaceKey& b) {
return a.CompareNotNull(b) == std::partial_ordering::less;
auto cmp = a.CompareNotNull(b);
return cmp == std::partial_ordering::equivalent ? a.GetPosition() > b.GetPosition() : cmp == std::partial_ordering::less;
});
}

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/ut/olap/kqp_olap_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
// Cout << "Wait indexation..." << Endl;
// Sleep(TDuration::Seconds(2));
// }
testHelper.ReadData("SELECT * FROM `/Root/ColumnTableTest` WHERE id=2", "[[2;\"test_res_2\";#;[\"val1\"]]]");
testHelper.ReadData("SELECT * FROM `/Root/ColumnTableTest` WHERE id=2", "[[2;\"test_res_2\";#;[\"val2\"]]]");
}

Y_UNIT_TEST(BulkUpsertUpdate) {
Expand Down

0 comments on commit 4da9280

Please sign in to comment.