{"id":"208aff91-8206-4c5b-8811-7baf441c120d","shortId":"5a82C8","kind":"skill","title":"risingwave","tagline":"Use when working with RisingWave — streaming SQL database, materialized views, sources, sinks, CDC from PostgreSQL/MySQL, Kafka ingestion, time windows (TUMBLE/HOP/SESSION), watermarks, EMIT ON WINDOW CLOSE, port 4566, risingwave-mcp, event streaming pipeline design, real-time an","description":"# RisingWave\n\nRisingWave is a streaming SQL database implementing the PostgreSQL wire protocol.\nThe core pipeline is: **Source** (ingest) → **Materialized View** (continuous compute) → **Sink** (output).\n\n## Core Principles\n\n1. **Port 4566, not 5432** — RisingWave listens on `4566` for SQL connections. Dashboard is at `5691`.\n2. **SOURCE ≠ TABLE** — `CREATE SOURCE` connects a stream but doesn't persist data. `CREATE TABLE` persists. For CDC (Debezium, Maxwell, Canal), you MUST use `CREATE TABLE ... FROM source`.\n3. **Watermarks unlock window closing** — Without `WATERMARK FOR col AS col - INTERVAL '...'`, `EMIT ON WINDOW CLOSE` won't work; use it on the source or table definition. In RisingWave 2.8+, watermarks on `TABLE` require `APPEND ONLY` — use `CREATE SOURCE` for non-append-only streams that need watermarks.\n4. **`EMIT ON WINDOW CLOSE` vs default** — Default emit-on-update sends partial results after each checkpoint. Use `EMIT ON WINDOW CLOSE` for final, immutable window results.\n5. **Large backfills need `BACKGROUND_DDL`** — Creating an MV over a large table blocks without `SET BACKGROUND_DDL = true`. Monitor with `SELECT * FROM rw_catalog.rw_ddl_progress`.\n6. **`snapshot = false` on sinks** — Adding a sink to an existing MV without this flag replays all historical data into the sink.\n7. **Verify docs** — RisingWave evolves rapidly. When unsure, check [docs.risingwave.com](https://docs.risingwave.com) or query `SHOW CREATE` on existing objects.\n\n## Connection\n\n```bash\n# Default local connection\npsql -h localhost -p 4566 -d dev -U root\n\n# Docker (single-node)\ndocker run -it --pull=always -p 4566:4566 -p 5691:5691 \\\n  risingwavelabs/risingwave:latest single_node\n```\n\n| Parameter | Default |\n|-----------|---------|\n| Host | `localhost` |\n| Port | `4566` |\n| Database | `dev` |\n| User | `root` |\n| Password | (none) |\n\nConnection string: `postgresql://root:@localhost:4566/dev`\n\nAny PostgreSQL-compatible client works: `psql`, JDBC, `psycopg2`, `pgx`, SQLAlchemy, dbt, Grafana.\n\n## MCP Server Setup\n\nRisingWave has an official MCP server with 100+ tools (query execution, schema exploration, streaming job monitoring, CDC progress, Kafka lag, Hummock storage analysis).\n\n```bash\ngit clone https://github.com/risingwavelabs/risingwave-mcp.git\ncd risingwave-mcp && pip install -r requirements.txt\n```\n\nConfigure via environment variable:\n```\nRISINGWAVE_CONNECTION_STR=postgresql://root:@localhost:4566/dev\n```\n\nAdd to your agent's MCP config (Claude Code: `~/.claude/claude_desktop_config.json`, VS Code: `.vscode/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"risingwave\": {\n      \"type\": \"stdio\",\n      \"command\": \"python\",\n      \"args\": [\"/path/to/risingwave-mcp/src/main.py\"],\n      \"env\": {\n        \"RISINGWAVE_CONNECTION_STR\": \"postgresql://root:@localhost:4566/dev\"\n      }\n    }\n  }\n}\n```\n\n## The Pipeline Pattern\n\n```\nStream data → SOURCE → MATERIALIZED VIEW(s) → SINK(s)\nStatic/CDC data → TABLE ─────────────────────────────╯\n```\n\n### Step 1: Source (streaming, no persistence)\n\n```sql\nCREATE SOURCE user_events (\n    user_id     INT,\n    action      VARCHAR,\n    event_time  TIMESTAMP,\n    WATERMARK FOR event_time AS event_time - INTERVAL '5 SECOND'\n)\nWITH (\n    connector = 'kafka',\n    topic = 'user-events',\n    properties.bootstrap.server = 'kafka:9092',\n    scan.startup.mode = 'latest'\n)\nFORMAT PLAIN ENCODE JSON;\n```\n\n### Step 2: Materialized View (continuous compute)\n\n```sql\n-- Windowed aggregation with final results on window close\nCREATE MATERIALIZED VIEW active_users_per_minute AS\nSELECT\n    action,\n    COUNT(DISTINCT user_id) AS unique_users,\n    window_start,\n    window_end\nFROM TUMBLE(user_events, event_time, INTERVAL '1 MINUTE')\nGROUP BY action, window_start, window_end\nEMIT ON WINDOW CLOSE;\n\n-- Plain aggregation (emit on every update)\nCREATE MATERIALIZED VIEW user_action_counts AS\nSELECT user_id, action, COUNT(*) AS cnt\nFROM user_events\nGROUP BY user_id, action;\n```\n\n### Step 3: Sink (output)\n\n```sql\nCREATE SINK alerts_to_kafka FROM active_users_per_minute\nWITH (\n    connector = 'kafka',\n    topic = 'user-alerts',\n    properties.bootstrap.server = 'kafka:9092',\n    snapshot = false   -- skip historical backfill\n)\nFORMAT PLAIN ENCODE JSON;\n```\n\n## CDC Pattern (Database Replication)\n\nCDC requires a **two-step setup**: shared connection source + per-table TABLE.\n\n```sql\n-- Step 1: shared CDC source connection\nCREATE SOURCE pg_cdc WITH (\n    connector = 'postgres-cdc',\n    hostname = 'postgres-host',\n    port = '5432',\n    username = 'replicator',\n    password = '<your-password>',\n    database.name = 'mydb',\n    slot.name = 'rw_slot'\n);\n\n-- Step 2: per-table ingestion (TABLE, not SOURCE)\nCREATE TABLE orders (\n    id          INT PRIMARY KEY,\n    customer_id INT,\n    total       DECIMAL,\n    created_at  TIMESTAMP\n)\nFROM pg_cdc TABLE 'public.orders';\n```\n\n## Time Windows\n\nAll three window types add `window_start` and `window_end` columns.\n\n```sql\n-- TUMBLE: non-overlapping fixed windows\nFROM TUMBLE(table, time_col, INTERVAL '5 MINUTES')\n\n-- HOP (sliding): overlapping windows\n-- hop_size = slide interval, window_size = total duration\nFROM HOP(table, time_col, INTERVAL '1 MINUTE', INTERVAL '5 MINUTES')\n\n```\n\n> **Note:** SESSION windows are only supported in batch mode in RisingWave 2.x. For streaming, use TUMBLE or HOP.\n\n**Pattern:** Always group by `window_start, window_end` and add `EMIT ON WINDOW CLOSE` when using watermarks.\n\n## Useful System Catalog Queries\n\n```sql\n-- All materialized views with definitions\nSELECT name, definition FROM rw_catalog.rw_materialized_views;\n\n-- DDL progress during MV creation / backfill\nSELECT ddl_id, ddl_statement, progress FROM rw_catalog.rw_ddl_progress;\n\n-- Active sources and their connectors\nSELECT name, connector FROM rw_catalog.rw_sources;\n\n-- Sink info\nSELECT name, sink_type, connector FROM rw_catalog.rw_sinks;\n\n-- CDC backfill progress\nSELECT job_id, split_total_count, split_backfilled_count, split_completed_count\nFROM rw_catalog.rw_cdc_progress;\n\n-- Cluster nodes\nSELECT id, host, type, state FROM rw_catalog.rw_worker_nodes;\n\n-- Inspect object definition\nSHOW CREATE MATERIALIZED VIEW my_mv;\nSHOW CREATE SOURCE my_source;\nSHOW CREATE SINK my_sink;\n```\n\n## Useful Session Settings\n\n```sql\n-- Large backfills: non-blocking DDL\nSET BACKGROUND_DDL = true;\n\n-- Share Kafka source across multiple MVs (v2.1+)\nSET streaming_use_shared_source = true;\n```\n\n## Troubleshooting\n\n**MCP server not connecting**\n- Verify `RISINGWAVE_CONNECTION_STR` is set and RisingWave is running on port 4566\n- Test the connection first: `psql -h localhost -p 4566 -d dev -U root`\n- Check Python version: `python --version` (requires Python 3.8+)\n\n**`EMIT ON WINDOW CLOSE` produces no output**\n- The source or table must have `WATERMARK FOR col AS col - INTERVAL '...'` defined\n- Confirm watermark is advancing: insert rows with recent timestamps, not historical data\n- Check MV definition: `SHOW CREATE MATERIALIZED VIEW my_mv`\n\n**MV creation hangs / session times out**\n- Use `SET BACKGROUND_DDL = true` before `CREATE MATERIALIZED VIEW`\n- Monitor progress: `SELECT ddl_id, ddl_statement, progress FROM rw_catalog.rw_ddl_progress`\n\n**CDC table not receiving updates**\n- Verify PostgreSQL has `wal_level = logical` and the replication user has `REPLICATION` role\n- Check CDC lag: `SELECT * FROM rw_catalog.rw_cdc_progress`\n- Ensure `slot.name` in `CREATE SOURCE` is unique and does not already exist on the upstream DB\n\n**Sink sending duplicate historical data**\n- Add `snapshot = false` to the sink `WITH` clause to skip backfilling existing MV data\n\n## References\n\n- [Connectors reference](references/connectors.md) — all supported sources and sinks\n- [System catalog reference](references/catalog.md) — full `rw_catalog` table listing\n- [RisingWave docs](https://docs.risingwave.com)\n- [RisingWave MCP server](https://github.com/risingwavelabs/risingwave-mcp)","tags":["risingwave","agent","skills","risingwavelabs","agent-skills"],"capabilities":["skill","source-risingwavelabs","skill-risingwave","topic-agent-skills"],"categories":["agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/risingwavelabs/agent-skills/risingwave","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add risingwavelabs/agent-skills","source_repo":"https://github.com/risingwavelabs/agent-skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (7,880 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:14:16.204Z","embedding":null,"createdAt":"2026-05-18T13:21:49.563Z","updatedAt":"2026-05-18T19:14:16.204Z","lastSeenAt":"2026-05-18T19:14:16.204Z","tsv":"'/.claude/claude_desktop_config.json':374 '/path/to/risingwave-mcp/src/main.py':386 '/risingwavelabs/risingwave-mcp)':1059 '/risingwavelabs/risingwave-mcp.git':346 '1':66,409,496,591,694 '100':325 '2':82,454,620,710 '2.8':139 '3':110,538 '3.8':903 '4':158 '4566':28,68,74,261,276,277,290,882,891 '4566/dev':301,364,393 '5':186,435,674,697 '5432':70,610 '5691':81,279,280 '6':212 '7':234 '9092':446,561 'across':855 'action':422,477,500,519,525,536 'activ':471,548,768 'ad':217 'add':365,654,727,1019 'advanc':927 'agent':368 'aggreg':461,510 'alert':544,558 'alreadi':1008 'alway':274,719 'analysi':340 'append':144,152 'arg':385 'backfil':188,566,757,790,799,843,1029 'background':190,202,849,953 'bash':253,341 'batch':706 'block':199,846 'canal':102 'catalog':737,1043,1048 'cd':347 'cdc':14,99,334,571,575,593,599,604,645,789,806,972,991,996 'check':242,896,936,990 'checkpoint':175 'claud':372 'claus':1026 'client':306 'clone':343 'close':26,114,125,162,180,467,508,731,907 'cluster':808 'cnt':528 'code':373,376 'col':118,120,672,692,919,921 'column':660 'command':383 'compat':305 'complet':802 'comput':61,458 'config':371 'configur':355 'confirm':924 'connect':77,87,252,256,297,360,389,583,595,869,872,885 'connector':438,553,601,772,775,785,1034 'continu':60,457 'core':53,64 'count':478,520,526,797,800,803 'creat':85,95,106,147,192,248,415,468,515,542,596,628,640,823,829,834,940,957,1001 'creation':756,946 'custom':635 'd':262,892 'dashboard':78 'data':94,230,398,406,935,1018,1032 'databas':9,46,291,573 'database.name':614 'db':1013 'dbt':313 'ddl':191,203,210,752,759,761,766,847,850,954,963,965,970 'debezium':100 'decim':639 'default':164,165,254,286 'defin':923 'definit':136,744,747,821,938 'design':35 'dev':263,292,893 'distinct':479 'doc':236,1052 'docker':266,270 'docs.risingwave.com':243,244,1053 'doesn':91 'duplic':1016 'durat':687 'emit':23,122,159,167,177,505,511,728,904 'emit-on-upd':166 'encod':451,569 'end':488,504,659,725 'ensur':998 'env':387 'environ':357 'event':32,418,424,429,432,443,492,493,531 'everi':513 'evolv':238 'execut':328 'exist':222,250,1009,1030 'explor':330 'fals':214,563,1021 'final':182,463 'first':886 'fix':666 'flag':226 'format':449,567 'full':1046 'git':342 'github.com':345,1058 'github.com/risingwavelabs/risingwave-mcp)':1057 'github.com/risingwavelabs/risingwave-mcp.git':344 'grafana':314 'group':498,532,720 'h':258,888 'hang':947 'histor':229,565,934,1017 'hop':676,680,689,717 'host':287,608,812 'hostnam':605 'hummock':338 'id':420,481,524,535,631,636,760,794,811,964 'immut':183 'implement':47 'info':780 'ingest':18,57,624 'insert':928 'inspect':819 'instal':352 'int':421,632,637 'interv':121,434,495,673,683,693,696,922 'jdbc':309 'job':332,793 'json':378,452,570 'kafka':17,336,439,445,546,554,560,853 'key':634 'lag':337,992 'larg':187,197,842 'latest':282,448 'level':981 'list':1050 'listen':72 'local':255 'localhost':259,288,300,363,392,889 'logic':982 'materi':10,58,400,455,469,516,741,750,824,941,958 'maxwel':101 'mcp':31,315,322,350,370,866,1055 'mcpserver':379 'minut':474,497,551,675,695,698 'mode':707 'monitor':205,333,960 'multipl':856 'must':104,915 'mv':194,223,755,827,937,944,945,1031 'mvs':857 'mydb':615 'name':746,774,782 'need':156,189 'node':269,284,809,818 'non':151,664,845 'non-append-on':150 'non-block':844 'non-overlap':663 'none':296 'note':699 'object':251,820 'offici':321 'order':630 'output':63,540,910 'overlap':665,678 'p':260,275,278,890 'paramet':285 'partial':171 'password':295,613 'pattern':396,572,718 'per':473,550,586,622 'per-tabl':585,621 'persist':93,97,413 'pg':598,644 'pgx':311 'pip':351 'pipelin':34,54,395 'plain':450,509,568 'port':27,67,289,609,881 'postgr':603,607 'postgres-cdc':602 'postgres-host':606 'postgresql':49,304,978 'postgresql-compat':303 'postgresql/mysql':16 'primari':633 'principl':65 'produc':908 'progress':211,335,753,763,767,791,807,961,967,971,997 'properties.bootstrap.server':444,559 'protocol':51 'psql':257,308,887 'psycopg2':310 'public.orders':647 'pull':273 'python':384,897,899,902 'queri':246,327,738 'r':353 'rapid':239 'real':37 'real-tim':36 'receiv':975 'recent':931 'refer':1033,1035,1044 'references/catalog.md':1045 'references/connectors.md':1036 'replay':227 'replic':574,612,985,988 'requir':143,576,901 'requirements.txt':354 'result':172,185,464 'risingwav':1,6,30,40,41,71,138,237,318,349,359,380,388,709,871,877,1051,1054 'risingwave-mcp':29,348 'risingwavelabs/risingwave':281 'role':989 'root':265,294,299,362,391,895 'row':929 'run':271,879 'rw':617,1047 'rw_catalog.rw':209,749,765,777,787,805,816,969,995 'scan.startup.mode':447 'schema':329 'second':436 'select':207,476,522,745,758,773,781,792,810,962,993 'send':170,1015 'server':316,323,867,1056 'session':700,839,948 'set':201,840,848,859,875,952 'setup':317,581 'share':582,592,852,862 'show':247,822,828,833,939 'singl':268,283 'single-nod':267 'sink':13,62,216,219,233,403,539,543,779,783,788,835,837,1014,1024,1041 'size':681,685 'skill' 'skill-risingwave' 'skip':564,1028 'slide':677,682 'slot':618 'slot.name':616,999 'snapshot':213,562,1020 'sourc':12,56,83,86,109,133,148,399,410,416,584,594,597,627,769,778,830,832,854,863,912,1002,1039 'source-risingwavelabs' 'split':795,798,801 'sql':8,45,76,414,459,541,589,661,739,841 'sqlalchemi':312 'start':486,502,656,723 'state':814 'statement':762,966 'static/cdc':405 'stdio':382 'step':408,453,537,580,590,619 'storag':339 'str':361,390,873 'stream':7,33,44,89,154,331,397,411,713,860 'string':298 'support':704,1038 'system':736,1042 'tabl':84,96,107,135,142,198,407,587,588,623,625,629,646,670,690,914,973,1049 'test':883 'three':651 'time':19,38,425,430,433,494,648,671,691,949 'timestamp':426,642,932 'tool':326 'topic':440,555 'topic-agent-skills' 'total':638,686,796 'troubleshoot':865 'true':204,851,864,955 'tumbl':490,662,669,715 'tumble/hop/session':21 'two':579 'two-step':578 'type':381,653,784,813 'u':264,894 'uniqu':483,1004 'unlock':112 'unsur':241 'updat':169,514,976 'upstream':1012 'use':2,105,129,146,176,714,733,735,838,861,951 'user':293,417,419,442,472,480,484,491,518,523,530,534,549,557,986 'user-alert':556 'user-ev':441 'usernam':611 'v2.1':858 'varchar':423 'variabl':358 'verifi':235,870,977 'version':898,900 'via':356 'view':11,59,401,456,470,517,742,751,825,942,959 'vs':163,375 'vscode/mcp.json':377 'wal':980 'watermark':22,111,116,140,157,427,734,917,925 'window':20,25,113,124,161,179,184,460,466,485,487,501,503,507,649,652,655,658,667,679,684,701,722,724,730,906 'wire':50 'without':115,200,224 'won':126 'work':4,128,307 'worker':817 'x':711","prices":[{"id":"ec7f40dc-12b4-4dca-ad91-45732df71f7a","listingId":"208aff91-8206-4c5b-8811-7baf441c120d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"risingwavelabs","category":"agent-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:49.563Z"}],"sources":[{"listingId":"208aff91-8206-4c5b-8811-7baf441c120d","source":"github","sourceId":"risingwavelabs/agent-skills/risingwave","sourceUrl":"https://github.com/risingwavelabs/agent-skills/tree/main/skills/risingwave","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:49.563Z","lastSeenAt":"2026-05-18T19:14:16.204Z"}],"details":{"listingId":"208aff91-8206-4c5b-8811-7baf441c120d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"risingwavelabs","slug":"risingwave","github":{"repo":"risingwavelabs/agent-skills","stars":7,"topics":["agent-skills"],"license":"other","html_url":"https://github.com/risingwavelabs/agent-skills","pushed_at":"2026-04-13T04:28:40Z","description":"Agent Skills for RisingWave.","skill_md_sha":"3e18c32027a510b6722d528da78140030aaa79fa","skill_md_path":"skills/risingwave/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/risingwavelabs/agent-skills/tree/main/skills/risingwave"},"layout":"multi","source":"github","category":"agent-skills","frontmatter":{"name":"risingwave","license":"Apache-2.0","description":"Use when working with RisingWave — streaming SQL database, materialized views, sources, sinks, CDC from PostgreSQL/MySQL, Kafka ingestion, time windows (TUMBLE/HOP/SESSION), watermarks, EMIT ON WINDOW CLOSE, port 4566, risingwave-mcp, event streaming pipeline design, real-time analytics, stream processing"},"skills_sh_url":"https://skills.sh/risingwavelabs/agent-skills/risingwave"},"updatedAt":"2026-05-18T19:14:16.204Z"}}