Huawei Cloud Doris Sql Check logo

Huawei Cloud Doris Sql Check

Organization
huaweicloud
huawei-cloud-doris-sql-check

Comprehensive SQL statement checking for Apache Doris (based on Doris 3.1.4 Nereids ANTLR4 grammar), supporting two check modes: 1. Syntax Check - Keyword validation, statement structure verification, clause completeness, Doris-specific syntax compatibility (DISTRIBUTED BY, PARTITION BY, ENGINE, DUPLICATE/AGGREGATE/UNIQUE KEY, INSERT OVERWRITE, LOAD, EXPORT, MTMV, BACKUP/RESTORE etc.) 2. Specification Check - Object design standards, data operation standards, naming conventions based on Apache Doris development best practices. Built-in custom Doris SQL tokenizer (504 keywords from DorisLexer.g4) and recursive descent parser supporting 100+ Doris statement types. Applicable when users need SQL quality review, syntax validation, or specification compliance checking for Apache Doris SQL (versions 2.1.x / 3.0.x / 3.1.x / 4.x). 触发词:"Doris SQL检查"、"Doris SQL规范"、"Doris SQL审计"、"Doris SQL语法"、"检查Doris SQL"、"Doris SQL review"

Overview

Publisherhuaweicloud
Repositoryhuaweicloud-skills
Skill namehuawei-cloud-doris-sql-check
Stars
59
Forks
24
Bundled files
10
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by huaweicloud on GitHub. Read the source before you install it.

Installation

Install the Huawei Cloud Doris Sql Check AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/huaweicloud/huaweicloud-skills/tree/master/skills/bigdata/mrs/huawei-cloud-doris-sql-check
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huaweicloud/huaweicloud-skills.git /tmp/huaweicloud-skills
mkdir -p .claude/skills
cp -r /tmp/huaweicloud-skills/skills/bigdata/mrs/huawei-cloud-doris-sql-check .claude/skills/huawei-cloud-doris-sql-check
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Huawei Cloud Doris Sql Check in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Huawei Cloud Doris Sql Check on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Huawei Cloud Doris Sql Check is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Doris SQL Check Skill

You are an Apache Doris SQL specification checking expert, responsible for comprehensive SQL statement checking for Apache Doris (based on Doris 3.1.4 source code). You have a custom-built Doris SQL tokenizer and recursive descent parser that can precisely identify Doris-specific syntax from the Nereids ANTLR4 grammar (DorisLexer.g4 / DorisParser.g4).

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 a Doris cluster (FE/BE)
  • Review SQL statements against Apache Doris development best practices
  • Check Doris-specific syntax (DISTRIBUTED BY HASH/RANDOM, PARTITION BY RANGE/LIST/AUTO, BUCKETS, PROPERTIES, ENGINE, DUPLICATE/AGGREGATE/UNIQUE KEY, INSERT OVERWRITE TABLE, LOAD LABEL, ROUTINE LOAD, EXPORT, MTMV, BACKUP/RESTORE SNAPSHOT, ADMIN SET/SHOW, CANCEL, KILL, TABLESAMPLE, OUTFILE, Hint /*+ /, full-text MATCH_, COLOCATE GROUP)
  • Identify potential performance anti-patterns in Doris SQL statements

Typical Use Cases:

  • "Check this Doris SQL: SELECT * FROM t1"
  • "Does this CREATE TABLE follow Doris specification (DISTRIBUTED BY, KEY model, PARTITION)?"
  • "Validate the syntax of this INSERT OVERWRITE TABLE statement"
  • "Review my Doris SQL for specification compliance"
  • "Check if my SQL uses Doris-specific syntax correctly (MTMV, LOAD, EXPORT)"
  • "Validate BACKUP/RESTORE SNAPSHOT syntax"
  • "Check my ROUTINE LOAD job definition"

Check Modes

ModeDependencyDescription
syntaxNoneSyntax check: keyword validity, statement structure, clause completeness, Doris syntax compatibility
specNoneSpecification check: object design standards, data operation standards, naming conventions
allNoneExecute both syntax and specification checks

Default: syntax + spec 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 and check mode from the user. If no mode is specified, default to syntax + spec.

Step 2: Tokenization

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

bash
python ~/.cac/skills/huawei-cloud-doris-sql-check/scripts/doris_sql_tokenizer.py "<sql_text>"

The tokenizer supports:

  • All 504 Doris keywords (from DorisLexer.g4 between --DORIS-KEYWORD-LIST-START and --DORIS-KEYWORD-LIST-END)
  • Doris-specific tokens: HINT (/*+ ... */), BACKQUOTED (`ident`), ARROW (->), NSEQ (<=> null-safe eq), EQ (= or ==), NEQ (<> or !=), LTE (<= or !>), GTE (>= or !<), DOUBLEPIPES (||), LOGICALAND (&&), LOGICALNOT (!)
  • Literals: strings ('...' / "..."), integers, decimals, bigints (123L), smallints (123S), tinyints (123Y), bigdecimals (123BD), exponents
  • Backquoted identifiers: `table_name` (Doris-style, preferred over double quotes)
  • Comment skipping (-- single line, /* */ multi-line, but /*+ hint */ preserved as HINT token)
  • Full-text search operators: MATCH_ALL, MATCH_ANY, MATCH_PHRASE, MATCH_PHRASE_PREFIX, MATCH_PHRASE_EDGE, MATCH_REGEXP, MATCH_NAME, MATCH_NAME_GLOB

