alibabacloud-odps-sql-generation — Claude Code skill: setup & use
alibabacloud-odps-sql-generation generates MaxCompute SQL from natural language and diagnoses ODPS-0xxx errors. Useful when writing analytics queries or migrating code from standard SQL.
Apache-2.0 210 installs ★ 300 updated 2026-10-23
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a claude-codeWhat alibabacloud-odps-sql-generation does
This skill equips coding agents with MaxCompute (ODPS) SQL syntax rules. Because MaxCompute builds on Hive SQL extensions, its dialect diverges significantly from ANSI standard SQL. The repository splits reference materials into text2sql logic, DQL rules, typical query patterns, and execution error troubleshooting.
The pattern library includes templates for Top N queries, PIVOT and UNPIVOT transforms, array expansion via LATERAL VIEW and EXPLODE, JSON extraction, and rolling aggregations. It also guides the model through common SET flags and query hints.
Skill scope covers SQL text generation only. Non-SQL interfaces like PyODPS DataFrame API or Tunnel, cluster scheduling issues, and RAM role permissions are not handled here.
What it helps with
- generate MaxCompute SQL queries from plain language descriptions
- adapt standard ANSI SQL queries to Hive SQL dialect conventions
- extract JSON data and unnest arrays using
LATERAL VIEWandEXPLODE - diagnose
ODPS-0xxxengine error codes and fix failed queries
Example prompts for the agent
- Write a MaxCompute SQL query calculating rolling 7-day user retention
- Unnest a tag array into individual table rows using EXPLODE and LATERAL VIEW
- Fix this MaxCompute query that failed with an ODPS-0xxx error code
How to install alibabacloud-odps-sql-generation
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a claude-code2Manually: put the files in place
~/.claude/skills/alibabacloud-odps-sql-generation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/alibabacloud-odps-sql-generation/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a codex2Manually: put the files in place
.agents/skills/alibabacloud-odps-sql-generation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a cursor2Manually: put the files in place
.cursor/skills/alibabacloud-odps-sql-generation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aliyun/alibabacloud-aiops-skills skills/analyticscomputing/odps/alibabacloud-odps-sql-generation2Manually: put the files in place
.github/skills/alibabacloud-odps-sql-generation/SKILL.md1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a gemini-cli2Platform CLI
gemini skills install https://github.com/aliyun/alibabacloud-aiops-skills --path skills/analyticscomputing/odps/alibabacloud-odps-sql-generationManually: put the files in place
.devin/skills/alibabacloud-odps-sql-generation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about alibabacloud-odps-sql-generation
How to install alibabacloud-odps-sql-generation in Claude Code?
Run npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a claude-code.
What does alibabacloud-odps-sql-generation do?
It guides agents on MaxCompute SQL syntax, query pattern templates like PIVOT and windowing, and ODPS execution error diagnosis.
Does this skill handle PyODPS or platform administration?
No. Non-SQL tooling like PyODPS DataFrame API, Tunnel, MapReduce, and Aliyun RAM permissions fall outside its scope.
Source text
SKILL.md · Apache-2.0
--- name: alibabacloud-odps-sql-generation description: "Provides MaxCompute SQL intelligent generation capabilities for AI agents, covering text2sql conversion principles, dialect syntax differences (DQL/DDL/DML), common query pattern templates (Top N, PIVOT, window functions, etc.), and ODPS error code diagnostics. Use when generating, debugging, or migrating MaxCompute / ODPS SQL." license: Apache-2.0 metadata: domain: coding owner: MaxCompute contact: [email protected], [email protected] version: 1.0.0 --- # MaxCompute SQL Engine Syntax Skill Provides MaxCompute SQL engine syntax guidance for text2sql scenarios. MaxCompute is based on Hive SQL extensions and has significant differences from ANSI standard SQL. ## Usage Load corresponding reference files based on question type (can be combined). The `load` column indicates relative loading weight (heavy ≈ large, medium ≈ moderate), for budget estimation, not exact token counts. Each file's opening paragraph describes its own scope. | Trigger condition | File | load | |---|---|---| | NL→SELECT generation / text2sql (determine intent, granularity, table-column mapping, output format first) | `references/text2sql_principles.md` | light | | Generate MaxCompute SELECT queries (dialect rules, DQL default must-read) | `references/maxcompute_select_guide.md` | heavy | | Match query pattern keywords: Top N / top-N per group / year-over-year / month-over-month / consecutive N days / retention / row-to-column / column-to-row / PIVOT / UNPIVOT / array expansion / LATERAL VIEW / EXPLODE / JSON extraction / GET_JSON_OBJECT / cumulative / running total / Range Join / GROUPING SETS / CUBE / ROLLUP / pagination / paging | `references/sql_query_patterns.md` | medium | | SQL execution failure requiring diagnosis and recovery (including `ODPS-0xxx` error codes)| `references/sql_common_errors.md` | medium | > Relationship: `text2sql_principles.md` provides engine-independent NL→SELECT generation principles; `maxcompute_select_guide.md` is the **single authoritative source** for MaxCompute DQL dialect rules (unsupported syntax/functions/partitioning/types/SET parameters). `sql_query_patterns.md` provides **query template snippets** only, without duplicating rules. ## Out of Scope The following scenarios exceed this skill's scope: - **MaxCompute non-SQL interfaces**: Tunnel / MapReduce / Graph / PyODPS DataFrame API, SDK invocation methods - **Console and permission management**: Quota requests, IAM / RAM roles, project owner operations — use Aliyun console or support tickets - **Execution plan-level deep tuning**: Only lists common SET parameters and hints; does not analyze specific plan nodes / Fuxi DAG / data skew formation paths - **Cluster-side / platform-side failures**: Worker crashes, resource scheduling failures, MetaStore transaction conflicts, storage layer read/write errors — these are support ticket issues, not SQL issues
© aliyun · Apache-2.0 · aliyun/alibabacloud-aiops-skills