How Data Mappings Work
Data mappings use JSON paths to identify objects or arrays within JSONB columns. The path syntax uses JSONPath notation:'$'refers to the root object'$.metadata'refers to a property namedmetadatawithin the root'$.tags.tagList'refers to a nested propertytagListwithintags
An object or array will only be transformed if all of its parent paths are also mapped. For example, a mapping for
'$.a.b' requires mappings for both '$.a' and '$'.Create Data Mapping
Define a new mapping for data transformation.Syntax
Parameters
The type of data mapping. Currently only
json is supported.The table to transform (schema-qualified name).
The column containing JSON data to transform.
Path to a JSON object or array using JSONPath syntax (e.g.,
'$', '$.metadata', '$.tags.tagList').A short identifier to be used in naming the transformed data. Must be:
- All lowercase
- No more than 16 characters
- Unique for the transformed column (no two paths can map to the same identifier)
Examples
Basic JSON Transformation
Transform a JSON column by mapping the root object:Nested Object Transformation
Extract metadata from a nested object:Complete Hierarchical Mapping
To transform an array within nested objects, you must map all parent paths:Visual Example
For the following JSON structure:Drop Data Mapping
Remove a data mapping configuration.Syntax
Parameters
The type of data mapping (e.g.,
json).The table being transformed.
The column being transformed.
The JSON path to remove.
Example
Remove a data mapping:List Data Mappings
View all configured data mappings:Best Practices
Plan Your Mapping Hierarchy
Plan Your Mapping Hierarchy
Before creating mappings, plan the complete hierarchy of paths you need to extract. Remember that child paths require all parent paths to be mapped.
Use Meaningful Target Identifiers
Use Meaningful Target Identifiers
Choose target identifiers that clearly describe the data being extracted. This makes the resulting columns or tables easier to understand and query.
Keep Identifiers Short
Keep Identifiers Short
With a 16-character limit, use abbreviations when necessary but maintain clarity (e.g.,
'metadata' instead of 'meta_information').See Also
Data Sources
Configure external data sources
Alter Table
Modify table structures and data types
