JSON path as a way to map JSON fields to your table schema
Modern data is often semi-structured and nested, typically in JSON format. Airfold makes it easy to work with this kind of data using JSON mapping, which lets you define columns in your schema and map them directly to paths within the incoming JSON payload. This allows you to ingest complex, nested data straight from the source into Airfold, no preprocessing required.
$
, which refers to the root of the JSON document.
indicate traversal to a child property[]
can access elements in arraysThe following JSON is a typical JSON payload response from OpenAI:
Airfold can ingest raw data like this by mapping this object to columns in the destination table:
This schema has a combination of
Note: If a key in the JSON is located at the root level and you want to keep the same column name, you don’t need to specify a mapping path, Airfold will match it automatically e.g. the id key/field in the above example.
If you want to set the column name as something different, (let’s call it user_id
instead of user
) you can do so like this:
In the UI, you can auto-generate a suggested JSON mapping by uploading a sample JSON object.
Create a new Source and choose Text
to create schema from a text sample.
Check out the resulting schema.
Rename columns if needed.
Add name to the source and click Create
to create the source.
You can remove lines from the schema to remove field mappings that you do not want to populate your table with. You can add new mappings too. Or store the JSON object as it is, with a JSON data type column.
JSON path as a way to map JSON fields to your table schema
Modern data is often semi-structured and nested, typically in JSON format. Airfold makes it easy to work with this kind of data using JSON mapping, which lets you define columns in your schema and map them directly to paths within the incoming JSON payload. This allows you to ingest complex, nested data straight from the source into Airfold, no preprocessing required.
$
, which refers to the root of the JSON document.
indicate traversal to a child property[]
can access elements in arraysThe following JSON is a typical JSON payload response from OpenAI:
Airfold can ingest raw data like this by mapping this object to columns in the destination table:
This schema has a combination of
Note: If a key in the JSON is located at the root level and you want to keep the same column name, you don’t need to specify a mapping path, Airfold will match it automatically e.g. the id key/field in the above example.
If you want to set the column name as something different, (let’s call it user_id
instead of user
) you can do so like this:
In the UI, you can auto-generate a suggested JSON mapping by uploading a sample JSON object.
Create a new Source and choose Text
to create schema from a text sample.
Check out the resulting schema.
Rename columns if needed.
Add name to the source and click Create
to create the source.
You can remove lines from the schema to remove field mappings that you do not want to populate your table with. You can add new mappings too. Or store the JSON object as it is, with a JSON data type column.