Prompt

How do I set up an ETL assistant for detecting data issues in warehouse tables?

Artificial Intelligence / AI Analytics2 observationsLast seen Nov 23, 2026

Latest observation

Nov 23, 2026OpenAI APIWeb search: off

To set up an ETL assistant for detecting data issues in warehouse tables, think of it as a data quality monitoring assistant with three parts:

  1. Ingest metadata and table data
  2. Run detection rules / anomaly checks
  3. Report issues and route them to humans or workflows

Here’s a practical way to build it.


1) Define what “data issues” mean

Start by listing the kinds of problems you want the assistant to catch.

Common warehouse table issues:

  • Missing values in required columns
  • Duplicate rows or duplicate business keys
  • Schema drift
    • new columns
    • removed columns
    • type changes
  • Unexpected null spikes
  • Row count anomalies
  • Freshness delays
  • Invalid ranges
    • negative amounts
    • impossible dates
  • Referential integrity breaks
  • Distribution shifts
    • today’s values look very different from historical values
  • Late-arriving data
  • Broken joins / orphan records

If you don’t define this clearly, the assistant will be noisy.


2) Gather the inputs the assistant needs

Your assistant should have access to:

A. Warehouse metadata

For each table:

  • table name
  • schema
  • column names and types
  • primary keys / unique keys
  • freshness expectations
  • expected row volume
  • source system
  • owner / team

B. Data profiling stats

For each table/column:

  • row counts
  • null counts
  • distinct counts
  • min/max
  • mean/stddev for numeric columns
  • top values
  • percentage changes vs historical baseline

C. Historical baselines

Keep a time series of:

  • daily row counts
  • daily null rates
  • daily distinct counts
  • distribution metrics per column

This lets the assistant detect anomalies instead of only hard-coded rules.


3) Choose the detection approach

Usually you want a mix of:

Rule-based checks

Good for deterministic issues:

  • column is not null
  • amount >= 0
  • status in (...)
  • row_count > 0
  • updated_at within last 24h

Statistical/anomaly checks

Good for unknown issues:

  • row count deviates by > X standard deviations
  • null rate spikes relative to baseline
  • value distribution shifts significantly
  • sudden increase in duplicates

Semantic/LLM-assisted interpretation

An LLM can help:

  • explain the likely cause of an anomaly
  • summarize affected tables
  • suggest next debugging steps
  • create a human-readable incident report

Important: let the LLM explain issues, not be the only detector.


4) Build the pipeline

A simple architecture:

Step 1: Metadata sync

Pull table schemas and ownership info from the warehouse catalog or information schema.

Step 2: Profiling job

Run scheduled SQL queries to compute quality metrics.

Example metrics per table:

  • total rows
  • rows loaded today
  • null percentage per required column
  • duplicates by key
  • freshness lag
  • min/max timestamps

Step 3: Check execution

Evaluate rules and anomaly thresholds.

Step 4: Issue classification

Classify findings:

  • Critical
  • Warning
  • Informational

Step 5: Assistant response generation

The assistant converts raw metrics into:

  • summary
  • suspected root cause
  • impacted downstream tables
  • recommended action

Step 6: Alerting and ticketing

Send results to:

  • Slack / Teams
  • email
  • Jira / ServiceNow
  • data observability dashboard

5) Create a table-level quality schema

For each table, define checks like this:

table: sales_orders
owner: analytics-team
freshness_sla_hours: 2
checks:
  - type: not_null
    columns: [order_id, customer_id, order_date]
  - type: unique
    columns: [order_id]
  - type: accepted_values
    column: order_status
    values: [placed, shipped, delivered, cancelled]
  - type: range
    column: total_amount
    min: 0
  - type: freshness
    timestamp_column: updated_at
  - type: row_count_anomaly
    baseline_days: 14
    tolerance: 3

This makes the checks versioned and auditable.


6) Use SQL for most checks

Most warehouse quality checks can be done with SQL.

Examples:

Null rate

