xiangfu0 commented on code in PR #18872:
URL: https://github.com/apache/pinot/pull/18872#discussion_r3706825976
##########
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:
You are right — removed. `nullBytesPlaceHolder()` is gone and both sites use
the shared `NullValuePlaceHolder.BYTES` like every other type.
Checking your premise confirmed it, and more starkly than I expected:
| | placeholder | default null value |
|---|---|---|
| INT | `0` | `Integer.MIN_VALUE` |
| STRING | `""` | `"null"` |
So the placeholder is definitively not the default, and my change was making
an invalid filler *look* valid rather than fixing why it is read.
For the record on what remains: `transformToBytesValuesSVUsingValue` (null
handling disabled) does read it — there is no bitmap on that path, so the
filler is returned as a value. That is not UUID-specific; INT does the same at
line 308 and silently yields `0`. UUID only makes it visible, because a
zero-length `byte[]` throws in `UuidUtils` instead of quietly producing a wrong
number.
So `SELECT CASE WHEN intCol < 2 THEN CAST('...' AS UUID) END` now throws on
unmatched rows rather than returning a fake nil UUID. I think failing loudly is
the better of the two, but the real fix is the one you are pointing at — not
reading the placeholder at all — which changes `CaseTransformFunction`
semantics for every type and does not belong in this PR. Happy to pick it up
separately if you want it tracked.
--
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]