This skill provides comprehensive SQL guidance for Transwarp ArgoDB 5.2.1, a distributed analytical database developed by Transwarp.
Generate SQL statements for ArgoDB based on user requirements. The skill provides:
Important: This skill only generates SQL statements for user execution. Do NOT connect to ArgoDB databases.
Use this skill when user mentions:
references/
| Document | Content | When to Load |
|----------|---------|--------------|
| references/ddl_syntax.md | CREATE DATABASE/TABLE, ALTER, DROP | Table creation, schema changes |
| references/dml_syntax.md | INSERT, UPDATE, DELETE, MERGE | Data manipulation |
| references/dql_syntax.md | SELECT, JOIN, UNION | Query operations |
| references/data_types.md | Supported data types | Column type selection |
| references/storage_formats.md | STORED AS options | Storage format selection |
> Important: Follow these specifications for all SQL generation.
| Data Type | Use Case | Example |
|-----------|----------|---------|
| string | All strings | Names, codes, descriptions |
| bigint | All integers | IDs, quantities |
| decimal(38,10) | All decimals | Prices, amounts, rates |
| date | Date | YYYY-MM-DD |
| timestamp | Timestamp | YYYY-MM-DD HH:MI:SS |
string
string
bigint
decimal(38,10)
string
COMMENT
COMMENT
| Field Name | Type | Comment | Description |
|------------|------|---------|--------------|
| src_tab_nm | string | '来源表名' | Source table name |
| etl_job | string | 'ETL加载作业名' | ETL job name |
| etl_tx_dt | date | 'ETL加载日期' | ETL transaction date |
| etl_upd_dt | date | 'ETL更新日期' | ETL update date |
| etl_proc_dttm | timestamp | 'ETL处理时间戳' | ETL process timestamp |
CREATE TABLE sales (
-- Business fields
trans_id bigint COMMENT '交易ID',
trans_time date COMMENT '交易时间',
trans_type string COMMENT '交易类型',
amount decimal(38,10) COMMENT '交易金额',
-- Standard technical fields
src_tab_nm string COMMENT '来源表名',
etl_job string COMMENT 'ETL加载作业名',
etl_tx_dt date COMMENT 'ETL加载日期',
etl_upd_dt date COMMENT 'ETL更新日期',
etl_proc_dttm timestamp COMMENT 'ETL处理时间戳'
)
COMMENT '销售交易表'
STORED AS HOLODESK;
-- WRONG: Missing comments
CREATE TABLE sales (
trans_id INT, -- Missing COMMENT
amount DECIMAL(10,2), -- Missing COMMENT
trans_type VARCHAR(50) -- Wrong type, Missing COMMENT
);
-- WRONG: Missing technical fields
CREATE TABLE sales (
trans_id bigint COMMENT '交易ID',
amount decimal(38,10) COMMENT '交易金额'
-- Missing src_tab_nm, etl_job, etl_tx_dt, etl_upd_dt, etl_proc_dttm
);
| Format | Description | Use Case |
|--------|-------------|----------|
| HOLODESK | High-performance columnar storage (recommended) | Big data analytics |
| TEXTFILE | Text file format | Default format |
| ORC | Optimized Row Columnar | Hive compatibility |
| PARQUET | Columnar format | Cross-platform |
| TORC | Transactional ORC | ACID transactions |
Recommendation: Use HOLODESK as default storage format.
Set dialect: SET server.dialect =
FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT
CREATE TABLE sales (
trans_id bigint COMMENT '交易ID',
acc_num bigint COMMENT '账户号',
trans_time date COMMENT '交易时间',
trans_type string COMMENT '交易类型',
price decimal(38,10) COMMENT '价格',
amount bigint COMMENT '数量',
-- Standard technical fields
src_tab_nm string COMMENT '来源表名',
etl_job string COMMENT 'ETL加载作业名',
etl_tx_dt date COMMENT 'ETL加载日期',
etl_upd_dt date COMMENT 'ETL更新日期',
etl_proc_dttm timestamp COMMENT 'ETL处理时间戳'
)
COMMENT '销售交易信息表'
STORED AS HOLODESK;
-- Single row
INSERT INTO sales VALUES (
1, 100, '2024-01-01', 'online', 99.99, 5,
'source_table', 'job_sales', '2024-01-01', '2024-01-01', '2024-01-01 14:30:00'
);
-- Batch insert
INSERT INTO sales VALUES
(2, 101, '2024-01-02', 'store', 49.99, 10, 'source_table', 'job_sales', '2024-01-02', '2024-01-02', '2024-01-02 14:30:00'),
(3, 102, '2024-01-03', 'wholesale', 199.99, 2, 'source_table', 'job_sales', '2024-01-03', '2024-01-03', '2024-01-03 14:30:00');
SELECT
e.name,
d.dept_name,
e.salary
FROM employees e
JOIN departments d ON e.dept_id = d.id
WHERE e.is_valid = 'Y'
ORDER BY e.salary DESC
LIMIT 10;
共 1 个版本