Skip to content

Commit 877a7fc

Browse files
branch-4.1: [test](be) add JsonbSerializeUtil::block_to_jsonb golden-file UT covering all row-store-supported types #63448 (#63487)
Cherry-picked from #63448 Co-authored-by: Chenyang Sun <sunchenyang@selectdb.com>
1 parent d370b51 commit 877a7fc

3 files changed

Lines changed: 1071 additions & 0 deletions

File tree

be/src/storage/row_cursor.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ void RowCursor::_encode_field(const StorageField* storage_field, const Field& f,
201201
}
202202
}
203203

204+
// Encodes the first `num_keys` key columns as a memcomparable byte string.
205+
// Each slot is [marker][value bytes]. The marker sits at a position that
206+
// real entries fill with KEY_NORMAL_MARKER (0x02), so any byte > 0x02 there
207+
// sorts strictly after every real entry — independent of the value bytes.
208+
//
209+
// Examples — PK (a STRING, b STRING), stored entry (foo, bar) encodes as
210+
// `02 foo | 02 bar`. Calls with num_keys=2 and only partial key "foo":
211+
//
212+
// padding_minimal=true -> 02 foo | 00 (MINIMAL)
213+
// padding_minimal=false, is_mow=false -> 02 foo | FF (MAXIMAL)
214+
// padding_minimal=false, is_mow=true -> 02 foo | 03 (NORMAL_NEXT)
204215
template <bool is_mow>
205216
void RowCursor::encode_key_with_padding(std::string* buf, size_t num_keys,
206217
bool padding_minimal) const {

0 commit comments

Comments
 (0)