Dataset Mappers¶
Dataset mappers create dimension mappings and use them to transform datasets, for example, to compute aggregations or remap data to different dimensions using a dataset query.
Dimension mappings are also central to other dsgrid workflows, particularly when submitting datasets to projects and when running project-level queries. The mapping documentation linked from this page covers the shared concepts, types, and mechanics that apply across all of these contexts.
Prerequisites¶
Install dsgrid on your system
A registered dataset in the dsgrid registry
Familiarity with the dataset’s dimension records
Familiarity with, or an IDE extension for, JSON5 syntax
Workflow Overview¶
Understand dimension mappings — Read Dimension Mapping Concepts to learn how dsgrid translates between dimension systems, how mapping configs are structured, and how to register mappings.
Identify target dimensions — Determine which dimensions to map to. Use How to Browse the Registry to inspect available dimensions and compare them with your dataset’s dimensions.
Choose mapping types — Review Dimension Mapping Types to select the right type for each dimension (one-to-one, many-to-one aggregation, many-to-many explicit multipliers, etc.).
Create and register mappings — Write CSV mapping files and mapping configs, then register them. Follow How to Create Dimension Mappings for the step-by-step process.
Run a dataset query — Use
dsgrid query dataset create-queryto generate a query template, populate it with target dimensions, and run it withdsgrid query dataset run. See Dataset Query Concepts for how this works and the Query a Dataset tutorial for a walkthrough.
When You Need Apache Spark¶
dsgrid uses the DuckDB backend by default, which is sufficient for many dataset queries. Mapping can be computationally intensive for datasets with many records or fine-grained dimensions. If you are working with large datasets on NLR HPC:
Install the Spark extras:
pip install "dsgrid-toolkit[spark]"Select the Spark backend; see Selecting the Execution Backend