Skip to main content
This gem runs in .
Assigning unique identifiers to each row in a dataset is a common requirement for data preparation. The RecordID gem allows you to easily generate row-level IDs using two methods:
  • UUID for randomly generated values
  • Incremental ID for ordered, sequential values
You can customize how IDs are added, including naming the column, setting the data type and format, and specifying where the column appears in the output schema.
The gem has a corresponding interactive gem example. See Interactive gem examples to learn how to run sample pipelines for this and other gems.

Prerequisites

  • Add prophecy_basics package version 1.0.0 or higher to your project.

Input and Output

The RecordID gem accepts the following input and generates one output.

Parameters

Review the following gem parameters by method.

UUID

The UUID method assigns a universally unique identifier (UUID) to each row. These values are randomly generated and are ideal when you need non-sequential, non-predictable IDs.

Incremental ID

The Incremental ID method generates sequential values starting from a specified number and increasing by 1 for each row. You can also group and sort the data to restart numbering within each group and control the order in which IDs are assigned.