Sequence

On this Page

Overview

This Snap is used to generate a sequence of numbers. This sequence can start at any positive or negative integer and continue to provide new numbers by adding the step value to the previously generated number. 

The Snap does not require any input. However, if input is passed, it generates a sequence where the number of output documents is equal to the number of input documents. 

The Snap supports only pipeline parameters.

Input and Output

  • Expected input: Optional. A document containing the initial value of the sequence and the increment value that you want to use to create the sequence.
  • Expected output: A document containing the sequence generated using the input parameters.
  • Expected upstream Snaps: Any Snap that offers documents. For example, JSON Parser, JSON Splitter, or Mapper.
  • Expected downstream Snaps: Any Snap that accepts documents. For example, Join, or a combination of JSON Formatter and File Writer.

Prerequisites

None.

Configuring Accounts

Accounts are not used with this Snap.

Configuring Views

Input

This Snap has at most one document input view.
OutputThis Snap has exactly one document output view.
ErrorThis Snap has at most one document error view.

Troubleshooting

  • None.

Support

  • Works in Ultra pipelines.

Known Issues

  • None.

Snap Settings


LabelRequired. The name for the Snap. Modify this to be more specific, especially if there are more than one of the same Snap in the pipeline.
Initial value

Required. The initial value of the sequence.

Example

  • 0
  • _initialValue

Default value: 1

Step value

Required. This property increments (or decrements if negative) the sequence value by this amount to produce the next sequence value.
Example

  • -1 (negative value)
  • 1 (positive value)
  • _stepValue

Default value: 1

Number of documentsRequired. The number of documents to generate.
Example
  • 10
  • _numberOfDocuments

Default value:  1

The value in this property is ignored if an input dataset is provided to the Snap. In such cases, the number of documents in the output is equal to the number of documents in the input.

Pass through

Set this option to determine if input data should be passed through or not.

Default value: Not selected

Snap Execution

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default Value: Execute only
Example: Validate & Execute

Examples


Sequence Snap without Input

The pipeline, Sequence_Snap_Without_Input_Data, demonstrates a basic Sequence Snap without any input data. Upon execution, the Snap generates a sequence of numbers based on the Snap's settings.

Click here to download this pipeline. You can also downloaded this pipeline from the Downloads section below.


 Explanation: Sequence Snap Without Input

The pipeline is as shown below:

The Sequence Snap is configured as shown below:

The initial value is -10 and this is incremented by 1 to output a total 50 records. The output from the Sequence Snap is a sequence of numbers -10, -9, -8, and so on, as shown below:


The downstream Snaps are configured to demonstrate a typical use case for the Sequence Snap. In this example, an Aggregate Snap, and two filter Snaps are used. The Aggregate Snap is configured to show the total number of records, and the Filter Snaps are configured to filter negative and positive integers. Their outputs are as shown below: 


Click here to download this Pipeline. You can also downloaded this pipeline from the Downloads section below.

Sequence Snap with Input

The pipeline, Sequence_Snap_with_Input_Data, demonstrates how the Sequence Snap functions when there is an input. Upon execution, the Snap generates a sequence of numbers based on the Snap's configuration. However, the number of records output by the Snap is the same as the number of input records.

Click here to download this pipeline. You can also downloaded this pipeline from the Downloads section below.


 Explanation: Sequence Snap with input

The pipeline is as shown below:

The CSV Generator Snap passes a CSV file containing 9 records to the Sequence Snap, Sequence with Input. The other Sequence Snap, Sequence Without Input, is configured with the same values as the other Sequence Snap. Outputs from both Snaps are shown to demonstrate that the total records in the output vary according to the Snap's input. 

The input to the Sequence with Input Snap is as shown below:


The Sequence Snap is configured as shown below:


Based on the Snap's configuration, the output sequence starts from 1 with increments of 10. Even though the Number of documents property is configured as 1, the output contains a sequence of 9 records, same as the number of input records. The original data from the input is also shown under "original" in the output, you may use a Mapper Snap downstream to capture this original data as per your requirements.


The second Sequence Snap, Sequence Without input, is configured with the same values as the first Sequence Snap.

Based on the Snap's configuration, the output contains only one record, as shown below: 

This demonstrates that the number of records in the Sequence Snap's output depends on the number of records in the input. 

Click here to download this Pipeline. You can also downloaded this pipeline from the Downloads section below.

Downloads

Important steps to successfully reuse Pipelines

  1. Download and import the pipeline into the SnapLogic application.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.

  File Modified

File Sequence_Snap_Without_Input_Data.slp

Dec 31, 2018 by Rakesh Chaudhary

File Sequence_Snap_with_Input_Data.slp

Dec 31, 2018 by Rakesh Chaudhary


 Click to view/expand
ReleaseSnap Pack VersionDateType Updates
August 2024438patches28073 Latest

Fixed an issue with the JSON Generator and XML Generator Snaps that caused unexpected output displaying '__at__' and '__h__' instead of '@' and '-' respectively because the Snap could not update them to their original values after the Velocity library upgrade.

