Generate UUID directive
Recommended: The Generate UUID directive has an incorrect implementation which causes conflicts in the generated UUID (see CDAP-17732). For CDAP 6.3.0 and earlier, use the Add Field transformation to add a unique id field to each record.
The GENERATE-UUID directive generates a universally unique identifier (UUID) of the record.
Syntax
generate-uuid :column
The column
is set to the UUID generated for the record.
Usage Notes
The GENERATE-UUID directive generates a type 4, pseudo-randomly generated UUID. The UUID is generated using a cryptographically strong pseudo-random number generator.
Example
Using this record as an example, where you would like to generate a random identifier for the record to uniquely identify it:
{
"x": 1,
"y": 2
}
Applying this directive:
generate-uuid :uuid
results in a record similar to this (the value of uuid
will vary):
Created in 2020 by Google Inc.