Skip to content

Write last record with the same key from batch #12048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2447,7 +2447,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
Loading