Send event data that is not defined by a fixed schema.
With RudderStack’s JSON column support feature, you can ingest semi-structured event data that is not defined by a fixed schema. Also, you can directly store a nested event payload without worrying about the length limit in your warehouse columns.
The JSON column feature is supported by the following warehouse destinations:
The JSON column feature supports only track events.
Using the JSON column feature
You can use the JSON column feature using any of the following approaches:
Declaring JSON columns at the event level
You can use the SDK’s integrations: options parameter to specify the JSON columns at the event level. The following example demonstrates the use of the JavaScript SDK’sIntegrationOpts parameter to declare the JSON columns:
Here, nestedMap is declared as a JSON column and is in the following format:
{"testMap":{"nestedMap":{"sample":{"dynamic_property_1":"value_1","dynamic_property_2":"value_2",..."dynamic_property_n":"value_n"}}}}// To declare nestedMap as a JSON column, add "testMap.nestedMap" in the above list.
Make sure you configure the SDK to load the options parameter by default. Refer to the following SDK guides for more context:
The above transformation applies the JSON column to only product_clicked type of track events coming from a particular sourceId.
The JSON columns declared at the event level can be overridden by the JSON columns declared using a custom transformation.
Declaring JSON columns during destination configuration
While configuring your warehouse destination settings in RudderStack, you can pass the required JSON column paths using the dot notation and separated by a comma in the JSON columns field as shown:
This option applies to all track events sent to the warehouse destination.
Semi-structured data usage and limitations
For warehouse-specific information on working with semi-structured data and the associated limitations, refer to the following guides:
The JSON column feature supports only track events.
Which data types are supported in this feature?
The JSON data type includes String, Integers, Float, Arrays, Booleans, and Maps.
How can I use the JSON column feature in BigQuery?
Google BigQuery has released JSON support only as a preview feature. Hence, RudderStack will treat the JSON columns as strings and insert the JSON strings as the values. You can use the JSON functions to query the semi-structured data.
How does RudderStack determine the column data type? Can I change an existing data type for a column?
RudderStack determines the data type of a column based on its value in the first event (during the first upload sync).
For example, suppose column_x is received with the value as 1. RudderStack then sets the data type of this column as int in the event table.
Although you can change the columns’ data type in the warehouse any time, the changes will be applicable to the events from the next sync.
To set your preferred data type for a particular column, it is highly recommended to follow these steps:
Create a column in the warehouse with a dummy name and the required data type.
Cast the data from the original column and load it into the dummy column.
Drop the original column.
Rename the dummy column to the original column name.
During steps 3 and 4, the tables will be in a locked state. This might impact real-time data uploads/syncs.
If the above steps take too long to complete, you can halt the warehouse operations in the interim. For more information, refer to this FAQ.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.