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

   ## What is the purpose of the change
   
   This is the first sub-task of FLIP-604 (Complete VARIANT Primitive Coverage 
with UUID and Timestamps). It introduces `UUID` as a native logical type in the 
Table/SQL type system.
   
   `UUID` represents a 128-bit value stored as a fixed 16-byte big-endian 
sequence, with `java.util.UUID` as its default conversion class. It maps to 
Calcite's native `SqlTypeName.UUID`, which is available in the Calcite 1.41 
version Flink already uses, so no SQL parser or Calcite version change is 
required. The type mirrors `VARIANT`: a parameterless scalar in the `EXTENSION` 
family.
   
   This change is scoped to the type system only. It makes the type exist, be 
constructible, parseable, and round-trip through the planner and plan serde. It 
does not make queries over `UUID` execute. Runtime serialization and codegen 
(FLINK-40490), casting (FLINK-40487), comparison and ordering (FLINK-40488), 
functions (FLINK-40489), VARIANT integration (FLINK-40491–40493), and 
documentation (FLINK-40494) follow in separate sub-tasks.
   
   ## Brief change log
   
   - Add `UuidType` and `LogicalTypeRoot.UUID` (EXTENSION family); add the 
`default visit(UuidType)` method to `LogicalTypeVisitor`.
   - Add the `DataTypes.UUID()` factory and the `UUID` keyword to 
`LogicalTypeParser`.
   - Map `UuidType` to and from `SqlTypeName.UUID` in `FlinkTypeFactory` and 
`LogicalRelDataTypeConverter`.
   - Support `UUID` in the planner and SQL gateway logical-type JSON serde.
   
   ## Verifying this change
   
   This change added unit tests and can be verified as follows:
   
   - `LogicalTypesType`, `DataTypesTest`, `LogicalTypeParserTest` cover the 
type, the `DataTypes.UUID()` factory, and keyword parsing (`UUID` / `UUID NOT 
NULL`).
   - `FlinkTypeFactoryTest#testInternalToRelType` covers the 
`LogicalType`↔`RelDataType` round-trip including nullability.
   - `LogicalRelDataTypeConverterTest`, and the planner and SQL gateway 
`LogicalTypeJson(Ser)DeTest` cover JSON serde round-trips.
   
   ## 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)`: **yes** (new `@PublicEvolving` `UuidType`, 
`LogicalTypeRoot.UUID`, `DataTypes.UUID()`)
     - The serializers: **yes** (logical-type JSON serde for compiled plans and 
the SQL gateway REST; no binary/state `TypeSerializer` is added)
     - 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? **not documented** (documentation 
is tracked separately in FLINK-40494)
   
   Two things to confirm before you submit:
   
   1. The "serializers" answer. I marked it yes because the compiled-plan JSON 
serde is a compatibility surface and this extends it. If you consider that 
question to mean only binary TypeSerializers, flip it to no. I'd keep it as yes 
with the clarifying note.
   2. The ASF generative-AI disclosure section (new in the template). AI 
tooling was used here, so I left it out of the message above rather than fill 
it falsely. Per ASF policy you should append one of:
   ##### 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