xiangfu0 commented on code in PR #18872:
URL: https://github.com/apache/pinot/pull/18872#discussion_r3700952413


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CaseTransformFunction.java:
##########
@@ -822,19 +830,25 @@ protected byte[][] 
transformToBytesValuesSVUsingValue(ValueBlock valueBlock) {
     return _bytesValuesSV;
   }
 
+  /// The BYTES placeholder is zero-length, which every UUID consumer rejects 
("Invalid UUID byte length: 0"). A UUID
+  /// result must fall back to the 16-byte nil UUID instead.
+  private byte[] nullBytesPlaceHolder() {

Review Comment:
   Half right, and I scoped the fix down accordingly — thanks, this was worth 
checking.
   
   You are correct for `transformToBytesValuesSVUsingValueAndNull`: it does 
`bitmap.add(docId)` alongside the placeholder, so that value is never read. 
That site is back to the shared `NullValuePlaceHolder.BYTES`.
   
   It does not hold for `transformToBytesValuesSVUsingValue` (null handling 
disabled). There is no bitmap there, so the placeholder *is* the value and does 
get read back. Verified by putting the zero-length placeholder back at that 
site:
   
   ```
   
CaseTransformFunctionTest.testCaseTransformFunctionWithUuidResultsAndNoElseBranch
     java.lang.IllegalArgumentException: Invalid UUID value: ''
     Caused by: java.lang.IllegalArgumentException: Invalid UUID string:
   ```
   
   So `SELECT CASE WHEN intCol < 2 THEN CAST('...' AS UUID) END` throws on the 
rows that match no branch. Only that one site now uses the 16-byte nil UUID, 
and the comment says why.
   



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