Ramin Gharib created FLINK-40546:
------------------------------------

             Summary: Automatically extract java.util.UUID as the UUID type in 
the DataStream API
                 Key: FLINK-40546
                 URL: https://issues.apache.org/jira/browse/FLINK-40546
             Project: Flink
          Issue Type: Improvement
          Components: API / Type Serialization System
            Reporter: Ramin Gharib
             Fix For: 3.0.0


FLINK-40490 added runtime support for the UUID type, including a 
BasicTypeInfo.UUID_TYPE_INFO,
a UuidSerializer, a UuidComparator, and the public Types.UUID entry point.

For the DataStream API, UUID is currently opt-in: java.util.UUID is 
intentionally NOT registered
in BasicTypeInfo.TYPES, so reflective type extraction (TypeExtractor) still 
treats a plain
java.util.UUID field as a generic Kryo type (GenericTypeInfo). Users who want 
the efficient
representation must reference Types.UUID explicitly.

This ticket registers java.util.UUID.class in BasicTypeInfo.TYPES so that 
TypeExtractor
automatically maps java.util.UUID fields (POJOs, tuples, etc.) to 
UUID_TYPE_INFO, making UUID a
fully first-class DataStream type without opt-in.

Why this is deferred to a major version:

This is a breaking change for state and savepoint compatibility. Pipelines that 
currently carry a
java.util.UUID field serialize it with Kryo (GenericTypeInfo). 
Auto-registration switches the
serializer to UuidSerializer, so state written before the upgrade can no longer 
be restored
(the serializer snapshot is incompatible). To avoid silently breaking existing 
jobs, the change
is gated to the next major Flink version (3.0).

Note: the Table/SQL side already auto-extracts UUID (via 
ClassDataTypeConverter), because a plain
java.util.UUID field there otherwise requires an explicit RAW annotation, so 
there is no silent
behavior change on that path. This ticket concerns only the DataStream API 
extraction.

Scope:
- Register UUID.class in BasicTypeInfo.TYPES (remove the "intentionally not 
registered" note added
  in FLINK-40490 and reference this ticket from any remaining migration note).
- Verify TypeExtractor maps a java.util.UUID field to UUID_TYPE_INFO.
- Add a note to the state migration / release documentation about the 
serializer change for
  existing java.util.UUID fields.

Related:
- Depends on FLINK-40490 (runtime serialization and codegen for UUID).
- Part of FLIP-604 (FLINK-40485).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to