Skip to content
DuckDB community extension

anofox_tabular

A DuckDB extension for data quality, validation and anomaly detection in SQL - 17 data quality checks (volume, nulls, freshness, schema drift, regex and value-set compliance, duplicates, referential integrity, time-aware baselines) with a table-driven check-suite runner, column profiling and correlations including nested types, hash- and join-based table diffing, anomaly detection with Isolation Forest (categorical, Extended IF, SCiForest), DBSCAN and explainable OutlierTree, PII detection and masking (22 types including IBAN, credit cards, API keys and NER-based names, organizations and locations), email validation with DNS/SMTP checks, international address parsing (libpostal), phone number validation (libphonenumber), EU VAT validation (28 countries), and currency-aware money arithmetic.

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL anofox_tabular FROM community;
LOAD anofox_tabular FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Validate contact data

SQL
-- Validate contact data
SELECT email_is_valid('[email protected]'), vat_is_valid('DE136695976');

-- Find and mask PII in free text
SELECT pii_mask('Reach [email protected], card 4111 1111 1111 1111', 'redact');
-- Reach [EMAIL], card [CREDIT_CARD]

-- A data quality check: one pass/fail row with a message
CREATE TABLE orders AS
  SELECT i AS id, CASE WHEN i % 50 = 0 THEN NULL ELSE i % 7 END AS customer_id,
         CASE WHEN i = 77 THEN 99999.0 ELSE 20 + i % 13 END AS amount
  FROM range(1, 501) t(i);
SELECT status, message FROM null_rate('orders', 'customer_id', 0.01);
-- fail | Null rate 0.02 (10/500) exceeds maximum 0.01

-- Anomaly scores with Isolation Forest (trees, sample size, contamination)
SELECT * FROM isolation_forest('orders', 'amount', 100, 256, 0.1, 'scores')
ORDER BY anomaly_score DESC LIMIT 3;

Provided by DataZooDE. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

Anofox Tabular brings data quality engineering into DuckDB: checks that return pass/fail assertion rows, check suites defined in a SQL table, profiling, table diffs for migration validation, and anomaly detection, plus validators and normalizers for emails, addresses, phone numbers, EU VAT IDs, money and PII. Everything runs locally inside DuckDB.

Functions carry an anofox_tab_ prefix and a short alias (email_is_valid for anofox_tab_email_is_valid). Documentation: https://github.com/DataZooDE/anofox-tabular/blob/main/docs/README.md

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
DataZooDE/anofox-tabular
License
BSL 1.1
Maintainers
jrosskopf
Written in
C++
Build source
280cca399195
Build definition
Community descriptor