raminqaf opened a new pull request, #29153:
URL: https://github.com/apache/flink/pull/29153

   ## What is the purpose of the change
   
   `UuidType` allows both `UUID` and `byte[]` as conversion classes, so a 
`ValueLiteralExpression` can legally hold a UUID literal internally as a 
`byte[]`. `ValueLiteralExpression#getValueAs(UUID.class)` didn't handle that 
case and returned empty, so both `asSerializableString` and 
`ExpressionConverter` threw `NoSuchElementException`/`IllegalStateException` 
instead of producing a literal.
   
   ## Brief change log
   
     - Added a `byte[]` to `UUID` conversion arm in 
`ValueLiteralExpression#getValueAs`, matching the existing coercion pattern for 
`LocalDate`, `Instant`, and other multi-representation types.
     - Fixes both affected call sites (`asSerializableString` and 
`ExpressionConverter#visit`) with a single change, since both go through 
`getValueAs`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - `ExpressionTest#testUuidValueLiteralExtraction` and 
`#testUuidAsSerializableString` are parameterized over a direct `UUID` literal 
and a `byte[]`-bridged literal.
     - `ExpressionConverterTest#testUuidLiteral` and 
`#testUuidLiteralFromBytes` cover the same two cases through the planner's 
RexNode conversion path.
     - All four `byte[]`-backed cases reproduce the original exception before 
the fix and pass after it.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Sonnet 5)


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

Reply via email to