Skip to content

Construct Variant

The Construct Variant transformation component lets you convert existing rows of data into arrays of key:value pairs. The key:value pairs are then output in a new column as variant-type data. This allows you to store semi-structured data formats like JSON or XML within a relational database.

Each value in the new column takes the form of a Snowflake object. See OBJECT_CONSTRUCT for more information.

Use case

This component can be useful when storing or processing data that doesn't fit into a table structure. For example, you can use it to:

  • Store data that doesn't conform to a standard schema, such as patient and treatment data in healthcare settings.
  • Store data from multiple sources, such as customer feedback collected from emails, surveys, and social media, regardless of the original format.

Properties

Name = string

A human-readable name for the component.


Column Mappings = column editor

Select pairings for Source and Target columns. In the resulting Key:Value pairs, the Values are taken from the Source columns and the Keys are the Target column names.

Click the Add all button to automatically populate the Source and Target columns with all the column names from the input source. You can then selectively edit the list if required, but if you click Add all again it will return the list to the default fully populated state, removing any changes you have made.


Output Slot string

The name of the outputted constructed variant column.