Tests in the YAML Config
Here you can see all the supported tests definitions and how to configure them in the YAML config file. A Test Definition is a generic definition of a test. This Test Definition then gets specified in a Test Case. This Test Case is where the parameter(s) of a Test Definition are specified. In this section, you will learn what tests we currently support and how to configure them in the YAML/JSON config file.Table Tests
Tests applied on top of a Table. Here is the list of all table tests:- Table Row Count to Equal
- Table Row Count to be Between
- Table Column Count to Equal
- Table Column Count to be Between
- Table Column Name to Exist
- Table Column to Match Set
- Table Custom SQL Test
- Table Row Inserted Count To Be Between
- Compare 2 Tables for Differences
- Table Data to Be Fresh [OpenMetadata]
Table Row Count to Equal
Validate the total row count in the table is equal to the given value. Dimension: Integrity Properties:value: Expected number of rows.
YAML Config
Table Row Count to be Between
Validate the total row count is within a given range of values. Dimension: Integrity Properties:minValue: Lower bound of the interval. If informed, the number of rows should be bigger than this number.maxValue: Upper bound of the interval. If informed, the number of rows should be lower than this number.
YAML Config
Table Column Count to Equal
Validate that the number of columns in a table is equal to a given value. Dimension: Integrity PropertiescolumnCount: Expected number of columns.
YAML Config
Table Column Count to be Between
Validate the number of columns in a table is between the given value Dimension: Integrity PropertiesminColValue: lower boundmaxColValue: upper bound
YAML Config
Table Column Name to Exist
Validate a column name is present in the table Dimension: Integrity PropertiescolumnName: the name of the column to check for
YAML Config
Table Column to Match Set
Validate a list of table column name matches an expected set of columns Dimension: Integrity PropertiescolumnNames: comma separated string of column nameordered: whether the test should check for column ordering. Default to False
YAML Config
Table Custom SQL Test
Write you own SQL test. When writting your query you can use 2 strategies:ROWS(default): expects the query to be written asSELECT <field>, <field> FROM <foo> WHERE <condition>. Note if your query returns a large amount of rows it might cause an “Out Of Memeory” error. In this case we recomend you to use theCOUNTstrategy.COUNT: expects the query to be written asSELECT COUNT(<field>) FROM <foo> WHERE <condition>.
sqlExpression: SQL expressionstrategy: one ofROWSorCOUNTthreshold: an integer defining the threshold above which the test should fail (default to 0 if not specified)
Example
Table Row Inserted Count To Be Between
Validate the number of rows inserted for the defined period is between the expected range Dimension: Integrity PropertiesMin Row Count: Lower boundMax Row Count: Upper boundColumn Name: The name of the column used to apply the range filterRange Type: One ofHOUR,DAY,MONTH,YEARInterval: The range interval (e.g. 1,2,3,4,5, etc)
YAML Config
Compare 2 Tables for Differences
Compare two tables for differences, letting you check for integrity across different services — for example, a table in Snowflake against a table in Redshift.Only the connectors listed below are currently supported by the underlying
data-diff library. Using an unsupported connector will result in a Scheme '...' currently not supported error.- Snowflake
- BigQuery
- Athena
- Redshift
- Postgres
- MySQL
- MSSQL
- Oracle
- Trino
keyColumns: The key column to use as the key for the comparison. Resolves to the primary key (if defined) if not setuseColumns: The columns against which the comparison will done. If not provided it will use all the columnstable2: The table against which the comparison will be done. Must be the fully qualified name as defined in OpenMetadatathreshold: The threshold of different rows above which the test should fail — default to 0where: Anywhereclause to passcaseSensitiveColumns: Whether the column comparison should be case sensitive or not. Default tofalse.
YAML Config
Table Data to Be Fresh [OpenMetadata]
Validate the freshness of a table’s data. Dimension: Accuracy Propertiescolumn: the colummn that will be used to chech the table freshnesstimeSinceUpdate: (in seconds) The data is expected to be updated within this number of seconds. If the time since the last update is greater than this value, the test will fail.
YAML Config
Next Steps
Column Tests - YAML Config
Configure column-level data quality tests including uniqueness, null checks, regex patterns, value sets, and statistical validations.