Athena Bulk Upsert

Overview

You can use this Snap to update or insert input data into an ICEBERG table. You can also delete rows that match the specified condition. It works by first creating a temporary Athena table from the input data, and then executing a MERGE INTO query to apply the update, insert, or delete operations to the target ICEBERG table.
Important: This Snap supports only ICEBERG tables, as the MERGE INTO query is supported exclusively for ICEBERG table formats in Athena.

Athena Bulk Upsert Overview

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has one document input views. All input documents are written into S3 files in ORC or Parquet format.
Output This Snap has one document output view.
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 Account configuration.
  • 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: Athena Bulk Upsert

Example: Athena Bulk Upsert - Client list
Database String/Expression/ Suggestion

Required. Specify the name of the Athena database, that is a logical grouping of Athena tables.

Default value: N/A

Example: mydatabase
Table String/Expression/ Suggestion

Required. Specify the target Athena table to perform bulk update or insert operation.

Default value: N/A

Example: Sales_db
Key columns Required. Use this field set to specify key column names that match values between the input data and the target table.
Important:
  • If the input data includes key column values that match existing rows in the target table, the Snap updates those rows. If no match is found, it inserts new rows.
  • If the input data does not include a field for the key column, its value is treated as null.
Column String/Expression/ Suggestion

Required. Specify the list of column names to match values from input data and target table.

Default value: N/A

Example: partnername
Delete condition String/Expression/ Suggestion Specify a condition to delete rows from the target table when key column values match this condition.
Important:
  • Prefix the target column names for the Delete condition with a t. and source/input column names with an s. .
  • A row is deleted only when both of the following conditions are met:
    • The input data contains key column values that match a row in the target table.
    • The Delete condition evaluates to true for that row.
  • If this field is left blank, no rows will be deleted.

Default value: N/A

Example: t.id=s.userid
Client settings Use this field set to define the client settings.
Maximum retries Integer/Expression Required. Specify the maximum number of retry attempts.

Default value: 3

Example: 10

Multipart size (MB) Integer/Expression Required. Specify the size of each part in megabytes (MB) used during S3 multipart upload.
Important: The maximum number of parts in the S3 multipart upload is 10,000. Therefore, if the expected S3 object is larger than 100 GB, you must enter a value larger than 10. The maximum size of S3 object is 5 TB.

Minimum value: 5

Maximum value: 5000

Default value: 10

Example: 100

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

Default value: Validate & Execute

Troubleshooting

It is not an Iceberg table: %s

Athena Bulk Upsert Snap supports only Iceberg table type.

Use an Iceberg table in the Table field.

Examples