Aidp Data Quality

作者 oracle-samples90b42d6c24d4無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Run data-quality rule checks on AIDP tables — not-null, uniqueness, allowed ranges/sets, referential integrity, and freshness. Use when the user wants to validate data, check for nulls/duplicates/orphans, assert a column's domain, or gate a pipeline on quality. Expresses each rule as bounded Spark SQL and reports pass/fail with offending counts.

僅含說明Data & Analytics
AI 產生的概覽

以受限 Spark SQL 規則驗證 AIDP 資料表的資料品質,回報通過/失敗與違規筆數。

功能
將明確的資料品質規則——非空、唯一性、允許範圍或集合、參照完整性、時效性——編譯成受限的 Spark SQL 違規計數查詢。透過隨附的輔助指令碼對 AIDP 資料表執行每項查詢,計數為 0 即判定為 PASS。失敗時會抽樣少量違規資料列,並輸出包含規則、目標、結果與違規筆數的摘要表。也可將已驗證的規則保存下來以便重複執行,並把檢查接入管線作為閘門任務。
適用情境
適用於需要驗證某張資料表或某個欄位、檢查空值、重複值、孤兒資料列或資料是否過期、斷言欄位的合法值域,或以資料品質作為管線閘門的情境。
執行需求
需要存取 AIDP 環境:執行中的叢集、區域、datalake OCID、工作區、叢集鍵,以及用於取得 UPST 的 api_key DEFAULT 設定檔。依賴隨附的輔助指令碼(scripts/aidp_sql.py)與參考文件,可選依賴 .aidp/catalog.md、.aidp/semantic.md 與 .aidp/dq-rules.md。需要連線至 AIDP 服務的網路存取。此技能本身並未附帶指令碼。

aidp-data-quality — rule checks via Spark SQL

Validate AIDP tables against explicit data-quality rules, each compiled to bounded Spark SQL and executed with the bundled helper — no MCP and no ai-data-engineer-agent repo required.

When to use

  • "Check <table> for nulls/duplicates", "validate <column>", "are there orphan rows", "is the data fresh", or gating a pipeline on quality.

Rule types (each → a counting SQL that should return 0 violations)

RuleCheck (violations)
not-nullCOUNT(*) WHERE col IS NULL
uniqueCOUNT(*) - COUNT(DISTINCT key) (or GROUP BY key HAVING COUNT(*)>1)
range / setCOUNT(*) WHERE col NOT BETWEEN lo AND hi / col NOT IN (...)
referentialCOUNT(*) child LEFT JOIN parent ... WHERE parent.key IS NULL
freshnessMAX(ts) vs SLA (e.g. datediff(current_date, MAX(ts)) <= N)

Workflow

  1. Resolve table(s)/columns; use join keys from .aidp/catalog.md for referential checks (don't guess). Pull rule definitions from .aidp/semantic.md value dictionaries where available.
  2. Ensure the cluster is RUNNING (aidp-cluster-ops / oci raw-request), then for each rule run the violation-count SQL with the bundled helper (PASS if 0, else FAIL):
    bash
    python "$PLUGIN_DIR/scripts/aidp_sql.py" --region <region> --datalake <DATALAKE_OCID> --workspace <ws> \  --cluster <cluster-key> \  --code "spark.sql('''SELECT COUNT(*) AS v FROM cat.sch.t WHERE col IS NULL''').show()"
    It mints a UPST from the api_key DEFAULT profile, auto-creates a scratch notebook, and returns JSON with status / outputs / spark_job_ids. No AIDP_SESSION required (--session-profile optional).
  3. On a non-zero count, FAIL and pull a few example offending rows with a separate bounded LIMIT query.
  4. Report a summary table: rule · target · result · violation count.
  5. Offer to (a) persist the rule set for re-runs (see below), and (b) wire checks into a Job (aidp-pipelines) as a gating task.

Persisting a re-runnable rule set

Register validated rules in .aidp/dq-rules.md so they can be re-run later (the quality analogue of .aidp/verified-queries.md). One entry per rule records the target table/column, rule-type (the five types above), the violation-SQL (counts violations → PASS when 0), and last-result / last-checked. To re-run, execute each entry's stored violation-SQL via scripts/aidp_sql.py, set the result to PASS (0) or FAIL (<count>), and record the cluster + date — never mark PASS without a status: ok run returning 0. Format and re-run rules: references/dq-rules.md.

Reliability rules

  • Run real SQL via scripts/aidp_sql.py; never assert a rule passed without a status: ok result.
  • Keep checks bounded; sample example offenders rather than dumping full result sets.
  • If a cell returns status: error, read the error, fix the SQL grounded in the catalog, and retry.

References

  • references/dq-rules.md (.aidp/dq-rules.md rule-set format + re-run)
  • scripts/aidp_sql.py · references/no-mcp-rest-map.md · references/oci-raw-request.md · references/semantic-model.md

來源與署名

來源:oracle-samples/oracle-aidp-samples位於ai/claude-code-plugins/oracle-ai-data-platform-workbench-engineer-agent/skills/aidp-data-quality提交90b42d6

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 oracle-samples/oracle-aidp-samples 的技能

Aidp Workspace Admin

oracle-samples

Provision and inspect AIDP DataLake instances and workspaces, including private-network workspaces attached to a customer VCN/subnet. Use when the user wants to create/list/get a workspace or DataLake instance, set up a new (e.g. private) AIDP environment, or replicate a customer setup. Create/delete are guarded — confirm before any provisioning.

待分類2026年10月8日

Aidp Volumes

oracle-samples

Work with AIDP volumes — list volumes, browse files inside a volume, upload/download via the PAR flow, and create directories. Use when the user mentions volumes, needs to stage large/binary files, or move data in/out of a volume (distinct from the workspace filesystem). Control-plane via the official `aidp` CLI.

待分類2026年10月8日

Aidp Verified Queries

oracle-samples

維護經過驗證的問題到 Spark SQL 配對庫,讓代理在產生新 SQL 前優先重用可信查詢。

Data & Analytics2026年10月8日

Aidp User Settings

oracle-samples

透過 aidp CLI 或 oci raw-request 備援方式管理 AIDP DataLake 使用者設定與偏好。

Productivity & Workflow2026年10月8日

Aidp Spark Optimization

oracle-samples

指導 Apache Spark 3.5.0 效能調校:分割區、shuffle、join、資料傾斜、記憶體、檔案配置、AQE 與 Delta Lake。

Data & Analytics2026年10月8日

Aidp Semantic Model

oracle-samples

維護 .aidp/semantic.md 業務語意層,定義指標、連接、同義詞與值字典,為自然語言轉 SQL 提供依據。

Data & Analytics2026年10月8日