Non negative count
Description
The non_negative_count
check calculates the number of non-negative values from column.
When to use
The usability of this check is obvious. It is useful for validation of numerical values that we expect to be
non-negative.
Used sensor
Non negative 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 non_negative_count
on columns 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:
non_negative_count:
rules:
min_count:
low:
min_value: 90.0
medium:
min_value: 80.0
high:
min_value: 70.0
|
The rendered query is
SELECT
SUM(
CASE
WHEN analyzed_table.`id` < 0 THEN 0
ELSE 1
END
) AS actual_value
FROM `dqo-ai-testing`.`dqo_ai_test_data`.`table` AS analyzed_table