github-actions[bot] commented on code in PR #66151:
URL: https://github.com/apache/doris/pull/66151#discussion_r3664580272
##########
be/test/storage/key/row_key_encoder_test.cpp:
##########
@@ -1042,6 +1042,34 @@ TEST_F(RowKeyEncoderTest, AllKeyTypesTable) {
// by column-length minimal-marker bytes, so within one key a NULL sequence
// sorts before every real one. The filler length is the one type-dependent
// behavior of the suffix.
+// The probe-side encoder produces the key the primary key index is built on,
+// whatever the segment sorts by. Without cluster keys that is the writer's own
+// sort-key view, so the two must agree byte for byte.
+TEST_F(RowKeyEncoderTest, ProbeEncoderMatchesSortKeyViewWithoutClusterKeys) {
+ auto schema = std::make_shared<TabletSchema>();
+ schema->append_column(*create_int_key(0));
+ schema->append_column(*create_int_key(1));
+ schema->append_column(
+ *create_int_value(2,
FieldAggregationMethod::OLAP_FIELD_AGGREGATION_NONE));
+ schema->_keys_type = UNIQUE_KEYS;
+ schema->_num_short_key_columns = 1;
+ build(schema, 2, [&](MutableColumns& c) {
+ fill_int(c, 0, {1, 2});
+ fill_int(c, 1, {10, 20});
+ fill_int(c, 2, {0, 0});
+ });
+ ASSERT_TRUE(_schema->cluster_key_uids().empty());
Review Comment:
The new overload is specifically needed when a MoW segment sorts by cluster
keys but probes its primary-key index with the schema key columns. This test
asserts cluster keys are absent and compares against
`writer_encoder.full_encode()`, so it covers only the case where both encoder
views are already identical. Please add a cluster-key case that compares
`RowKeyEncoder(schema).full_encode(primary_key_columns)` byte-for-byte with
`RowKeyEncoder(schema, true).full_encode_primary_keys(primary_key_columns)`
(ideally including the sequence suffix); otherwise a probe/index mismatch for
cluster-key row binlog can pass all of the new tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]