Skip to main content

Sql Validator

Specification

{
"validatorType": String,
"name": String,
"description": String,
"fields": FieldSelectorSpec,
"sql": String,
"onNullResult": String
}

Structure values

Field NameTypeDescriptionRequiredDefault
validatorTypeStringThe type of validator to constructRequired
nameStringThe name of the validator. Must be unique within the validation suite.Required
descriptionStringExpanded validator information.None
fieldsObjectA Field Selector SpecRequired
sqlStringA partial SQL expression representing an arbitrary operation that results in a boolean value. This would be a clause in the select statement of a SQL query. Use $column to represent the name of the field selected by the field selector.Required
onNullResultStringA value of pass, null, or fail that describes how to process null values. Null aggregates them into a null column. Pass aggregates them in with the other passing values. Fail aggregates them in with the other failing values.fail

Example

{
"validatorType": "sql",
"name": "sample_sql_validator",
"description": "I can execute arbitrary sql",
"fields": {
"fieldSelectorType": "Single",
"fieldName": "col_name"
},
"sql": "editdistance($column, 'benchmark') < 4",
"onNullResult": "pass"
}