Skip to content

Not null count

Description

The not_null_count check calculates the number of not null values in a column.


When to use

This is a standard quality check, mostly used when we would like to simply ensure that columns do not contain NULL values


Used sensor

Not null count


Accepted rules

Min count

Count equals


Parameters

The sensor does not accept any parameters


How to use

The default configuration of column validity check not_null_count on column id with min_count rule, looks like this

# yaml-language-server: $schema=https://cloud.dqo.ai/dqo-yaml-schema/TableYaml-schema.json
apiVersion: dqo/v1
kind: table
spec:
  target:
    schema_name: dqo_ai_test_data
    table_name: table
  time_series:
    mode: current_time
    time_gradient: day
  columns:
    id:
      type_snapshot:
        column_type: INT64
        nullable: true
      checks:
        validity:
          not_null_count:
            rules:
              min_count:
                low:
                  min_value: 90.0
                medium:
                  min_value: 80.0
                high:
                  min_value: 70.0
The rendered query is
SELECT
    count(analyzed_table.`id`) AS actual_value
FROM `dqo-ai-testing`.`dqo_ai_test_data`.`table` AS analyzed_table