type field on the request body:
| Type | Use when the target attribute is… |
|---|---|
value_mapping | A primitive (array, boolean, double, long, string, timestamptz) |
object_mapping | An object, with one expression per property |
cached_mapping | Resolved by joining the source dataset against a precomputed cache dataset at query time |
value_mapping
A single SQL expression that produces the target value from each row of the source dataset.Must be
"value_mapping".A SQL expression evaluated against the source dataset.
object_mapping
A set ofproperty_mappings, one per property of the target object attribute. Required properties of the attribute must be covered.
Must be
"object_mapping".One entry per target property. Each entry has:
path— dotted path into the target object (e.g.product.id.value)expression— SQL expression evaluated against the source dataset
cached_mapping
Acached_mapping does not compute the attribute value from each source row. Instead, NQL joins the source dataset to a separate cache dataset at query time and reads the precomputed value out of the cache’s output column.
Use a cached mapping when the transformation is expensive, depends on data outside the source dataset, or is produced by a workflow that writes its results into a dedicated cache dataset.
Must be
"cached_mapping".ID of the cache dataset to look up against. The dataset must already exist and be owned by the same company.
One or more SQL expressions evaluated against the source dataset to build the join key. Multi-column keys are concatenated with a separator at query time, so the cache dataset’s
input column must use the same encoding.Cache dataset requirements
The dataset referenced bycache_dataset_id must:
- Be owned by the same company creating the mapping.
- Expose an
inputcolumn that holds the join key (matching the encoding produced byinput_expressions). - Expose an
outputcolumn whose type matches the target attribute. NQL reads the attribute value directly from this column.
Constraints
- Company scope only.
cached_mappingis only accepted on the company-scoped create endpoint (POST /mappings/companies/{company_id}). Global mapping endpoints do not accept it. - Forbidden attributes. Cached mappings cannot target attributes used by the opt-out pipeline:
data_privacy_request_identifier,unique_id, oridentifier_relation. - No materialized fields. You cannot create a materialized field (
AttrorAttrSample) on top of a cached mapping, and you cannot convert an existing mapping to a cached mapping while an active materialized field references it. - No DELETE filters.
DELETEstatements whoseWHEREclause references an attribute backed by a cached mapping returnUnsupportedQuery: DELETE on cached mappings not yet supported. - Preview is empty.
POST /mappings/testreturns{ "records": [] }for cached mappings — there is no per-source-row preview because the lookup is resolved at query time.
Testing a mapping
POST /mappings/test accepts the same request shape as create and returns sampled, mapped output. For value_mapping and object_mapping the response includes one entry per sampled source row with both the original input and the transformed output. For cached_mapping the response is always { "records": [] }.
Related content
Mapping schemas
Walk through the UI and API for creating mappings.
Transformation functions
Functions available in mapping expressions.
How Rosetta Stone works
Background on attributes, mappings, and normalization.
Attribute types
The target shapes a mapping can produce.

