Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-sql-generation -a claude-code
Open on GitHub

What 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 VIEW and EXPLODE
  • diagnose ODPS-0xxx engine 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-code

2Manually: put the files in place

~/.claude/skills/alibabacloud-odps-sql-generation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/alibabacloud-odps-sql-generation/

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

Similar skills

All skills for Data and databases →

From the same set66

The whole set →
alibabacloud-flink-workspace-ops alibabacloud-flink-workspace-ops is a Claude Code skill for managing Flink Console workspace resources, including SQL drafts, deployments, and jobs. CX Codex +1 221installs alibabacloud-polardb-ai-assistant alibabacloud-polardb-ai-assistant — a skill for analyzing and managing Alibaba Cloud PolarDB clusters. Diagnose performance issues, review parameters, parse logs, and plan upgrades without switching to the console. CX Codex +1 216installs alibabacloud-ecs-reboot-or-crash-diagnosis alibabacloud-ecs-reboot-or-crash-diagnosis is a Claude Code skill that diagnoses unexpected reboots, system panics, and crash events across Alibaba Cloud ECS instances. CX Codex +1 214installs alibabacloud-devops alibabacloud-devops converts natural-language requests into Alibaba Cloud Yunxiao operations across pipelines, repositories, work items, and test suites. CX Codex +1 212installs alibabacloud-ddos-security-monitor alibabacloud-ddos-security-monitor is a Claude Code skill that checks Alibaba Cloud DDoS protection and investigates attack events and traffic anomalies. CX Codex +1 207installs alibabacloud-ack-cli alibabacloud-ack-cli — a skill that drives Alibaba Cloud ACK from the terminal: clusters, node pools, addons, kubeconfig via aliyun cs. Handy when kubectl won't connect or RAM answers Forbidden.RAM. CX Codex +1 196installs alibabacloud-sysom-diagnosis The alibabacloud-sysom-diagnosis skill investigates Linux server performance and stability through SysOM, then returns findings and recommendations without changing the system. CX Codex +1 191installs alibabacloud-odps-maxframe-coding alibabacloud-odps-maxframe-coding — a skill for MaxFrame SDK on Alibaba Cloud MaxCompute: builds data pipelines, reads and writes ODPS tables, debugs jobs, and creates custom DPE runtime images. CX Codex +1 188installs

Project sponsors

Companies that keep this analytics open