siddiqueirshad opened a new pull request, #69786:
URL: https://github.com/apache/doris/pull/69786

   ### What problem does this PR solve?
   
   Issue Number: close #69371
   
   Problem Summary:
   In cloud mode, FE `CloudInternalCatalog` created the initial `[0-1]` rowset 
with `String.format("%016X", ...)` (upper-case hex).
   BE `from_hex()` in `be/src/util/uid_util.h` only handled digits and 
lower-case `'a'`..`'f'`. For `'A'`..`'F'`, `(i - 'a' + 10)` produced a negative 
`int` (-22..-17) which sign-extended and corrupted the upper bits when 
bitwise-ORed into `val`. This caused lossy parsing and non-unique rowset IDs 
for initial rowsets whose UUIDs contained letters.
   
   ### What is changed and how it works?
   
   1. **BE `from_hex` (`be/src/util/uid_util.h`)**:
      Add an explicit branch for `'A'`..`'F'` with `i - 'A' + 10`, ensuring 
upper-case and mixed-case hex strings parse correctly into their exact numeric 
values.
   2. **FE `CloudInternalCatalog` 
(`fe/fe-core/src/main/java/org/apache/doris/cloud/datasource/CloudInternalCatalog.java`)**:
      Format `rowsetIdV2Str` using `%016x` (lower-case hex), matching BE's 
standard rowset ID string representation.
   3. **Tests (`be/test/util/uid_util_test.cpp`)**:
      Add `UidUtilTest.FromHexCaseInsensitive` unit tests verifying lower-case, 
upper-case, and mixed-case parsing equivalence as well as `UniqueId` equality.
   
   ### Check List
   
   - [x] I have tested this code locally.
   - [x] This PR fixes an issue (#69371).
   


-- 
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]

Reply via email to