Skip to main content

Testing

Sundial provides robust data quality testing capabilities to ensure the reliability and accuracy of your data. You can configure both common pre-built tests and write custom SQL tests to validate your tables.

Common Pre-Built Tests

Sundial includes several configurable tests that can be applied to any table:

Row Count Tests

Verify that tables have the expected number of rows:

  • Set thresholds for minimum/maximum row counts
  • Compare row counts across time periods
  • Alert on unexpected changes in volume

Null Value Tests

Check for unexpected null values:

  • Set maximum allowed percentage of nulls per column
  • Monitor changes in null rates over time
  • Identify columns with data quality issues

Value Range Tests

Validate that numeric columns contain expected values:

  • Ensure values are positive when required
  • Set valid min/max thresholds

Custom SQL Tests

For more complex validation needs, you can write custom SQL tests:

  • Write SQL queries to implement specific business rules and data quality checks
  • Create tests that analyze data patterns over time to detect anomalies
  • Validate aggregated metrics and calculations match expected business logic
  • Define custom thresholds and alert conditions based on your specific requirements

Handling Test Failures

When data quality tests fail, Sundial provides a comprehensive workflow for investigation and remediation:

Alert Notifications

  • Sundial's testing engine automatically emits alerts when any test fails (pre-built or custom)
  • Users are promptly notified through configured channels (Slack, email)
  • Detailed test logs and failure information can be viewed in the UI console
  • Alerts include test details, failure reason, and impacted data

Issue Triage

During triage, investigate the root cause which typically falls into one of these categories:

  • Data drift or anomalies in source data
  • Upstream changes in source systems
  • Code regressions in transformations
  • Infrastructure or system issues

Data Remediation

If data quality issues require reprocessing:

  1. Use Sundial's backfill capabilities to recompute affected data ranges
  2. Choose appropriate backfill mode (rolling or one-time) based on issue scope
  3. Monitor reprocessing to ensure data quality is restored

See Backfill Documentation for detailed steps on reprocessing data.