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、连接、倾斜、内存、文件布局、AQE 与 Delta Lake。

Data & Analytics2026年10月8日

Aidp Semantic Model

oracle-samples

维护 .aidp/semantic.md 业务语义层,定义指标、连接、同义词和值字典,为自然语言转 SQL 提供依据。

Data & Analytics2026年10月8日