Huawei Cloud DWS SQL Check for Openclaw

Huawei Cloud DWS SQL Check is an Openclaw Skills utility that validates SQL syntax, standards, and DWS-specific compatibility before execution.

huaweiclouddev
v1.0.0
Jul 22, 2026
0
239
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install huawei-cloud-dws-sql-check

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install huawei-cloud-dws-sql-check using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Huawei Cloud DWS SQL Check?

DWS SQL Check is a local SQL quality gate for Huawei Cloud DWS that tokenizes, parses, and evaluates statements against grammar rules and development specifications. It catches unsupported keywords, malformed clauses, missing DISTRIBUTE BY definitions, risky DML patterns, and naming issues before SQL reaches a cluster.

Built for Openclaw Skills workflows, it runs offline with Python 3.8+ and no third-party packages, so teams can perform repeatable SQL linting without credentials or network access. The skill is especially useful for validating SELECT, CREATE TABLE, MERGE, and other DWS-specific statements with clear fix suggestions and report output.

Huawei Cloud DWS SQL Check Use Cases

  • Pre-flight validation before executing SQL on a DWS cluster
  • Reviewing CREATE TABLE, MERGE, INSERT OVERWRITE, and other DWS-specific statements
  • Enforcing SQL style, naming conventions, and object design standards in code review
  • Catching unsafe DML patterns like SELECT *, DELETE without WHERE, and Cartesian joins
  • Auditing SQL for performance anti-patterns before production rollout
  • Generating machine-readable or Markdown lint reports for CI and developer workflows

How Huawei Cloud DWS SQL Check Works

  1. Receive the SQL text and an optional check mode; if none is provided, default to syntax + spec.
  2. Tokenize the SQL into a DWS-aware token stream, preserving hints and other special tokens.
  3. Parse the token stream into an AST and validate statement structure against DWS grammar.
  4. Run syntax rules to detect invalid keywords, clause ordering issues, and unsupported DWS syntax.
  5. Run specification rules against the AST and tokens to catch design, naming, and SQL best-practice violations; cluster-required rules are skipped in static mode.
  6. Generate a JSON or Markdown report with severity, location, code snippet, and fix suggestion for each violation.

Huawei Cloud DWS SQL Check Setup

  1. Ensure Python 3.8 or later is available.
  2. Place the skill directory under ~/.cac/skills/huawei-cloud-dws-sql-check/.
  3. No extra pip dependencies are required; the skill uses the Python standard library only.
  4. Run the tokenizer, parser, or checker directly from the scripts/ directory.
python --version
python ~/.cac/skills/huawei-cloud-dws-sql-check/scripts/dws_sql_checker.py 'SELECT id, name FROM t1' all
python ~/.cac/skills/huawei-cloud-dws-sql-check/scripts/dws_sql_tokenizer.py 'SELECT * FROM t1'
python ~/.cac/skills/huawei-cloud-dws-sql-check/scripts/dws_sql_parser.py 'SELECT * FROM t1'
  1. For Python integration, import check_sql_markdown and embed the report in your own tooling.
  2. Use all mode for the most complete Openclaw Skills review of DWS SQL quality.

Huawei Cloud DWS SQL Check Data Schema & Taxonomy

Metadata taxonomy

Key Meaning
name Skill display name
description Capability summary
tags huawei-cloud, dws, sql, check, lint

Rule and artifact layers

Layer Artifact Purpose
Input SQL text + check_mode (syntax, spec, all) Defines the scope of analysis
Lexical layer Token stream from dws_sql_tokenizer.py Converts SQL into DWS-aware tokens
Parse layer AST from dws_sql_parser.py Represents statement structure for rule evaluation
Rule catalogs rules/syntax_rules.yaml, rules/spec_rules.yaml, rules/perf_rules.yaml Stores rule IDs, severities, descriptions, and cluster requirements
Language model rules/keywords.py, rules/grammar_rules.py Defines 594 keywords and 160+ statement types
Schema reference references/ast_schema.md Documents AST node types and fields
Output JSON or Markdown report Emits summary, violations, positions, and fix suggestions

Classification scheme

  • Syntax rules: SYN-ERR, SYN001-SYN019
  • Specification rules: SPEC001-SPEC040
  • Performance rules: PERF001-PERF011 (cluster-aware)
  • Severities: ERROR, WARNING, INFO
  • Categories: Object Design, Data Operation, Naming, SQL Dev

Reports are emitted to stdout and can be saved or transformed by the caller for CI, review tools, or documentation pipelines.

Huawei Cloud DWS SQL Check Advanced Features

  • Three-stage pipeline: tokenizer -> parser -> rule engine -> report generation
  • 594-keyword DWS tokenizer with reserved, column-name, type/function, and unreserved keyword classes
  • Support for DWS-specific syntax including DISTRIBUTE BY, PARTITION BY, TIMECAPSULE TABLE, MERGE, REPLACE INTO, and optimizer hints
  • Recursive descent parser covering 160+ statement types across DML, DDL, DCL, TCL, and utility commands
  • Dual report formats: machine-readable JSON and developer-friendly Markdown
  • Static, offline analysis with no credentials, no cluster connection, and no third-party packages required
  • Rule-level guidance with line and column positioning plus fix suggestions, ideal for Openclaw Skills automation and CI linting

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*