Add sequence

(warning) PLEASE NOTE: This documentation applies to an earlier version. For the most recent documentation, visit the Pentaho Enterprise Edition documentation site.

Description

The Add sequence step adds a sequence to the stream. A sequence is an ever-changing integer value with a specific start and increment value. You can either use a database sequence to determine the value of the sequence, or have it generated by Kettle.

Notes:

  • Kettle sequences are unique only when used in the same transformation. Also, they are not stored, so the values start back at the same value every time the transformation is launched.
  • When you need a unique ID in a clustered environment, have a look at the step Get ID from Slave Server.
  • see also: Add value fields changing sequence - Adds a sequence depending on if fields value change; each time value of at least one field change, PDI will reset sequence.
  • see also: Group by step - Builds aggregates in a group by fashion and generate sequential numbers within rows with repeating values.

Options

The table below contains the options for the Add Sequence step:

Option

Description

Step name

The name of this step as it appears in the transformation workspace. This name must be unique within a single transformation.

Name of value

Name of the new sequence value that is added to the stream.

Use DB to generate the sequence

Enable if you want the sequence to be driven by a database sequence, then set these parameters: Connection name, Schema name (optional), Sequence name.

Connection name

The name of the connection on which the database sequence resides.

Schema name (optional)

The table's schema name.

Sequence name

The name of the database sequence.

Use a transformation counter to generate the sequence

Enable if you want the sequence to be generated by Kettle, then set these parameters: Counter name (optional), Start at, Increment by, Maximum value.

Counter name (optional)

If multiple steps in a transformation generate the same value name, this option enables you to specify the name of the counter to associate with. Avoids forcing unique sequencing across multiple steps.

Start at

The value to begin the sequence with.

Increment by

The amount by which the sequence increases or decreases.

Maximum value

The value after which the sequence returns to the Start At value.

Examples:

Start at = 1, increment by = 1, max value = 3

This will produce: 1, 2, 3, 1, 2, 3, 1, 2...

Start at = 0, increment by = -1, max value = -2

This will produce: 0, -1, -2, 0, -1, -2, 0...|