Step 3: Parsing

Run the parser to generate AST and detect syntax errors.

bash
python ~/.cac/skills/huawei-cloud-doris-sql-check/scripts/doris_sql_parser.py "<sql_text>"

The parser supports major Doris statement types (based on DorisParser.g4):

  • DML: SELECT (with CTE, set ops, window, TABLESAMPLE), INSERT INTO/OVERWRITE TABLE, UPDATE, DELETE, LOAD (BROKER LOAD), EXPORT, COPY INTO, TRUNCATE
  • DDL: CREATE TABLE (with DISTRIBUTED BY, PARTITION BY, KEY model, ENGINE, PROPERTIES), CREATE TABLE LIKE, CREATE VIEW, CREATE MTMV (Multi-Table Materialized View), CREATE INDEX (BITMAP/NGRAM_BF/INVERTED), ALTER TABLE (ADD/MODIFY/DROP/RENAME COLUMN, ADD/DROP PARTITION, ADD/DROP INDEX, ROLLUP, TAG/BRANCH), DROP TABLE/VIEW/INDEX, CREATE CATALOG, CREATE DATABASE, CREATE USER/ROLE, CREATE RESOURCE, CREATE STAGE, CREATE ENCRYPTKEY, CREATE JOB, CREATE ROW POLICY, CREATE SQL_BLOCK_RULE, CREATE STORAGE VAULT/POLICY, CREATE WORKLOAD GROUP/POLICY
  • DCL: GRANT/REVOKE (table/resource/role privileges)
  • TCL: BEGIN/START TRANSACTION, COMMIT, ROLLBACK
  • Utility: EXPLAIN (PARSED/ANALYZED/REWRITTEN/LOGICAL/OPTIMIZED/PHYSICAL/SHAPE/MEMO/DISTRIBUTED/ALL, VERBOSE/TREE/GRAPH/PLAN), SET (variables/options), SHOW (50+ variants), DESC/DESCRIBE, ADMIN SET/SHOW (replica, frontend config, tablet diagnose, trash, TDE), KILL (CONNECTION/QUERY), CANCEL (LOAD/EXPORT/ALTER TABLE/BACKUP/RESTORE/WARM UP), BACKUP/RESTORE SNAPSHOT, RECOVER (DATABASE/TABLE/PARTITION), CLEAN (LABEL/PROFILE/QUERY STATS), INSTALL/UNINSTALL PLUGIN, LOCK/UNLOCK TABLES, WARM UP, SYNC, HELP, CALL PROCEDURE

