starrocks-ddl-table-types

Select StarRocks table key types and generate CREATE TABLE DDL.

14|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/ivanshamaev/de-agent-skills --skill starrocks-ddl-table-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: starrocks-ddl-table-types
Source: https://github.com/ivanshamaev/de-agent-skills/tree/main/group_skills/starrocks_group_skills/starrocks_ddl_table_types
Command: npx skills add https://github.com/ivanshamaev/de-agent-skills --skill starrocks-ddl-table-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you choose the correct StarRocks table type and write correct CREATE TABLE DDL so your data ingest semantics (append, upsert, dedup, and CDC) match the storage and merge behavior.

Core Features & Use Cases

  • Table-type decision guidance: Choose among Duplicate Key, Aggregate Key, Unique Key, and Primary Key based on whether you need append-only throughput, pre-aggregation, deduplication, or full upsert/delete.
  • DDL correctness for keys and semantics: Define key columns, ensure key-column rules (prefix/sort-key constraints), and pick appropriate aggregate functions for Aggregate Key.
  • CDC and real-time design support: Create Primary Key CDC target tables with proper MVCC expectations and when to enable persistent index for scale.
  • Use Case: Build an ODS append-only events table with DUPLICATE KEY, then load and roll up daily metrics into an AGGREGATE KEY table using SUM/MAX/MIN/HLL_UNION/BITMAP_UNION, and maintain a CDC dimension with PRIMARY KEY that supports UPDATE and DELETE.

Quick Start

Ask the AI to generate a StarRocks CREATE TABLE DDL for your intended workload and explain which of Duplicate Key, Aggregate Key, Unique Key, or Primary Key you should use based on your need for UPDATE/DELETE, dedup rules, and any required pre-aggregation functions.

Frequently Asked Questions about starrocks-ddl-table-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use Primary Key vs Unique Key for CDC upsert and delete workloads in StarRocks?

Use StarRocks Primary Key tables for CDC workloads requiring real-time upsert and delete operations with MVCC semantics, enabling persistent index for scale. Unique Key tables also support deduplication but lack the same delete and update efficiency for CDC ingestion.

How do I choose the right StarRocks table type for append-only event ingestion?

Choose StarRocks Duplicate Key tables for append-only event ingestion to maximize throughput. Duplicate Key tables retain all records without deduplication, making them ideal for raw ODS event logs where compaction behavior favors write speed.

What StarRocks DDL aggregates daily metrics using SUM, MAX, or HLL_UNION?

StarRocks Aggregate Key tables pre-aggregate daily metrics using functions like SUM, MAX, MIN, HLL_UNION, and BITMAP_UNION. Define key columns and specified aggregate functions in the CREATE TABLE DDL to match desired rollup semantics.

How do key-column prefix and sort-key constraints affect StarRocks CREATE TABLE DDL?

StarRocks key-column rules require key columns to form a prefix of the sort key, directly affecting CREATE TABLE DDL layout. Correctly specifying this relationship ensures proper compaction behavior and query performance for the chosen table type.

Can I maintain a CDC dimension table with UPDATE and DELETE support in StarRocks?

Yes, maintain StarRocks CDC dimension tables with UPDATE and DELETE support using Primary Key tables. They provide proper MVCC expectations and handle upsert/delete operations efficiently for dimension data synchronization.