Skip to content

CONSOLIDATED - NOT NULL

Description

The NOT NULL validator is designed to ensure that a field's value is not null. This validator is particularly useful for data validation in scenarios where null values are considered invalid or an error. It supports all data types, including BLOBs, making it versatile for various data validation needs.


Config Location

To configure the NOT NULL validator, you need to define it within the consDPValidators section of your data point configuration within the schema. This involves specifying the validator name and entity.


Supported Data Types

  • BLOB
  • Json
  • String
  • Boolean
  • Decimal
  • Double
  • Integer

Config Requirements

Config ({}) options are not required for the NOT NULL validator. This validator is designed to perform a straightforward check for non-null values without the need for additional configuration parameters.


Example Config

Below is an example of how to configure the NOT NULL validator in XML format. This example demonstrates a validator that checks if the "NAME" data point is not null.

1
2
3
4
5
<dataPoint name="NAME" dataType="STRING">
    <consDPValidators>
        <consDPValidator name="CHECK_NOT_NULL" entity="NOT_NULL"/>
    </consDPValidators>
</dataPoint>

Example Result

Upon successful configuration and execution, the NOT NULL validator will check the current "NAME" value to ensure it is not null. If the value is null, a violation will be triggered, indicating that the value does not meet the criteria for acceptability.


Common Mistakes

  • Ensure that the validator name and entity are correctly defined in the configuration to ensure that the validator is correctly identified and applied during the data processing pipeline.
  • Remember that the NOT NULL validator does not require any configuration. If you attempt to provide a <config> block, it will be ignored.