Last updated: July 22, 2025
Sql invalid value count on column data quality checks, SQL examples
A column-level check that uses a custom SQL query that return invalid values from column. This check is used for setting testing queries or ready queries used by users in their own systems (legacy SQL queries). Use the {table} token to reference the tested table, and the {column} to reference the column that is tested. For example, when this check is applied on a column. The condition can find invalid values in the column which have values lower than 18 using an SQL query: `SELECT {column} FROM {table} WHERE {column} < 18`.
The sql invalid value count on column data quality check has the following variants for each type of data quality checks supported by DQOps.
profile sql invalid value count on column
Check description
Runs a custom query that retrieves invalid values found in a column and returns the number of them, and raises an issue if too many failures were detected. This check is used for setting testing queries or ready queries used by users in their own systems (legacy SQL queries). For example, when this check is applied on a column. The condition can find invalid values in the column which have values lower than 18 using an SQL query: `SELECT {column} FROM {table} WHERE {column} < 18`.
Data quality check name | Friendly name | Category | Check type | Time scale | Quality dimension | Sensor definition | Quality rule | Standard |
---|---|---|---|---|---|---|---|---|
profile_sql_invalid_value_count_on_column |
Custom SELECT SQL that returns invalid values | custom_sql | profiling | Validity | sql_invalid_value_count | max_count |
Command-line examples
Please expand the section below to see the DQOps command-line examples to run or activate the profile sql invalid value count on column data quality check.
Managing profile sql invalid value count on column check from DQOps shell
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the warning rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=profile_sql_invalid_value_count_on_column --enable-warning
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=profile_sql_invalid_value_count_on_column --enable-warning
Additional rule parameters are passed using the -Wrule_parameter_name=value.
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the error rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=profile_sql_invalid_value_count_on_column --enable-error
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=profile_sql_invalid_value_count_on_column --enable-error
Additional rule parameters are passed using the -Erule_parameter_name=value.
Run this data quality check using the check run CLI command by providing the check name and all other targeting filters. The following example shows how to run the profile_sql_invalid_value_count_on_column check on all tables and columns on a single data source.
It is also possible to run this check on a specific connection and table. In order to do this, use the connection name and the full table name parameters.
dqo> check run -c=connection_name -t=schema_name.table_name -ch=profile_sql_invalid_value_count_on_column
You can also run this check on all tables (and columns) on which the profile_sql_invalid_value_count_on_column check is enabled using patterns to find tables.
YAML configuration
The sample schema_name.table_name.dqotable.yaml file with the check configured is shown below.
# yaml-language-server: $schema=https://cloud.dqops.com/dqo-yaml-schema/TableYaml-schema.json
apiVersion: dqo/v1
kind: table
spec:
columns:
target_column:
profiling_checks:
custom_sql:
profile_sql_invalid_value_count_on_column:
parameters:
sql_query: |-
SELECT age AS actual_value
FROM customers
WHERE age < 18
warning:
max_count: 0
error:
max_count: 10
fatal:
max_count: 100
labels:
- This is the column that is analyzed for data quality issues
Samples of generated SQL queries for each data source type
Please expand the database engine name section to see the SQL query rendered by a Jinja2 template for the sql_invalid_value_count data quality sensor.
BigQuery
{% import '/dialects/bigquery.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
ClickHouse
{% import '/dialects/clickhouse.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Databricks
{% import '/dialects/databricks.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
DB2
DuckDB
{% import '/dialects/duckdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
HANA
{% import '/dialects/hana.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MariaDB
{% import '/dialects/mariadb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MySQL
{% import '/dialects/mysql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Oracle
PostgreSQL
{% import '/dialects/postgresql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Presto
{% import '/dialects/presto.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
QuestDB
{% import '/dialects/questdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Redshift
{% import '/dialects/redshift.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Snowflake
{% import '/dialects/snowflake.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Spark
{% import '/dialects/spark.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
SQL Server
{% import '/dialects/sqlserver.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Teradata
{% import '/dialects/teradata.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Trino
{% import '/dialects/trino.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
daily sql invalid value count on column
Check description
Runs a custom query that retrieves invalid values found in a column and returns the number of them, and raises an issue if too many failures were detected. This check is used for setting testing queries or ready queries used by users in their own systems (legacy SQL queries). For example, when this check is applied on a column. The condition can find invalid values in the column which have values lower than 18 using an SQL query: `SELECT {column} FROM {table} WHERE {column} < 18`.
Data quality check name | Friendly name | Category | Check type | Time scale | Quality dimension | Sensor definition | Quality rule | Standard |
---|---|---|---|---|---|---|---|---|
daily_sql_invalid_value_count_on_column |
Custom SELECT SQL that returns invalid values | custom_sql | monitoring | daily | Validity | sql_invalid_value_count | max_count |
Command-line examples
Please expand the section below to see the DQOps command-line examples to run or activate the daily sql invalid value count on column data quality check.
Managing daily sql invalid value count on column check from DQOps shell
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the warning rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=daily_sql_invalid_value_count_on_column --enable-warning
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=daily_sql_invalid_value_count_on_column --enable-warning
Additional rule parameters are passed using the -Wrule_parameter_name=value.
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the error rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=daily_sql_invalid_value_count_on_column --enable-error
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=daily_sql_invalid_value_count_on_column --enable-error
Additional rule parameters are passed using the -Erule_parameter_name=value.
Run this data quality check using the check run CLI command by providing the check name and all other targeting filters. The following example shows how to run the daily_sql_invalid_value_count_on_column check on all tables and columns on a single data source.
It is also possible to run this check on a specific connection and table. In order to do this, use the connection name and the full table name parameters.
dqo> check run -c=connection_name -t=schema_name.table_name -ch=daily_sql_invalid_value_count_on_column
You can also run this check on all tables (and columns) on which the daily_sql_invalid_value_count_on_column check is enabled using patterns to find tables.
YAML configuration
The sample schema_name.table_name.dqotable.yaml file with the check configured is shown below.
# yaml-language-server: $schema=https://cloud.dqops.com/dqo-yaml-schema/TableYaml-schema.json
apiVersion: dqo/v1
kind: table
spec:
columns:
target_column:
monitoring_checks:
daily:
custom_sql:
daily_sql_invalid_value_count_on_column:
parameters:
sql_query: |-
SELECT age AS actual_value
FROM customers
WHERE age < 18
warning:
max_count: 0
error:
max_count: 10
fatal:
max_count: 100
labels:
- This is the column that is analyzed for data quality issues
Samples of generated SQL queries for each data source type
Please expand the database engine name section to see the SQL query rendered by a Jinja2 template for the sql_invalid_value_count data quality sensor.
BigQuery
{% import '/dialects/bigquery.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
ClickHouse
{% import '/dialects/clickhouse.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Databricks
{% import '/dialects/databricks.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
DB2
DuckDB
{% import '/dialects/duckdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
HANA
{% import '/dialects/hana.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MariaDB
{% import '/dialects/mariadb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MySQL
{% import '/dialects/mysql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Oracle
PostgreSQL
{% import '/dialects/postgresql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Presto
{% import '/dialects/presto.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
QuestDB
{% import '/dialects/questdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Redshift
{% import '/dialects/redshift.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Snowflake
{% import '/dialects/snowflake.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Spark
{% import '/dialects/spark.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
SQL Server
{% import '/dialects/sqlserver.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Teradata
{% import '/dialects/teradata.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Trino
{% import '/dialects/trino.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
monthly sql invalid value count on column
Check description
Runs a custom query that retrieves invalid values found in a column and returns the number of them, and raises an issue if too many failures were detected. This check is used for setting testing queries or ready queries used by users in their own systems (legacy SQL queries). For example, when this check is applied on a column. The condition can find invalid values in the column which have values lower than 18 using an SQL query: `SELECT {column} FROM {table} WHERE {column} < 18`.
Data quality check name | Friendly name | Category | Check type | Time scale | Quality dimension | Sensor definition | Quality rule | Standard |
---|---|---|---|---|---|---|---|---|
monthly_sql_invalid_value_count_on_column |
Custom SELECT SQL that returns invalid values | custom_sql | monitoring | monthly | Validity | sql_invalid_value_count | max_count |
Command-line examples
Please expand the section below to see the DQOps command-line examples to run or activate the monthly sql invalid value count on column data quality check.
Managing monthly sql invalid value count on column check from DQOps shell
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the warning rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=monthly_sql_invalid_value_count_on_column --enable-warning
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=monthly_sql_invalid_value_count_on_column --enable-warning
Additional rule parameters are passed using the -Wrule_parameter_name=value.
Activate this data quality using the check activate CLI command, providing the connection name, table name, check name, and all other filters. Activates the error rule with the default parameters.
dqo> check activate -c=connection_name -t=schema_name.table_name -col=column_name -ch=monthly_sql_invalid_value_count_on_column --enable-error
You can also use patterns to activate the check on all matching tables and columns.
dqo> check activate -c=connection_name -t=schema_prefix*.fact_* -col=column_name -ch=monthly_sql_invalid_value_count_on_column --enable-error
Additional rule parameters are passed using the -Erule_parameter_name=value.
Run this data quality check using the check run CLI command by providing the check name and all other targeting filters. The following example shows how to run the monthly_sql_invalid_value_count_on_column check on all tables and columns on a single data source.
It is also possible to run this check on a specific connection and table. In order to do this, use the connection name and the full table name parameters.
dqo> check run -c=connection_name -t=schema_name.table_name -ch=monthly_sql_invalid_value_count_on_column
You can also run this check on all tables (and columns) on which the monthly_sql_invalid_value_count_on_column check is enabled using patterns to find tables.
YAML configuration
The sample schema_name.table_name.dqotable.yaml file with the check configured is shown below.
# yaml-language-server: $schema=https://cloud.dqops.com/dqo-yaml-schema/TableYaml-schema.json
apiVersion: dqo/v1
kind: table
spec:
columns:
target_column:
monitoring_checks:
monthly:
custom_sql:
monthly_sql_invalid_value_count_on_column:
parameters:
sql_query: |-
SELECT age AS actual_value
FROM customers
WHERE age < 18
warning:
max_count: 0
error:
max_count: 10
fatal:
max_count: 100
labels:
- This is the column that is analyzed for data quality issues
Samples of generated SQL queries for each data source type
Please expand the database engine name section to see the SQL query rendered by a Jinja2 template for the sql_invalid_value_count data quality sensor.
BigQuery
{% import '/dialects/bigquery.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
ClickHouse
{% import '/dialects/clickhouse.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Databricks
{% import '/dialects/databricks.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
DB2
DuckDB
{% import '/dialects/duckdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
HANA
{% import '/dialects/hana.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MariaDB
{% import '/dialects/mariadb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
MySQL
{% import '/dialects/mysql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Oracle
PostgreSQL
{% import '/dialects/postgresql.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Presto
{% import '/dialects/presto.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
QuestDB
{% import '/dialects/questdb.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Redshift
{% import '/dialects/redshift.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Snowflake
{% import '/dialects/snowflake.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Spark
{% import '/dialects/spark.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
SQL Server
{% import '/dialects/sqlserver.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Teradata
{% import '/dialects/teradata.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
Trino
{% import '/dialects/trino.sql.jinja2' as lib with context -%}
SELECT
COUNT(*) as actual_value
FROM (
{{ parameters.sql_query | replace('{column}', lib.render_target_column('analyzed_table')) | replace('{table}', lib.render_target_table()) | replace('{alias}', 'analyzed_table') }}
) AS analyzed_table
What's next
- Learn how to configure data quality checks in DQOps
- Look at the examples of running data quality checks, targeting tables and columns