zhuqi-lucas commented on code in PR #7875: URL: https://github.com/apache/arrow-rs/pull/7875#discussion_r2188061193
########## arrow-array/src/array/byte_view_array.rs: ########## @@ -1193,9 +1197,19 @@ mod tests { b"abcdefghi", b"abcdefghij", b"abcdefghijk", - b"abcdefghijkl", // 12 bytes, max inline - b"bar", - b"bar\0", // special case to test length tiebreaker + b"abcdefghijkl", + // ─────────────────────────────────────────────────────────────────────── + // This pair verifies that we didn’t accidentally reverse the inline bytes: + // without our fix, “backend one” would compare as if it were + // “eno dnekcab”, so “one” might end up sorting _after_ “two”. + b"backend one", // special case: tests byte-order reversal bug Review Comment: > I guess because`"xyy" < "xyz"` and `"yxx" < "zyx"`? Right! ########## arrow-array/src/array/byte_view_array.rs: ########## @@ -1193,9 +1197,19 @@ mod tests { b"abcdefghi", b"abcdefghij", b"abcdefghijk", - b"abcdefghijkl", // 12 bytes, max inline - b"bar", - b"bar\0", // special case to test length tiebreaker + b"abcdefghijkl", + // ─────────────────────────────────────────────────────────────────────── + // This pair verifies that we didn’t accidentally reverse the inline bytes: + // without our fix, “backend one” would compare as if it were + // “eno dnekcab”, so “one” might end up sorting _after_ “two”. + b"backend one", // special case: tests byte-order reversal bug + b"backend two", Review Comment: Thank you @alamb for good point: ```rust b"than12Byt", b"than12Bytes", b"than12Bytes\0", b"than12Bytez", ``` I will add above cases, because inline_key_fast function only used for <= 12 and <= 12 bytes to compare. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org