SELECT
  COUNT(*) AS total_rows,
  SUM(CASE WHEN customer_id IS NULL THEN 1 ELSE 0 END) AS null_customer_id,
  1.0 * SUM(CASE WHEN customer_id IS NULL THEN 1 ELSE 0 END) / COUNT(*) AS null_rate
FROM sales_orders;

Duplicate keys

SELECT order_id, COUNT(*) AS cnt
FROM sales_orders
GROUP BY order_id
HAVING COUNT(*) > 1;

Freshness

SELECT MAX(updated_at) AS latest_update
FROM sales_orders;

Row count anomaly

SELECT
  CURRENT_DATE AS run_date,
  COUNT(*) AS row_count
FROM sales_orders
WHERE DATE(updated_at) = CURRENT_DATE;

Then compare against historical patterns.


7) Add an LLM layer for natural-language reasoning

The assistant can ingest:

  • table metadata
  • check results
  • recent changes in pipeline runs
  • owner info
  • past incidents

And produce outputs like:

  • “sales_orders failed freshness SLA by 6 hours”
  • “Null rate in customer_id increased from 0.2% to 8.7%”
  • “Likely upstream issue in orders_ingestion job”
  • “Related downstream tables may be impacted: fct_revenue, customer_360”

Use the LLM for:

  • summarization
  • explanation
  • prioritization
  • incident drafts

Do not use it as the only source of truth for numeric checks.


8) Set up an event loop or scheduler

Run the assistant on:

  • every pipeline completion
  • hourly for critical tables
  • daily for batch facts
  • on schema change events

Common tools:

  • Airflow
  • Dagster
  • Prefect
  • dbt + tests + custom monitoring
  • cloud-native schedulers

9) Keep a feedback loop

You’ll want the assistant to improve over time.

Store:

  • true positive / false positive labels
  • whether alerts were acknowledged
  • incident resolution notes
  • which checks were useful

Then adjust:

  • thresholds
  • severity levels
  • table-specific rules
  • anomaly models

10) Recommended implementation stack

A simple stack could look like:

  • Warehouse: Snowflake / BigQuery / Redshift / Databricks SQL
  • Orchestration: Airflow / Dagster / Prefect
  • Quality checks: dbt tests, Great Expectations, Soda, custom SQL
  • Metadata store: Postgres / warehouse schema / catalog
  • LLM layer: OpenAI API or similar
  • Alerting: Slack + Jira
  • Dashboard: Metabase / Grafana / Looker / custom UI

11) Minimal architecture example

A practical setup:

  1. Nightly job runs SQL checks on all critical warehouse tables
  2. Metrics are stored in data_quality_metrics
  3. An anomaly detector compares today vs historical baseline
  4. If thresholds are crossed, an incident record is created
  5. LLM generates a concise summary and next steps
  6. Slack alert is posted to the table owner channel

12) Example assistant output

A good assistant response might look like:

Issue detected in sales_orders

  • Freshness SLA breached: latest update is 7.2 hours old, threshold is 2 hours
  • Null rate in customer_id rose from 0.3% to 6.8%
  • Duplicate order_id count increased from 0 to 142

Likely cause: upstream ingestion job orders_stream_loader failed partially after 02:00 UTC

Recommended actions:

  1. Check ingestion logs for failed partitions
  2. Re-run failed batch
  3. Validate downstream tables fct_orders and revenue_daily

13) Best practices

  • Start with high-value tables first
  • Keep checks versioned in code
  • Separate hard failures from warnings
  • Avoid alert fatigue with deduplication and suppression windows
  • Keep historical metrics for trend analysis
  • Make ownership explicit for each table
  • Validate changes after schema updates

14) If you want to use an LLM specifically

A good LLM prompt structure is:

  • Role: data quality assistant
  • Context: warehouse name, table metadata, recent job runs
  • Inputs: check results, baseline stats, incident history
  • Task: summarize issues, rank severity, suggest likely causes, recommend next steps
  • Constraints: do not invent numbers; only use provided metrics

If you want, I can also provide:

  1. a reference architecture diagram,
  2. a dbt/Great Expectations implementation, or
  3. a sample Python ETL assistant script that checks warehouse tables and generates alerts.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.