Skip to main content

Data Warehouse Validation

We run Data Warehouse Validations against your data warehouse to ensure that queries generated by MetricFlow won't fail, assuming the model has passed these validations before use. To keep things efficient, we use an EXPLAIN clause instead of executing the SQL query. BigQuery does not support EXPLAIN causes, so we dry run queries instead.

Data Source Validations

We run the following query to verify all data sources exist in your warehouse.

SELECT (TRUE) as col1 from table1

Dimension Validations

We run the following query to verify all dimensions specified in your data source are valid column names in the underlying SQL table or SQL query.

SELECT dim1 as col1, dim2 as col2 from table1 LIMIT 1

Metric Validation

We use generated SQL from your metrics to query your warehouse. The SQL query we execute looks like:

EXLAIN {sql_for_metric}

This ensures that the SQL generated from your metrics will execute. To see the generated SQL you can run the following commands in the CLI:

mql query --metrics <metric_name> --dimensions <primary_time_dimension> --explain