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

   ## What is the purpose of the change
   
   This pull request adds `CAST` and `TRY_CAST` from a `VARIANT` holding a UUID 
(variant primitive code 20) to the native `UUID` type, completing UUID coverage 
for `VARIANT` under 
[FLIP-604](https://cwiki.apache.org/confluence/spaces/FLINK/pages/446070993/FLIP-604+Complete+VARIANT+Primitive+Coverage+with+UUID+and+Timestamps).
 
   
    A `VARIANT` whose stored kind is `UUID` can now be cast to the `UUID` type, 
and it renders to a character string in the canonical lower-case 8-4-4-4-12 
form like any other scalar kind. 
   
   Consistent with the existing `VARIANT`-cast semantics, a cast never 
reinterprets the stored kind, so the UUID variant casts only to `UUID` (and to 
a string).
   
   ## Brief change log
   
     - `VariantCastUtils.toUuid` decodes a UUID-kind variant into the 16-byte 
big-endian encoding used internally for the `UUID` type, `renderScalar` gains a 
`UUID` case producing the canonical string.
     - `VariantToPrimitiveCastRule` accepts `UUID` as a target and generates 
the `toUuid` call.
     - `LogicalTypeCasts` declares `VARIANT` as an explicit source for 
`castTo(UUID)`.
     - Documentation (`data-types.md`, both `content` and `content.zh`) lists 
`UUID` in the "stored kind → succeeds for" table for `VARIANT` casts.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - `CastRulesTest`: added a `VARIANT` → `UUID` case (success and a 
`TableRuntimeException` for a non-UUID kind) and a `VARIANT` → `STRING` case 
asserting the canonical rendering.
     - `LogicalTypeCastsTest`: `VARIANT` → `UUID` is explicit-only castable; 
`UUID` → `VARIANT` stays unsupported.
     - `CastRuleProviderTest`: the `VARIANT` → `UUID` rule resolves.
   
   ## 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? **yes**
     - If yes, how is the feature documented? **docs**
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Opus 4.8)


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