Known Issues & Caveats¶
Database Backend Differences¶
Null Handling Varies Across Backends¶
Database backends handle NULL differently in aggregate checks like minimum, maximum, and mean. Most backends silently skip nulls, which means a column full of nulls can still pass a minimum check (because there are no non-null values to violate the constraint).
If you need to catch nulls, add an explicit nullValues check rather than relying on aggregate checks to find them:
properties:
- name: my_column
quality:
- id: my_column_no_nulls
type: library
metric: nullValues
mustBe: 0
description: "There must be no null values in the column."
This catches nulls directly, regardless of which database backend runs the validation.
PostgreSQL and MySQL: No Safe Cast¶
When a check compares a column to a number, such as WHERE floor_area_sqm >= 200, vowl casts the column first (see use_try_cast). Where the database has a safe cast, vowl uses it, so a value that can't be converted becomes NULL and the query still runs. PostgreSQL and MySQL have no safe cast, so vowl writes a plain CAST:
| Backend | SQL vowl runs |
|---|---|
| DuckDB | TRY_CAST(floor_area_sqm AS BIGINT) >= 200 |
| PostgreSQL | CAST(floor_area_sqm AS BIGINT) >= 200 |
| MySQL | CAST(floor_area_sqm AS SIGNED) >= 200 |
This only matters when the column is stored as text. Casting a numeric column to a number doesn't fail.
PostgreSQL is strict. One value it can't convert fails the whole query, and the check ends in ERROR. A decimal string such as "44.0" is not valid integer text, so it fails too:
MySQL never fails a cast. It truncates decimals ("199.9" becomes 199) and turns text it can't read into 0 ("abc" and "" both become 0). The check runs, but a bad value is compared as 0 instead of being reported, so the count can be wrong without any error.
vowl also writes a plain CAST for Snowflake and SQLite. Their behaviour has not been tested.
Workarounds:
- Store numbers in numeric columns (
INTEGER,NUMERIC). The database then rejects bad values on insert, and the cast in the check can't fail. - Write the cast in the check yourself, to a type that accepts the values, for example
WHERE CAST(floor_area_sqm AS NUMERIC) >= 200. PostgreSQL accepts"44.0"asNUMERIC. Text that isn't a number, such as"abc", still fails. - Run the checks through DuckDB, which has
TRY_CAST. For PostgreSQL and MySQL, DuckDB can attach the database and read it in place (see the real databases example).
MSSQL: No Regex Support¶
SQL Server does not support regex (REGEXP_LIKE). Any check that uses pattern matching will return ERROR when run against MSSQL.
Affected checks:
logicalTypeOptions.patterncheckslogicalTypeOptions.formatchecks for string, date, timestamp, and time logical typeslibrarymetricinvalidValueswitharguments.pattern
Plain logicalType checks, such as date, timestamp and time, use TRY_CAST rather than regex, so they are not affected.
Workaround: Copy the table into DuckDB, which has full regex support, and validate the copy:
import ibis
from vowl import validate_data
from vowl.adapters import IbisAdapter
mssql = ibis.mssql.connect(host="host", user="user", password="pass", database="mydb")
con = ibis.duckdb.connect()
con.create_table("my_table", mssql.table("my_table").to_pyarrow())
result = validate_data("contract.yaml", adapter=IbisAdapter(con))
The whole table is read into memory, so use a filter in the Ibis expression (for example .filter(...)) to copy less. DuckDB ATTACH is not an option here, because DuckDB can only attach PostgreSQL, MySQL and SQLite.
Oracle: Dialect Differences¶
Oracle's SQL dialect differs from standard SQL in ways that can cause some checks to ERROR:
- No
LIMITclause: vowl caps the failed rows it fetches withFETCH FIRST N ROWS ONLYinstead. This has not been tested against a live Oracle database, and a query sqlglot can't parse still gets a plainLIMIT. - No
!~regex operator: vowl rewrites regex checks to useREGEXP_LIKE, but complex patterns may not translate cleanly. - Case-sensitive identifiers: Oracle uppercases unquoted identifiers. If your tables were created with quoted lowercase names (e.g.
CREATE TABLE "my_table"), checks may fail because Oracle looks forMY_TABLEinstead. vowl applies quoting transforms, but mismatches can still occur. TEXT/CLOBcolumns can't useREGEXP_LIKE: vowl auto-casts these toVARCHAR(4000), which means values longer than 4000 characters get truncated before the regex runs.
SQLite: Regex via User-Defined Function¶
SQLite has no built-in regex support. vowl works around this by using a Python-side regex function (_IBIS_REGEX_SEARCH) that Ibis registers automatically. This works in most cases, but may behave slightly differently from server-side regex (e.g. subtle Unicode or flag differences).
SQLite: Parallel Checks Need a Thread-Safe Connection¶
PooledAdapter hands each connection to one worker thread at a time, but not
always the same thread. Python's sqlite3 refuses by default to use a
connection on a thread other than the one that opened it. So a pooled SQLite
connection opened with ibis.connect("sqlite://...") fails some checks with
ERROR, depending on which thread picks them up.
SQLite itself is thread-safe, so you can turn the guard off. Open the
connection yourself with check_same_thread=False and hand it to Ibis:
import sqlite3
import ibis
raw_con = sqlite3.connect("my.db", check_same_thread=False)
con = ibis.sqlite.from_connection(raw_con)
This is safe with PooledAdapter, because it never gives one connection to
two threads at once.
Native Array Checks¶
Array checks (see Array Formats) rely on native array SQL. vowl builds them from contract metadata without inspecting the actual column type, so on an engine that doesn't support arrays the check returns ERROR rather than silently passing.
Only DuckDB is tested. The array checks are verified against DuckDB, where all three constructs execute correctly. For every other engine, the behaviour below is inferred from the SQL vowl emits rather than observed from an actual run, so treat the table as expectations rather than guarantees. Outside DuckDB, validate against your own data or expect an ERROR for unsupported constructs.
| Array check | SQL construct | Expected to work (untested) | Expected to ERROR |
|---|---|---|---|
minItems / maxItems |
ARRAY_LENGTH |
spark, snowflake, trino, bigquery, clickhouse | engines without arrays (sqlite, mysql, tsql, oracle) |
uniqueItems |
ARRAY_DISTINCT |
spark, snowflake, trino, clickhouse | postgres, bigquery (no array_distinct builtin) |
items.* (element validation) |
UNNEST + EXISTS |
postgres, trino, bigquery | clickhouse, sqlite, mysql, tsql, oracle (spark/snowflake best-effort) |
Multi-Source Adapters: Tables Copied into Memory¶
With adapters={...}, a cross-table check whose tables are on different connections runs on copies of those tables in an in-memory DuckDB on your machine. Large tables can use a lot of memory and network, and may run out of memory. Add filter conditions to copy less, or use DuckDB ATTACH if your databases support it. See Copying tables into memory.
PooledAdapter: Joins Across Pools Are Copied¶
A join across two different pools, or across a pool and another adapter, is copied into memory, even when both reach the same database. Pass one pool for every schema a join reads to keep it in the database. Separate pools also run their schemas one at a time. See PooledAdapter.
Why Not Use DuckDB ATTACH Internally?¶
vowl can't rely on ATTACH because it has no connection details, most backends don't support it, and table names and filter conditions would have to be rewritten. See Why vowl copies instead of using ATTACH.
Annotated Output: Not All Checks Can Be Merged¶
get_annotated_output() annotates your table with a check's failed rows only when those rows hold the table's columns, or its primary key. Checks that return one number (an average, a sum, a minimum or a maximum), checks whose failed rows are good rows, and checks that ended in ERROR annotate nothing and appear only in the summary. Checks whose failed rows have other columns become residues. See:
Queries that Read Tables Outside the Contract¶
A SQL check can read a table the contract doesn't declare, such as a currencies lookup table. vowl reads it through the adapter of the schema the check belongs to, and does not block it. If that connection can't see the table, the check ends in ERROR. In a run across connections, the same name can mean two different tables. See Tables outside the contract for what happens in each setup.
Warning
Avoid SQL checks that read undeclared tables. Declare all referenced tables in your contract's schema, even if they're not the primary validation target.