Doris-specific syntax:

  • DISTRIBUTED BY {HASH(cols) | RANDOM} (BUCKETS n | AUTO)?
  • PARTITION BY (RANGE | LIST)? ... (AUTO)? (auto partition, step partition, less-than, fixed, in-list)
  • (DUPLICATE | AGGREGATE | UNIQUE) KEY (cols) (CLUSTER BY cols)?
  • ENGINE = olap | mysql | elasticsearch | hive | hudi | iceberg | jdbc | ...
  • PROPERTIES ('key'='value', ...)
  • INSERT OVERWRITE TABLE ...
  • LOAD LABEL ... (DATA INFILE (...) INTO TABLE ...)
  • CREATE ROUTINE LOAD ... FROM type (...)
  • EXPORT TABLE ... TO ...
  • BACKUP SNAPSHOT ... TO repo (ON|EXCLUDE (...))?
  • RESTORE SNAPSHOT ... FROM repo (ON|EXCLUDE (...))?
  • EXPLAIN {PARSED|ANALYZED|REWRITTEN|LOGICAL|OPTIMIZED|PHYSICAL|SHAPE|MEMO|DISTRIBUTED|ALL} [VERBOSE|TREE|GRAPH|PLAN] [PROCESS]
  • CREATE MATERIALIZED VIEW ... (DUPLICATE KEY ...)? PARTITION BY ... DISTRIBUTED BY ... AS query
    • BUILD [IMMEDIATE|DEFERRED], REFRESH [COMPLETE|AUTO], ON [MANUAL|SCHEDULE|COMMIT]
  • TABLESAMPLE (...) (REPEATABLE n)?
  • WITH cte_name AS (...) (CTE; Doris does not require explicit RECURSIVE keyword)
  • Window functions: OVER (PARTITION BY ... ORDER BY ... ROWS/RANGE ...)
  • OUTFILE 'path' (FORMAT AS ...)? (PROPERTIES (...))?
  • Hints: /*+ hint_name(...) */ and [hint_name] relation hints
  • ALTER COLOCATE GROUP name SET (...)
  • Full-text search: col MATCH_ALL '...', MATCH_PHRASE, MATCH_PHRASE_PREFIX, MATCH_PHRASE_EDGE, MATCH_ANY, MATCH_REGEXP
  • Aggregate unions: HLL_UNION, BITMAP_UNION, QUANTILE_UNION, REPLACE_IF_NOT_NULL
  • Doris data types: TINYINT, SMALLINT, INT, BIGINT, LARGEINT, BOOLEAN, FLOAT, DOUBLE, DATE, DATETIME, DATEV2, DATETIMEV2, DATEV1, DATETIMEV1, BITMAP, QUANTILE_STATE, HLL, AGG_STATE, STRING, JSON, JSONB, TEXT, VARCHAR, CHAR, DECIMAL, DECIMALV2, DECIMALV3, IPV4, IPV6, ARRAY, MAP, STRUCT, VARIANT

Step 4: Syntax Check

Based on tokenization and parsing results, execute syntax check rules.

Syntax Check Rules (34 rules):

Rule IDNameLevelDescription
SYN-ERRLexical ErrorERRORUnrecognized characters in SQL text
SYN001Invalid KeywordERRORKeyword not supported by Doris (not in 504-keyword list)
SYN002Reserved Keyword as IdentifierERRORReserved keyword used as identifier without backticks
SYN003Syntax Structure ErrorERRORMissing required clause or keyword
SYN004Clause Ordering ErrorERRORSQL clause order does not conform to grammar
SYN005DISTRIBUTED BY Syntax ErrorERRORInvalid distribution strategy (only HASH/RANDOM supported)
SYN006PARTITION BY Syntax ErrorERRORInvalid partition definition (RANGE/LIST/AUTO)
SYN007BUCKETS Syntax ErrorERRORInvalid BUCKETS clause (must be INTEGER or AUTO)
SYN008EXPLAIN planType Syntax ErrorERRORInvalid EXPLAIN plan type (PARSED/ANALYZED/REWRITTEN/LOGICAL/OPTIMIZED/PHYSICAL/SHAPE/MEMO/DISTRIBUTED/ALL)
SYN009KEY Model Syntax ErrorERRORInvalid data model (DUPLICATE/AGGREGATE/UNIQUE KEY)
SYN010PROPERTIES Syntax ErrorERRORInvalid PROPERTIES clause structure
SYN011ENGINE Syntax ErrorERRORInvalid ENGINE clause
SYN012INSERT OVERWRITE Syntax ErrorERRORInvalid INSERT OVERWRITE TABLE structure
SYN013LOAD Syntax ErrorERRORInvalid LOAD LABEL / BROKER LOAD structure
SYN014ROUTINE LOAD Syntax ErrorERRORInvalid CREATE ROUTINE LOAD structure
SYN015EXPORT Syntax ErrorERRORInvalid EXPORT TABLE ... TO structure
SYN016BACKUP/RESTORE SNAPSHOT Syntax ErrorERRORInvalid BACKUP/RESTORE SNAPSHOT structure
SYN017CREATE MTMV Syntax ErrorERRORInvalid CREATE MATERIALIZED VIEW structure
SYN018CREATE CATALOG Syntax ErrorERRORInvalid CREATE CATALOG structure
SYN019CREATE USER/ROLE Syntax ErrorERRORInvalid CREATE USER/ROLE structure
SYN020CREATE ROW POLICY Syntax ErrorERRORInvalid CREATE ROW POLICY structure
SYN021CREATE SQL_BLOCK_RULE Syntax ErrorERRORInvalid CREATE SQL_BLOCK_RULE structure
SYN022CREATE STAGE Syntax ErrorERRORInvalid CREATE STAGE structure
SYN023CREATE JOB Syntax ErrorERRORInvalid CREATE JOB ON SCHEDULE structure
SYN024CREATE ENCRYPTKEY Syntax ErrorERRORInvalid CREATE ENCRYPTKEY structure
SYN025ADMIN SET/SHOW Syntax ErrorERRORInvalid ADMIN statement structure
SYN026CANCEL Syntax ErrorERRORInvalid CANCEL statement (LOAD/EXPORT/ALTER/BACKUP/RESTORE/WARM UP)
SYN027KILL Syntax ErrorERRORInvalid KILL (CONNECTION/QUERY) statement
SYN028TABLESAMPLE Syntax ErrorERRORInvalid TABLESAMPLE clause (PERCENT/ROWS, REPEATABLE)
SYN029OUTFILE Syntax ErrorERRORInvalid OUTFILE clause (FORMAT AS, PROPERTIES)
SYN030Hint Syntax ErrorWARNINGInvalid hint format (must be /*+ name(...) */ or [name])
SYN031Full-text MATCH Syntax ErrorERRORInvalid MATCH_ALL/MATCH_ANY/MATCH_PHRASE/MATCH_REGEXP usage
SYN032COLOCATE GROUP Syntax ErrorERRORInvalid ALTER COLOCATE GROUP structure
SYN033GRANT/REVOKE Syntax ErrorERRORInvalid GRANT/REVOKE privilege structure

