Mapper

In this article

Overview

Use this Snap to transform incoming data with the specific mappings and produce new output data (binary or document). The Mapper Snap evaluates an expression and writes the result to the target path. Use the Views tab to specify error handling if an expression fails to evaluate. 

Pass Binary Data

  • To convert binary data to document data add the Binary-to-Document Snap upstream of the Mapper Snap. Similarly, add the Document-to-Binary Snap downstream of the Mapper Snap to convert the document output to binary data.

  • You can also transform binary data to document data in the Mapper Snap itself with the $content expression. 

Binary Input and Output

  • If you only work with a binary stream as both input and output, you must set both source and target fields with $content, then use the Expression Builder to manipulate the binary data. If you do not specify this mapping, then the binary stream from the binary input document passes through with no change.

Snap Type

The Mapper Snap is a Transform-type Snap that transforms data and passes it to the downstream Snap.

Support for Ultra Pipelines

Works in Ultra Pipelines.

Limitations

  • The Mapper Snap does not support Base64URL decoding.

  • Expressions used in this Snap (downstream of any Snowflake Snaps) that evaluate to very large values such as EXP(900) displays as Infinity in the input/output previews. However, the exact evaluated values are in the validation previews. Learn more: JavaScript Limitations in Displaying Numbers.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

  • Document

  • Binary

 

  • Min: 0

  • Max: 1

Binary-to-Document

This Snap can have at most one document or binary input view. If you do not specify an input view, the Snap generates a downstream flow of one row.

By default, the Input type is Document. You can select Binary type if your input is in Binary format.

Output

  • Document

  • Binary

 

  • Min: 1

  • Max: 1

Any Document Snap

This Snap has exactly one document or binary output view.