August 2024438patches27959 Latest

Fixed an issue with the Sort where the Snap could not sort files larger than 52 MB. This fix applies to Join Snap also.

August 2024main27765 StableUpgraded the org.json.json library from v20090211 to v20240303, which is fully backward compatible.
May 2024437patches26643 Latest
  • Fixed an issue with the Sort Snap that displayed an error when estimating the size of the input document provided by the upstream S3 Browser Snap.
  • Fixed an issue with the Parquet Formatter Snap that was unable to route errors to the error view.
May 2024437patches26453 Latest
  • Added expression support to the Skip lines field in the CSV Parser Snap to enable passing pipeline parameters and upstream values. 

  • Fixed an issue with the XML Parser Snap that caused an error when using the Splitter option in the Snap settings. 

May 2024main26341 Stable
  • Added Parquet Parser and Parquet Formatter Snaps to the Transform Snap Pack:
    • Parquet Parser: Reads the binary Parquet data and writes document data to the output.
    • Parquet Formatter: Reads the document data and writes it to the output in binary Parquet format.
  • Enhanced the JSON Splitter Snap to capture metadata and lineage information from the input document.

February 2024436patches25564 Latest

Fixed an issue with the JSON Formatter Snap that generated incorrect schema.

February 2024436patches25292 Latest

Fixed an out-of-memory error issue with the Aggregate Snap. This Snap no longer performs the presort for the input documents.

If the input documents are unsorted and GROUP-BY fields are used, you must use the Sort Snap upstream of the Aggregate Snap to presort the input document stream and set the Sorted stream field Ascending or Descending to prevent the out-of-memory error. However, if the total size of input documents is expected to be relatively small compared to the available memory, then Sort Snap is not required upstream.

Learn more about presorting unsorted input documents to be processed by the Aggregate Snap.

February 2024main25112 StableUpdated and certified against the current SnapLogic Platform release.
November 2023435patches24802 LatestFixed an issue with the Excel Parser Snap that caused a null pointer exception when the input data was an Excel file that did not contain a StylesTable.
November 2023435patches24481 Latest

Fixed an issue with the Aggregate Snap where the Snap was unable to produce the desired number of output documents when the input was unsorted and the GROUP-BY fields field set was used.

November 2023435patches24094 Latest

Fixed a deserialization issue for a unique function in the Aggregate Snap.

November 2023main23721 StableUpdated and certified against the current SnapLogic Platform release.
August 2023434patches23076 LatestFixed an issue with the Binary to Document Snap where an empty input document with Ignore Empty Stream selected caused the Snap to stop executing.
August 2023434patches23034 Latest
  • Fixed an issue with the Transform Snap Pack that caused an error when the input file was a binary JSON file that contained a string value of more than 20,000,000 characters.
  • Fixed a memory issue with the Aggregate Snap that occurred when using GROUP-BY fields.

August 2023434patches22705 Latest

Fixed an issue with the JSON Splitter Snap that caused the pipeline to terminate with excessive memory usage on the Snaplex node after the 4.33 GA upgrade. The Snap now consumes less memory.

August 2023main22460 StableUpdated and certified against the current SnapLogic Platform release.
May 2023433patches22431 Latest
  • Fixed an issue with the Excel Multi Sheet Formatter Snap that caused it to produce binary output data when there was no input document and Ignore empty stream was selected.
  • Introduced the following new Snaps:
    • GeoJSON Parser: Parses geospatial data from binary data input and outputs the contents as a GeoJSON document downstream.

    • WKT Parser: Parses geospatial data from binary data input and outputs the contents as a WKT (Well Known Text) document downstream.

May 2023433patches21779 Latest

The Decrypt Field and Encrypt Field Snaps now support CTR (Counter mode) for the AES (Advanced Encryption Standard) block cipher algorithm.

May 2023433patches21586 Latest

The Decrypt Field Snap now supports the decryption of various encrypted fields on providing a valid decryption key.

May 2023433patches21461 Latest

The following Transform Snaps include new fields to improve memory management: Aggregate, Group By Fields, Group By N, Join, Sort, Unique.

May 2023433patches21336 Latest

Fixed an issue with the AutoPrep Snap where dates could potentially be rendered in a currency format because currency format options were displayed for the DOB column.

May 2023433patches21196 Latest

Enhanced the In-Memory Lookup Snap with the following new fields to improve memory management and help reduce the possibility of out-of-memory failures:

  • Minimum memory (MB)

  • Out-of-memory timeout (minutes)

These new fields replace the Maximum memory % field.

May 2023main21015 StableUpgraded with the latest SnapLogic Platform release.
February 2023432patches20535 Latest

Fixed an issue with the Encrypt Field Snap, where the Snap failed to support an RSA public key to encrypt a message or field. Now the Snap supports the RSA public key to encrypt the message.

February 2023432patches20446 Latest

The Join Snap is enhanced with the following:

  • The Pipeline Execution