In this article
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Passing Binary Data
You can convert binary data to document data by adding the Binary-to-Document Snap upstream of the Mapper Snap. Similarly, to convert the document output of the Mapper Snap to binary data, add the Document-to-Binary Snap downstream of the Mapper Snap.
You can also transform binary data to document data within the Mapper Snap itself by using the
$content
expression.
Binary Input and Output
If you are only working with a binary stream as both input and output, you must set both source and target fields with
$content
, then manipulate the binary data using the Expression Builder. If you do not specify this mapping, then the binary stream from the binary input document is passed through without any change.
Snap Type
The Mapper Snap is a Transform-type Snap that transforms data and passes it to the downstream Snap.
...
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)
are displayed asInfinity
in the input/output previews. However, you can see the exact evaluated values in the validation previews. Learn more: Java Script Limitations in Displaying Numbers.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input |
|
| Binary-to-Document | This Snap can have a 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, this Snap has Document as Input Type. You can select Binary type if your input is in Binary format. |
Output |
|
| Any Document Snap | This Snap has exactly one document or binary output view. By default, this Snap has Document as Output Type. You can select Binary type to view the output in Binary format. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
...
If the Escape Character is | Use Expression | Sample Output | ||
---|---|---|---|---|
Single quote (') | JSON: $original.mapValues((value,key)=> value.toString().replaceAll("'","''")) OR $original.mapValues((value,key)=> value.toString().replaceAll("'","\''")) CSV: $[' Business-Name'].replace ("'","''") | |||
Ampersand (&) | JSON: $original.mapValues((value,key)=> value.toString().replaceAll("'","\&'")) OR $original.mapValues((value,key)=> value.toString().replaceAll("'","&'")) CSV: $[' Business-Name'].replace ("'","&'") | |||
Backslash (\) | JSON: $original.mapValues((value,key)=> value.toString().replaceAll("'","\\'"))
CSV: $[' Business-Name'].replace ("'","\\'") |
In this way, you can customize the data to be passed on to downstream Snaps using the Expression field in the Mapper Snap.
...
Community Links:
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|