Aidp Verified Queries

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

Register and validate reusable question→Spark-SQL pairs in .aidp/verified-queries.md so the agent reuses trusted SQL before generating new SQL. Use when the user wants to save a working query as canonical, build a verified-query repository, or improve answer reliability for recurring questions. Validates each pair on the cluster before marking it verified.

AI 產生的概覽

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

功能
維護依專案存放的問題到 Spark SQL 配對檔案,在把候選查詢標記為已驗證之前,先在叢集上執行驗證。它會記錄邏輯名稱與實際存取的資料表,依既定格式附加項目,並將驗證失敗的配對保留為草稿並說明原因。最終形成一個整理過的查詢庫,供資料分析技能依問題相似度與資料表重疊進行比對。
適用情境
適用於把可用查詢儲存為常見問題的標準答案、整理或清理已驗證查詢庫,以及提升重複問題的回答可靠度。
執行需求
需要存取 Spark 叢集,並提供區域、資料湖 OCID、工作區與叢集鍵,以及用於簽發 UPST 的 api_key DEFAULT 設定檔。驗證透過隨附的 SQL 輔助指令碼執行;不要求 MCP 伺服器,但可選擇使用 MCP 加速。

aidp-verified-queries — the verified-query repository (VQR)

Maintain .aidp/verified-queries.md: validated question → Spark SQL pairs that aidp-analyzing-data reuses before generating SQL from scratch — the highest-reliability NL-to-SQL mechanism.

When to use

  • Save a working query as the canonical answer to a recurring question.
  • Curate/clean the verified-query repository.

Quality gate (critical — do not skip)

A wrong verified query makes accuracy worse. Before setting verified: true, the pair MUST:

  1. be syntactically valid Spark SQL,
  2. execute on the cluster (run it via the bundled scripts/aidp_sql.py helper),
  3. actually answer the stated question (sanity-check the result shape/values). If any check fails, keep verified: false (DRAFT) and explain why — never auto-promote a failing pair.

Workflow

  1. Read the candidate question + SQL (or take the last query run in aidp-analyzing-data).
  2. Prefer logical names from .aidp/semantic.md; record the physical tables touched.
  3. Validate by running the SQL on the cluster with the bundled helper (no MCP required):
    bash
    python "$PLUGIN_DIR/scripts/aidp_sql.py" \  --region <region> --datalake <DATALAKE_OCID> --workspace <ws> --cluster <cluster-key> \  --code "spark.sql('''<your SELECT … LIMIT 50>''').show(50, truncate=False)"
    It mints a UPST from the api_key DEFAULT profile, auto-creates a scratch notebook, and returns JSON {status, outputs, spark_job_ids}. Require status == "ok" and a result that answers the question. Run on a bounded sample (add LIMIT) to keep validation cheap.
  4. Append the entry to .aidp/verified-queries.md in the documented format; set verified: true only on a recorded successful run (note cluster + date).
  5. On reuse, aidp-analyzing-data matches by question similarity + table overlap and adapts only dates/bind values.

Notes

  • .aidp/verified-queries.md is user-editable and git-ignored (per-project).
  • Keep entries small, single-purpose; complex asks get a complete worked example.
  • This skill is self-contained: validation runs through scripts/aidp_sql.py, not any MCP server. If an aidp MCP happens to be configured you may use its nb_execute_code as an accelerator, but it is not required.

References

  • references/verified-queries.md · references/semantic-model.md
  • SQL execution helper: references/no-mcp-rest-map.md (No-MCP SQL via scripts/aidp_sql.py)

來源與署名

來源:oracle-samples/oracle-aidp-samples位於ai/claude-code-plugins/oracle-ai-data-platform-workbench-engineer-agent/skills/aidp-verified-queries提交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 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日

Aidp Roles Access

oracle-samples

管理 AIDP 角色與存取權:列出角色、增減成員,以及授予或撤銷各項資源的權限。

Security2026年10月8日