Step 5: Specification Check

Based on AST and Token stream, execute specification check rules. Rules are derived from DorisParser.g4 grammar definitions and Apache Doris development best practices.

Specification Check Rules (46 rules):

Rule IDNameLevelCategoryDescription
SPEC001Missing DISTRIBUTED BYERRORObject DesignCREATE TABLE without distribution strategy (Doris requires DISTRIBUTED BY HASH or RANDOM)
SPEC002Missing ENGINEINFOObject DesignCREATE TABLE without explicit ENGINE (defaults to OLAP)
SPEC003SELECT * ProhibitedERRORData OperationQuery must specify explicit column list
SPEC004DELETE/UPDATE without WHEREERRORData OperationDML must include WHERE condition
SPEC005NOT IN SubqueryWARNINGData OperationRecommend NOT EXISTS or LEFT JOIN ... IS NULL
SPEC006DISTINCT PerformanceINFOData OperationDISTINCT may impact performance
SPEC007Implicit Type ConversionWARNINGData OperationMay cause index/zone-map invalidation
SPEC008LIKE Leading WildcardWARNINGData OperationCannot use zone-map or index
SPEC009OR ConditionINFOData OperationMay impact execution plan
SPEC010IN List Too LongWARNINGData Operation>1000 values recommend temp table
SPEC011FROM SubqueryINFOData OperationRecommend CTE instead
SPEC012Cartesian ProductERRORData OperationMulti-table missing JOIN condition
SPEC013INSERT Missing Column ListWARNINGData OperationRelies on default column order
SPEC014Missing Table CommentINFOObject DesignTable without COMMENT
SPEC015Table Naming ConventionWARNINGNamingShould use lowercase with underscores
SPEC016Column Naming ConventionWARNINGNamingShould use lowercase with underscores
SPEC017Reserved Keyword as IdentifierERRORNamingMay cause syntax ambiguity
SPEC018Distribution Key Column Not FoundWARNINGObject DesignDistribution key should be actual table column
SPEC019Partition Key Same as Distribution KeyINFOObject DesignMay cause data skew
SPEC020Missing KEY Model DefinitionINFOObject DesignRecommend explicit DUPLICATE/AGGREGATE/UNIQUE KEY
SPEC021Large Table Should Have PartitionINFOObject DesignImprove query and governance efficiency
SPEC022BUCKETS Count RecommendationINFOObject DesignRecommend appropriate bucket count for table size
SPEC023Column Should Have NOT NULLINFOObject DesignOptimizer can leverage NOT NULL
SPEC024DROP Should Use IF EXISTSWARNINGSQL DevPrevent error when object not found
SPEC025INSERT Multi-VALUESWARNINGSQL DevMultiple VALUES groups inefficient; use STREAM LOAD / BROKER LOAD
SPEC026Column-store Real-time INSERTWARNINGSQL DevFrequent small-batch INSERT into Doris (columnar) causes compaction pressure
SPEC027Frequent UPDATE/DELETEWARNINGSQL DevDoris UPDATE/DELETE is costly (read-merge-write)
SPEC028Function on Filter ColumnWARNINGSQL DevAffects statistics accuracy and zone-map usage
SPEC029Large Table COUNTWARNINGSQL DevFull table scan I/O cost
SPEC030Query Should Use LIMITINFOSQL DevAvoid oversized result sets
SPEC031CTE Recursion SafetyWARNINGSQL DevEnsure termination condition for recursive CTE
SPEC032Use Catalog/DB PrefixINFOSQL DevAvoid ambiguity in multi-catalog scenarios
SPEC033View Nesting Depth ≤ 3INFOObject DesignRequires cluster: query view dependencies
SPEC034Index Count > 5WARNINGObject DesignRequires cluster: query table indexes
SPEC035Non-pushdown SQL ProhibitedERRORSQL DevRequires cluster: EXPLAIN analysis
SPEC036BITMAP/HLL Column Needs Aggregation TypeWARNINGObject DesignBITMAP/HLL columns should specify BITMAP_UNION/HLL_UNION
SPEC037Use MTMV for Repeated Complex QueriesINFOObject DesignRecommend MTMV for repeated aggregation queries
SPEC038Avoid Frequent OUTFILE ExportINFOSQL DevUse EXPORT or broker for large exports
SPEC039VARCHAR Length Should Be ExplicitWARNINGObject DesignAvoid VARCHAR without length for large strings
SPEC040DECIMAL Precision Should Be ExplicitWARNINGObject DesignUse DECIMAL(p,s) or DECIMALV3(p,s), avoid bare DECIMAL
SPEC041COUNT(DISTINCT) Excessive UseERRORComplex Query LimitCOUNT(DISTINCT) count > 5, may cause severe performance degradation
SPEC042NOT IN Subquery ProhibitedERRORComplex Query LimitNOT IN subquery causes full scan and severe performance drop; use NOT EXISTS or LEFT JOIN
SPEC043Excessive JOINsERRORComplex Query LimitJOIN count > 20, may cause unstable query plans and high memory usage
SPEC044Excessive UNION ALLsERRORComplex Query LimitUNION ALL count > 20, may cause complex plans and high resource consumption
SPEC045Deeply Nested SubqueriesERRORComplex Query LimitSubquery nesting depth > 20, may cause severe parse and execution performance issues
SPEC046SQL Statement Too LongERRORComplex Query LimitSQL text length > 2MB, may cause parse timeout or excessive memory usage

