Parquet Formatter

Overview

You can use this Snap to read both the input document data and write the data in the binary (Parquet) format to the output.



Prerequisites

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input Requires document data as input.
Note: You can override the schema setting by inserting an object like this into the second input view.
Output Writes the document data in the binary (Parquet) format to the output.
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:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Parquet Formatter

Example: Parquet Formatter

Edit Schema Button

Specify a valid Parquet schema that describes the data.

The following is an example of a schema using all the primitive and some examples of logical types:

message document {
  # Primitive Types
  optional int64 32_num;
  optional int64 64_num;
  optional boolean truth;
  optional binary message;
  optional float pi;
  optional double e;
  optional int96 96_num;
  optional fixed_len_byte_array (1) one_byte;
  # Logical Types
  optional binary snowman (UTF8);
  optional int32 8_num (INT_8);
  optional int32 16_num (INT_16);
  optional int32 u8_num (UINT_8);
  optional int32 u16_num (UINT_16);
  optional int32 u32_num (UINT_32);
  optional int64 u64_num (UINT_64);
  optional int32 dec_num (DECIMAL(5,2));
  optional int32 jan7 (DATE);
  optional int32 noon (TIME_MILLIS);
  optional int64 jan7_epoch (TIMESTAMP_MILLIS);
  optional binary embedded (JSON);
}
Note: "Generate template" does not support nested structures like MAP and LIST type.
Compression Dropdown list
Choose the type of compression to use when writing the file. The available options are:
  • NONE
  • SNAPPY
  • GZIP
Note: Many compression algorithms require both Java and system libraries, and the algorithms fail if the latter is not installed. If you see unexpected errors, ask your system administrator to verify if all the required system libraries are installed because they are typically not installed by default. The system libraries have names such as liblzo2.so.2 or libsnappy.so.1 and can be located in the /usr/lib/x86_64-linux-gnu directory.

Default value: None

Example: SNAPPY
Decimal rounding mode Dropdown list
Choose the required rounding method for decimal values when they exceed the required number of decimal places. The following are the available options:
  • Half up
  • Half down
  • Half even
  • Up
  • Down
  • Ceiling
  • Floor
  • Truncate

Default value: Half up

Example: Up
Snap execution Dropdown list
Choose 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

Schema Model for the Parquet Parser Second Output View

{
   "schema": "message document 
   {\n  optional binary AUTOSYNC_PRIMARYKEY (STRING);
   \n  optional binary AUTOSYNC_VALUEHASH (STRING);
   \n  optional binary AUTOSYNC_CURRENTRECORDFLAG (STRING);
   \n  optional int64 AUTOSYNC_EFFECTIVEBEGINTIME (TIMESTAMP(MILLIS,true));
   \n  optional int64 AUTOSYNC_EFFECTIVEENDTIME (TIMESTAMP(MILLIS,true));
   \n  optional double ID1;\n  optional binary ID2 (STRING);
   \n  optional binary ID3 (STRING);
   \n  optional binary ID4 (STRING);\n  optional binary ID5 (STRING);
   \n  optional binary ID6 (STRING);\n  optional binary ID7 (STRING);
   \n  optional binary ID8;\n  optional double ID9;
   \n  optional double ID10;
   \n  optional double ID11;\n  optional double ID12;
   \n  optional double ID13;\n  optional double ID14;
   \n  optional int32 ID15 (DATE);\n  optional int64 ID16 (TIMESTAMP(MILLIS,true));
   \n  optional int64 ID17 (TIMESTAMP(MILLIS,true));
   \n  optional int64 ID18 (TIMESTAMP(MILLIS,true));
   \n  optional double ID100;
   \n}
   \n"
}

Examples