manner opened a new pull request, #29154:
URL: https://github.com/apache/flink/pull/29154
## What is the purpose of the change
This pull request adds two new built-in SQL scalar functions, `UUID_V4()`
and `UUID_V7()`, generating RFC 9562 UUID values — a random version 4 UUID and
a time-ordered version 7 UUID.
## Brief change log
- Added `BuiltInFunctionDefinitions.UUID_V4` / `UUID_V7`
- Added `UuidGenerationUtils` with `generateV4()`/`generateV7()`,
producing the 16-byte internal representation of a `UUID` value directly (no
round-trip through `java.util.UUID`)
- Added `UuidV4Function` / `UuidV7Function` runtime classes
- Added `uuidV4()` / `uuidV7()` to the Java and Scala Table API expression
DSL
- Documented both functions in `sql_functions.yml` (English and Chinese)
## Verifying this change
This change added tests and can be verified as follows:
- Added `UuidGenerationUtilsTest`, directly asserting on the generated
bytes: correct length, version nibble, variant bits, and (for v7) that the
embedded timestamp matches `System.currentTimeMillis()` at call time
- Added `UuidFunctionsITCase`, covering the SQL and Table API return type
(`UUID`) and the version nibble in the canonical string form, executed
end-to-end against a MiniCluster
## 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** — `Expressions.java` (`@PublicEvolving`) gains two
new additive methods, `uuidV4()` and `uuidV7()`
- The serializers: **no**
- The runtime per-record code paths (performance sensitive): yes — only
exercised when a query explicitly calls `UUID_V4()`/`UUID_V7()`
- 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** (`sql_functions.yml`)
and JavaDocs
---
##### 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]