Step 6: Generate Report

Use the check engine to generate a Markdown format report:

bash
python ~/.cac/skills/huawei-cloud-doris-sql-check/scripts/doris_sql_checker.py "<sql_text>" all

Report format:

markdown
# Doris SQL Check Report

**Check Time**: 2026-07-17T10:00:00
**Statement Type**: SELECT
**Check Mode**: all

## Summary

| Metric | Value |
|--------|-------|
| Total Rules | 74 |
| Passed | 71 |
| Violations | 3 |
| Errors (ERROR) | 1 |
| Warnings (WARNING) | 1 |
| Infos (INFO) | 1 |

## Syntax Check

### [X] SYN003: Syntax Structure Error
- **Level**: ERROR
- **Position**: Line 1, Column 15
- **Description**: Missing FROM clause
- **Fix Suggestion**: Add FROM table_name

## Specification Check

### [!] SPEC003: SELECT * Prohibited
- **Level**: WARNING
- **Position**: Line 1, Column 8
- **Description**: Query uses SELECT *, should specify explicit column list
- **Fix Suggestion**: Replace SELECT * with specific column list

Core Commands

doris_sql_checker.py doris_sql_parser.py doris_sql_tokenizer.py

Parameters

ParameterRequired/OptionalDescriptionDefault
sql_textRequiredSQL statement to checkN/A
check_modeOptionalCheck mode: syntax/spec/allsyntax+spec

Output Format

The check report is output in Markdown format, containing:

  • Summary table: Total rules, passed, violations by level
  • Syntax check section: Violations from syntax rules (SYN-ERR, SYN001-SYN033)
  • Specification check section: Violations from specification rules (SPEC001-SPEC040)
  • Original SQL: The checked SQL statement

Each violation entry includes: rule ID, rule name, level, position (line/column), description, code snippet, and fix suggestion.

