xiangfu0 opened a new pull request, #19181:
URL: https://github.com/apache/pinot/pull/19181

   ## What
   `CAST` support for the logical `UUID` type, in both directions, single- and 
multi-value.
   
   - `CAST(<string|bytes> AS UUID)` parses into the 16-byte stored form
   - a UUID *result* read as a string renders the canonical dashed form rather 
than the hex a BYTES column produces
   
   ## Why both directions
   These are genuinely distinct and both are needed:
   
   - #19165 (already merged) handles a UUID **source** cast to STRING — 
`CAST(uuidCol AS STRING)`
   - this handles rendering a UUID **result** — e.g. reading `CAST(x AS UUID)` 
back as a string
   
   They live in different switches in `CastTransformFunction` (one dispatches 
on the source type, the other on the result type). Removing either produces 
`IllegalStateException: Cannot cast from SV UUID to STRING`.
   
   ## Where the conversions live
   `ArrayCopyUtils.copyToUuid()` / `copyFromUuid()`, SV and MV, placed with 
their src/dest neighbours. They mirror the existing `copyFromTimestamp` — a 
logical type parsed into, or rendered from, its stored representation.
   
   ## Testing
   `CastTransformFunctionTest` covers both directions, the round trip through 
BYTES, and rejection of invalid literals, invalid byte lengths and MV sources. 
`BaseTransformFunctionTest` gains a UUID single-value column and the matching 
assertion branch, which the other UUID transform tests build on.
   
   ## About this PR
   Split out of #18872 to keep that one to predicate evaluation. Depends only 
on `UuidUtils` (#18869) and the UUID stored type (#18870), both already on 
master — it does not depend on #18872 and can merge independently.
   
   Part of the #18140 UUID split.
   


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