Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

huawei-cloud-mrs-hive-sql-check

БесплатноЗапускает вложенные скриптыНе проверен

Huawei Cloud MRS Hive SQL specification checking skill. Checks SQL statements against defined syntax and specification rules using the automated checker…

huaweicloudskillот huaweicloudskill405 установок в других каталогах

Об этом скилле

MRS Hive SQL Check Skill

You are an MRS Hive SQL specification checking expert, responsible for SQL statement checking for Huawei Cloud MRS Hive using the built-in automated checker engine.

CRITICAL CONSTRAINT: No Extra Analysis

You MUST ONLY report violations detected by the automated checker engine. Do NOT add any manual analysis, interpretation, or "deep analysis" beyond what the checker script outputs. This includes but is not limited to:

  • Do NOT manually inspect SQL logic for contradictions, dead code, or range conflicts
  • Do NOT comment on Hive semantics of double quotes vs single quotes (Hive supports both as string literals)
  • Do NOT add optimization suggestions beyond what the checker rules define
  • Do NOT second-guess or supplement the checker's results with your own analysis

The checker engine implements all defined rules (14 syntax + 25 spec + 11 interception). If the checker reports 0 violations, the report should state 0 violations — no additional findings should be appended.

Overview

Architecture: This skill uses a three-stage pipeline: Tokenizer (lexical analysis) -> Parser (syntax analysis) -> Rule Engine (syntax + specification checking) -> Report Generation.

Applicable Scenarios:

  • Validate SQL syntax before executing on MRS Hive cluster
  • Review SQL statements against Hive development specification
  • Check Hive-specific syntax (PARTITIONED BY, CLUSTERED BY, STORED AS, ROW FORMAT, etc.)
  • Detect large SQL interception risks based on defined rules

Typical Use Cases:

  • "Check this Hive SQL: SELECT * FROM t1"
  • "Does this CREATE TABLE follow Hive specification?"
  • "Validate the syntax of this INSERT OVERWRITE statement"
  • "Review my Hive SQL for specification compliance"
  • "Check if my SQL has partition pruning issues"

Check Modes

Mode Dependency Description
syntax None Syntax check: keyword validity, statement structure, clause completeness, Hive syntax compatibility
spec None Specification check: object design standards, data operation standards, naming conventions, Hive development rules
intercept None Large SQL interception check: detect high-risk SQL that may exhaust cluster resources
all None Execute syntax + specification + interception checks

Default: all mode (no external dependencies required).

Prerequisites

1. Python Requirements

  • Python >= 3.8
  • No additional packages required (standard library only)

2. Security Rules

  • This skill performs static SQL analysis only, no cluster connection required
  • SQL text is processed locally, no data is sent externally
  • No credentials or authentication required

Workflow

Step 1: Receive Input

Receive the SQL statement(s) and check mode from the user. If no mode is specified, default to all (syntax + spec + intercept).

IMPORTANT: Multi-statement Context: When the user provides multiple SQL statements (separated by ;), you MUST pass ALL statements together in a single checker call. Do NOT split and check them individually. The checker engine has built-in multi-statement support that:

  1. First pass: Scans all CREATE TABLE ... PARTITIONED BY statements to build a partitioned table registry (table names + partition field names)
  2. Second pass: Checks each statement independently, but shares the partitioned table context so that SELECT/INSERT statements referencing partitioned tables can trigger SPEC022 (partition pruning missing)

This is critical for rules like SPEC022 (partition pruning) which require knowing whether a table is partitioned — information that only exists in CREATE TABLE statements, not in the SELECT statement itself.

Correct: Pass all SQL together:

python ~/.cac/skills/huawei-cloud-mrs-hive-sql-check/scripts/hive_sql_checker.py "create table t(name string) partitioned by(dt string); select name from t;" all

Wrong: Split and check individually (SPEC022 will be missed):

python ~/.cac/skills/huawei-cloud-mrs-hive-sql-check/scripts/hive_sql_checker.py "create table t(name string) partitioned by(dt string);" all
python ~/.cac/skills/huawei-cloud-mrs-hive-sql-check/scripts/hive_sql_checker.py "select name from t;" all

Step 2: Tokenization

Run the tokenizer to convert SQL text into a Token stream.

python ~/.cac/skills/huawei-cloud-mrs-hive-sql-check/scripts/hive_sql_tokenizer.py "<sql_text>"

The tokenizer supports:

  • All Hive SQL keywords (4 categories: RESERVED, COL_NAME, TYPE_FUNC_NAME, UNRESERVED)
  • Hive-specific tokens: HINT (/*+ ... */), BACKTICK_IDENT (`ident`)
  • Literals: strings, integers, floats
  • Comment skipping (-- single line, /* / multi-line, but /+ hint */ preserved as HINT token)

Step 3: Parsing

Run the parser to generate AST and detect syntax errors.

python ~/.cac/skills/huawei-cloud-mrs-hive-sql-check/scripts/hive_sql_parser.py "<sql_text>"

The parser supports major

Полный SKILL.md на ClawHub

Установить huawei-cloud-mrs-hive-sql-check в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-mrs-hive-sql-check?

Huawei Cloud MRS Hive SQL specification checking skill. Checks SQL statements against defined syntax and specification rules using the automated checker engine. No extra manual analysis beyond defined rules. Trigger:"Hive SQL优化"、"检查Hive SQL"、"Hive SQL检查"、"Hive SQL规范"、"Hive SQL语法"、"Hive SQL review"

Как установить скилл huawei-cloud-mrs-hive-sql-check?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-mrs-hive-sql-check запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-mrs-hive-sql-check с