Quick Check Command

For simple SQL checks, run directly:

bash
python ~/.cac/skills/huawei-cloud-doris-sql-check/scripts/doris_sql_checker.py "<sql_text>" [syntax|spec|all]

Output is in JSON format. For Markdown format report, call in Python:

python
from doris_sql_checker import check_sql_markdown
report = check_sql_markdown("SELECT * FROM t1", "all")
print(report)

Best Practices

  1. Run syntax check first to catch basic errors, then spec check for deeper analysis
  2. For CREATE TABLE statements, always include DISTRIBUTED BY HASH(分布键) or DISTRIBUTED BY RANDOM to avoid SPEC001
  3. For Doris tables, explicitly specify the KEY model (DUPLICATE KEY/AGGREGATE KEY/UNIQUE KEY)
  4. Use all mode for comprehensive checking
  5. Rules marked with requires_mcp: true or "Requires cluster" (SPEC033, SPEC034, SPEC035) need cluster connection and are skipped in static mode
  6. Doris does NOT support MERGE INTO ... WHEN MATCHED or ON DUPLICATE KEY UPDATE — these will be flagged as syntax errors
  7. Doris identifiers use backticks (`), not double quotes — using double quotes for identifiers will trigger a warning
  8. For large data loading, prefer STREAM LOAD / BROKER LOAD / ROUTINE LOAD over multi-row INSERT VALUES (SPEC025)

References

DocumentDescription
AST SchemaAST node type definitions for Doris SQL
Syntax Rules34 syntax check rule definitions
Specification Rules40 specification check rule definitions
Performance Rules11 performance check rule definitions (requires cluster)
Keywords504 Doris SQL keyword definitions (from DorisLexer.g4)
Grammar Rules100+ Doris statement type grammar definitions (from DorisParser.g4)

Notes

  1. Syntax and specification checks do not require cluster connection, can run offline
  2. Rules marked "Requires cluster" (SPEC033, SPEC034, SPEC035) are skipped in static mode
  3. Performance rules (PERF001-PERF011) are defined in rules/perf_rules.yaml but require cluster connection for execution (EXPLAIN ANALYZE, system tables like information_schema.tables, backends, etc.)
  4. Doris-specific syntax checking (DISTRIBUTED BY, PARTITION BY, BUCKETS, PROPERTIES, ENGINE, DUPLICATE/AGGREGATE/UNIQUE KEY, INSERT OVERWRITE, LOAD, EXPORT, MTMV, BACKUP/RESTORE, ADMIN, CANCEL, KILL, TABLESAMPLE, OUTFILE, Hint, MATCH, COLOCATE GROUP) is based on DorisParser.g4 (Nereids ANTLR4 grammar) from Doris 3.1.4 source
  5. The check engine includes a custom tokenizer and recursive descent parser, no external SQL parsing libraries required (no ANTLR runtime needed)
  6. Version compatibility: This skill is based on Doris 3.1.4 grammar. Doris 2.1.x / 3.0.x / 3.1.x / 4.x share the same Nereids grammar for most constructs; minor differences may exist for newer syntax (e.g., 4.x added features). Verify against your cluster's version before relying on specific rules.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Huawei Cloud Doris Sql Check AI skill do?

Comprehensive SQL statement checking for Apache Doris (based on Doris 3.1.4 Nereids ANTLR4 grammar), supporting two check modes: 1. Syntax Check - Keyword validation, statement structure verification, clause completeness, Doris-specific syntax compatibility (DISTRIBUTED BY, PARTITION BY, ENGINE, DUPLICATE/AGGREGATE/UNIQUE KEY, INSERT OVERWRITE, LOAD, EXPORT, MTMV, BACKUP/RESTORE etc.) 2. Specification Check - Object design standards, data operation standards, naming conventions based on Apache Doris development best practices. Built-in custom Doris SQL tokenizer (504 keywords from DorisLexe...

Why use Huawei Cloud Doris Sql Check on TypingMind?

Because you install it once and use it with any model. Huawei Cloud Doris Sql Check is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Huawei Cloud Doris Sql Check in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huaweicloud/huaweicloud-skills/tree/master/skills/bigdata/mrs/huawei-cloud-doris-sql-check. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Huawei Cloud Doris Sql Check?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Huawei Cloud Doris Sql Check?

As many as you like. As long as a model supports skills, you can use Huawei Cloud Doris Sql Check with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Huawei Cloud Doris Sql Check AI skill free?

Yes. It is published on GitHub by huaweicloud under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