### Start RisingWave Instance Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/get-started/quickstart.mdx Execute this command after script installation to launch a RisingWave instance. ```bash risingwave ``` -------------------------------- ### Install pgx Driver for Go Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/client-libraries/go.mdx Install the pgx driver for Go using the go get command. This is required to interact with RisingWave. ```shell go get github.com/jackc/pgx/v4 ``` -------------------------------- ### Start demo cluster with Docker Compose Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/demos/live-stream-metrics-analysis.mdx Navigate to the livestream integration test directory and start the demo cluster using Docker Compose. This command requires Docker and Docker Compose to be installed and running. ```bash cd risingwave/integration_tests/livestream docker compose up -d ``` -------------------------------- ### Show Tables Example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-tables.mdx Example of using SHOW TABLES to list tables in the 'public' schema that start with 't_'. The output format changed in v2.7.0 to include the schema name as a prefix. ```sql SHOW TABLES FROM public LIKE 't_'; ``` ```text Name --------------------- public.t1 public.t2 (2 rows) ``` -------------------------------- ### Example of Creating and Showing a View Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-create-view.mdx This example demonstrates creating a view named 'v1' and then using `SHOW CREATE VIEW` to inspect its definition. ```sql CREATE VIEW v1 AS SELECT id FROM taxi_trips; SHOW CREATE VIEW v1; ``` ```sql Name | Create Sql -----------+--------------------------------------------- public.v1 | CREATE VIEW v1 AS SELECT id FROM taxi_trips (1 row) ``` -------------------------------- ### Install Monitoring Stack Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/monitor-risingwave-cluster.mdx Run the installation script to deploy the Prometheus and Grafana monitoring services within the 'monitoring' namespace. This script automates the setup of the monitoring environment. ```bash ./monitoring/install.sh ``` -------------------------------- ### Run Dev Server with Global Install Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/README.md Alternatively, install the Mintlify CLI globally and then run the dev command. ```bash npm i -g mint mint dev ``` -------------------------------- ### Start Demo Cluster with Docker Compose Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/demos/fast-twitter-events-processing.mdx Navigate to the Twitter integration test directory and start the demo cluster using Docker Compose. This command requires Docker and Docker Compose to be installed and running. ```bash cd risingwave/integration_tests/twitter docker compose up -d ``` -------------------------------- ### General Node Configuration Example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/deploy/node-specific-configurations.mdx Example TOML configuration for system and storage settings, including state store and backup details. ```toml [system] barrier_interval_ms = 1000 checkpoint_frequency = 1 state_store = "hummock+minio://hummockadmin:hummockadmin@127.0.0.1:9301/hummock001" data_directory = "hummock_001" backup_storage_url = "minio://hummockadmin:hummockadmin@127.0.0.1:9301/hummock001" backup_storage_directory = "hummock_001/backup" [storage.cache_refill] data_refill_levels = [] timeout_ms = 6000 concurrency = 10 unit = 64 threshold = 0.5 recent_filter_layers = 6 recent_filter_rotate_interval_ms = 10000 ``` -------------------------------- ### Start Grafana Instance Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/rw-standalone-mode.mdx Starts the Grafana visualization server using a specific configuration file. Ensure you are in the RisingWave directory. ```bash grafana server --config ./standalone/grafana.ini ``` -------------------------------- ### Create source for schema refresh example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/ingestion/modify-source-or-table-schemas.mdx Example source creation used to demonstrate the REFRESH SCHEMA command. ```sql CREATE SOURCE src_user WITH ( connector = 'kafka', topic = 'sr_pb_test', properties.bootstrap.server = 'message_queue:29092', scan.startup.mode = 'earliest' ) FORMAT PLAIN ENCODE PROTOBUF( schema.registry = 'http://message_queue:8081', message = 'test.User' ); ``` -------------------------------- ### Install RisingWave using Homebrew Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/get-started/quickstart.mdx Commands to tap the RisingWave repository and install the RisingWave package using Homebrew. ```bash brew tap risingwavelabs/risingwave brew install risingwave ``` -------------------------------- ### CREATE SINK INTO Examples Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-create-sink-into.mdx Examples demonstrating how to use the `CREATE SINK INTO` command, including unioning data from multiple sources and dropping sinks. ```APIDOC ## Examples You can union data from two different Kafka topics. ```sql CREATE TABLE orders ( id int primary key, price int, item_id int, customer_id int ); CREATE source orders_s0 ( id int primary key, price int, item_id int, customer_id int ) WITH ( connector = 'kafka', topic = 'topic_0', ... ) FORMAT PLAIN ENCODE JSON; CREATE source orders_s1 ( id int primary key, price int, item_id int, customer_id int ) WITH ( connector = 'kafka', topic = 'topic_1', ... ) FORMAT PLAIN ENCODE JSON; CREATE SINK orders_sink0 INTO orders FROM orders_s0; CREATE SINK orders_sink1 INTO orders FROM orders_s1; ``` If you don't want one of the topics, you can drop it. ```sql DROP SINK orders_sink0; ``` ``` -------------------------------- ### Example Output of SHOW FUNCTIONS Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-functions.mdx Displays the typical output format for the `SHOW FUNCTIONS` command, including schema, name, arguments, return type, language, and link. Note that the 'Name' column includes the schema prefix starting from v2.7.0. ```sql Name | Arguments | Return Type | Language | Link -------------------------+---------------------------+---------------------------------------------------------------------------+----------+------------------------- public.jsonb_concat | jsonb[] | jsonb | python | http://localhost:8815 public.array_access | varchar[], integer | varchar | python | http://localhost:8815 public.hex_to_dec | varchar | numeric | python | http://localhost:8815 public.gcd | integer, integer, integer | integer | python | http://localhost:8815 public.gcd | integer, integer | integer | python | http://localhost:8815 public.extract_tcp_info | bytea | struct | python | http://localhost:8815 public.int_42 | | integer | python | http://localhost:8815 public.series2 | integer | struct | python | http://localhost:8815 public.series | integer | integer | python | http://localhost:8815 public.jsonb_access | jsonb, integer | jsonb | python | http://localhost:8815 (10 rows) ``` -------------------------------- ### Configure SQLMesh Connection in config.yaml Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/sqlmesh.mdx Example configuration for the 'config.yaml' file to set up the connection to a RisingWave gateway. Ensure the connection details like host, user, port, and database match your RisingWave setup. ```yaml gateways: risingwave: # Gateway name used by default connection: type: risingwave host: localhost user: root port: 4566 # Match the Docker port mapping database: dev default_gateway: risingwave model_defaults: dialect: risingwave # start: # Optional: Default start date for backfills if needed ``` -------------------------------- ### Start Prometheus Instance Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/rw-standalone-mode.mdx Starts the Prometheus monitoring server with a specified configuration file and listen address. Ensure you are in the RisingWave directory and have cloned the repository. ```bash prometheus --config.file=./standalone/prometheus.yml --web.listen-address=0.0.0.0:9500 ``` -------------------------------- ### Example: Terminating Processes Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-processlist.mdx This example demonstrates how to first display all running processes, then terminate specific processes by their IDs, and finally verify the termination by displaying the process list again. ```sql SHOW PROCESSLIST; ------RESULT Worker Id | Id | User | Host | Database | Time | Info -----------+-----+------+-----------------+----------+--------+----------------------- 2 | 2:0 | root | 127.0.0.1:50447 | dev | 4114ms | SELECT pg_sleep(3600) 3 | 3:1 | root | 127.0.0.1:50457 | dev | 6ms | SHOW PROCESSLIST 3 | 3:0 | root | 127.0.0.1:50453 | dev | 2844ms | SELECT pg_sleep(3600) (3 rows) KILL '2:0'; ------RESULT KILL KILL '3:0'; ------RESULT KILL SHOW PROCESSLIST; ------RESULT Worker Id | Id | User | Host | Database | Time | Info -----------+-----+------+-----------------+----------+------+------------------ 2 | 2:0 | root | 127.0.0.1:50447 | dev | | 3 | 3:1 | root | 127.0.0.1:50457 | dev | 2ms | SHOW PROCESSLIST 3 | 3:0 | root | 127.0.0.1:50453 | dev | | (3 rows) ``` -------------------------------- ### Install RisingWave using Script Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/get-started/quickstart.mdx Run this command in your terminal to download and execute the RisingWave installation script. ```bash curl -L https://risingwave.com/sh | sh ``` -------------------------------- ### Start Demo Cluster with Docker Compose Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/demos/server-performance-anomaly-detection.mdx Navigate to the cdn-metrics integration test directory and start the demo cluster using Docker Compose. This will launch RisingWave components and a workload generator. ```bash cd risingwave/integration_tests/cdn-metrics docker compose up -d ``` -------------------------------- ### Install RisingWave Cloud CLI Binary Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/cloud/install-cli.mdx Download and install the latest `rwc` binary. Ensure it is moved to a directory in your system's PATH for global access. ```bash curl -L https://cli.risingwave.cloud/download.sh | bash && sudo mv rwc /usr/local/bin ``` -------------------------------- ### Install postgresql-client on Debian/Ubuntu Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/deploy/install-psql-without-postgresql.mdx Install the PostgreSQL client packages, including psql, using the apt package manager on Debian or Ubuntu. ```bash sudo apt install postgresql-client ``` -------------------------------- ### Example GCS Sink Creation Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/destinations/google-cloud-storage.mdx This example demonstrates how to create a sink to GCS, specifying the path, bucket name, credential, service account, and format. ```sql CREATE SINK gcs_sink AS SELECT v1 FROM t1 WITH ( connector='gcs', gcs.path = '', gcs.bucket_name = '', gcs.credential = '', gcs.service_account = '' type = 'append-only', )FORMAT PLAIN ENCODE PARQUET(force_append_only=true); ``` -------------------------------- ### Install RisingWave with Bundled Components Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/iceberg/catalogs/lakekeeper.mdx Install RisingWave using Helm, enabling bundled components by setting 'tags.bundle=true'. This command deploys RisingWave into the 'risingwave' namespace. ```bash helm install -n risingwave --set tags.bundle=true risingwavelabs/risingwave ``` -------------------------------- ### Example Subscription Output Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/serve/subscription.mdx This is an example of the data rows that might be fetched from a subscription. The columns represent the data from the source table, including a timestamp. ```sql Row fetched: (1, 'Alice', 30, 1, 1716434906890) Row fetched: (2, 'Bob', 25, 1, 1716434909889) Row fetched: (3, 'Charlie', 35, 1, 1716434912889) Row fetched: (4, 'Diana', 28, 1, 1716434920889) ``` -------------------------------- ### Example S3 Sink Configuration Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/destinations/aws-s3.mdx Example of creating an S3 sink with common parameters. Adjust values for your specific S3 bucket and credentials. ```sql CREATE SINK s3_sink AS SELECT v1 FROM t WITH ( connector='s3', s3.path = '', s3.region_name = '', s3.bucket_name = '', s3.credentials.access = '', s3.credentials.secret = '', s3.endpoint_url = '', type = 'append-only', )FORMAT PLAIN ENCODE PARQUET(force_append_only=true); ``` -------------------------------- ### Create table and view for demonstration Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-views.mdx These SQL statements create a sample table and a view, which are then used in the `SHOW VIEWS` example. Ensure the table is created before the view. ```sql CREATE TABLE IF NOT EXISTS t3 ( v1 int, v2 int, v3 int) WITH (appendonly = 'true'); CREATE VIEW v3 AS SELECT sum(v2) AS sum_v2 FROM t3; ``` -------------------------------- ### Create and Show Table Definition Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-create-table.mdx This example demonstrates creating a table and then using SHOW CREATE TABLE to view its definition. Note that `IF NOT EXISTS` is omitted in the output, but `WITH` options are preserved. ```sql CREATE TABLE IF NOT EXISTS taxi_trips( id VARCHAR, distance DOUBLE PRECISION, city VARCHAR ) WITH (appendonly = 'true'); SHOW CREATE TABLE taxi_trips; ``` ```sql Name | Create Sql -----------+--------------------------------------------- public.taxi_trips | CREATE TABLE taxi_trips (id CHARACTER VARYING, distance DOUBLE, city CHARACTER VARYING) WITH (appendonly = 'true') (1 row) ``` -------------------------------- ### Create Table and Add Comments Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-describe.mdx This snippet demonstrates setting up a table with columns, a primary key, an index, and associated comments for columns and the table itself. This setup is a prerequisite for using the DESCRIBE command effectively. ```sql CREATE TABLE customers ( customer_id BIGINT PRIMARY KEY, name VARCHAR, email VARCHAR ); COMMENT ON COLUMN customers.customer_id IS 'Unique identifier for each customer'; COMMENT ON COLUMN customers.name IS 'Name of the customer'; COMMENT ON COLUMN customers.email IS 'Email address of the customer'; COMMENT ON TABLE customers IS 'All customer records'; CREATE INDEX idx_customers_email ON customers(email); ``` -------------------------------- ### Example: Using VACUUM and VACUUM FULL Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-vacuum.mdx This example demonstrates inserting and updating data in an Iceberg table, followed by running `VACUUM` to expire snapshots and `VACUUM FULL` to compact the table and expire snapshots. Ensure data is flushed between operations for accurate results. ```sql -- Insert and update data insert into t_vacuum_test values(1, 'alice', 100), (2, 'bob', 200), (3, 'charlie', 300); FLUSH; -- sleep 5s -- Check data select * from t_vacuum_test; -- More inserts/updates insert into t_vacuum_test values(4, 'david', 400), (5, 'eve', 500); FLUSH; -- sleep 5s update t_vacuum_test set v1 = 150 where id = 1; FLUSH; -- sleep 5s -- Run VACUUM and verify VACUUM t_vacuum_test; VACUUM FULL t_vacuum_test; ``` -------------------------------- ### Start Demo Cluster with Docker Compose Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/demos/use-risingwave-to-monitor-risingwave-metrics.mdx Navigate to the Prometheus integration directory and start the demo cluster using Docker Compose. This command requires Docker and Docker Compose to be installed and running. ```bash cd risingwave/integration_tests/prometheus docker compose up -d ``` -------------------------------- ### Apply Starter Manifests Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/web-ui/risingwave-console/installation-setup.mdx Commands to deploy the RisingWave Console using either the pgbundle or external-pg configuration. ```shell kubectl apply -f deploy/kubernetes/pgbundle/console.yaml ``` ```shell kubectl apply -f deploy/kubernetes/external-pg/console.yaml ``` -------------------------------- ### Example output of runtime parameters Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/view-configure-runtime-parameters.mdx Displays a sample table structure returned by the SHOW ALL command. ```bsh Name | Setting | Description --------------------------------+-----------------+-------------------------------------- implicit_flush | false | If set to `true`, every INSERT/UPDATE/DELETE statement will block until the entire dataflow is refreshed. create_compaction_group_for_mv | false | If set to `true`, RisingWave will create dedicated compaction groups when creating these materialized views. query_mode | auto | A temporary config variable to force query running in either local or distributed mode. If the value is auto, the system will decide for you automatically. ... ``` -------------------------------- ### Get cluster recovery status Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/functions/sys-admin.mdx Call `rw_recovery_status()` to retrieve the current recovery status of the cluster, which can be 'STARTING', 'RECOVERING', or 'RUNNING'. ```sql SELECT rw_recovery_status(); ``` -------------------------------- ### Example of Hop Time Window Usage Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/processing/sql/time-windows.mdx This example applies a hop time window of 1 minute hop size and 2 minutes window size to the 'taxi_trips' table, using the 'completed_at' column. The result includes window start and end times. ```sql SELECT trip_id, taxi_id, completed_at, window_start, window_end FROM HOP (taxi_trips, completed_at, INTERVAL '1 MINUTE', INTERVAL '2 MINUTES'); ``` -------------------------------- ### Create and Show Materialized View Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-create-mv.mdx This example demonstrates creating a materialized view and then using `SHOW CREATE MATERIALIZED VIEW` to inspect its definition. The output shows the SQL statement used for creation. ```sql CREATE MATERIALIZED VIEW v1 AS SELECT id FROM taxi_trips; SHOW CREATE MATERIALIZED VIEW v1; ``` ```sql Name | Create Sql -----------+--------------------------------------------- public.v1 | CREATE MATERIALIZED VIEW v1 AS SELECT id FROM taxi_trips (1 row) ``` -------------------------------- ### Generate range of numeric values with a step Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/functions/set-returning.mdx Generate a series of numeric values with a custom step. This example generates values starting from 0.1 up to (but not including) 2.1, with increments of 0.5. ```sql SELECT * FROM range(0.1, 2.1, 0.5); ``` -------------------------------- ### Initialize working directory Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/web-ui/risingwave-console/single-sign-on.mdx Create and enter a new directory for the deployment files. ```shell mkdir risingwave-console-sso && cd risingwave-console-sso ``` -------------------------------- ### Set up SQLMesh Project Directory and Virtual Environment Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/sqlmesh.mdx Commands to create a project directory, navigate into it, and set up a Python virtual environment. Adjust the activation command based on your operating system and shell. ```bash mkdir sqlmesh-risingwave-demo cd sqlmesh-risingwave-demo python3 -m venv venv source venv/bin/activate # Adjust activation for your OS/shell ``` -------------------------------- ### Session Window Aggregation with `SESSION WITH GAP` Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/processing/sql/time-windows.mdx Use `SESSION WITH GAP` to define session windows based on a time interval. This example partitions by user and orders by view time, assigning window start and end times. ```sql SELECT user_id, product_id, viewed_at, first_value(viewed_at) OVER ( PARTITION BY user_id ORDER BY viewed_at SESSION WITH GAP INTERVAL '5 MINUTES' ) AS window_start, last_value(viewed_at) OVER ( PARTITION BY user_id ORDER BY viewed_at SESSION WITH GAP INTERVAL '5 MINUTES' ) AS window_end FROM user_views ``` -------------------------------- ### Create Source with Upsert JSON Encoding Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/ingestion/formats-and-encoding-options.mdx Example of creating a Kafka source with `FORMAT UPSERT` and `ENCODE JSON`. This setup handles key-value pairs for updates and deletes, requiring a primary key definition and `INCLUDE KEY`. ```sql CREATE SOURCE upsert_source ( PRIMARY KEY (rw_key), id INT, name VARCHAR ) INCLUDE KEY AS rw_key WITH ( connector='kafka', topic='user_updates', properties.bootstrap.server='localhost:9092' ) FORMAT UPSERT ENCODE JSON; ``` -------------------------------- ### Create Tables for Indexing Example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/processing/indexes.mdx Define 'customers' and 'orders' tables with primary keys to demonstrate index creation. ```sql CREATE TABLE customers ( c_custkey INTEGER, c_name VARCHAR, c_address VARCHAR, c_nationkey INTEGER, c_phone VARCHAR, c_acctbal NUMERIC, c_mktsegment VARCHAR, c_comment VARCHAR, PRIMARY KEY (c_custkey) ); CREATE TABLE orders ( o_orderkey BIGINT, o_custkey INTEGER, o_orderstatus VARCHAR, o_totalprice NUMERIC, o_orderdate DATE, o_orderpriority VARCHAR, o_clerk VARCHAR, o_shippriority INTEGER, o_comment VARCHAR, PRIMARY KEY (o_orderkey) ); ``` -------------------------------- ### Install dbt-risingwave Plugin Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/dbt.mdx Install the dbt-risingwave plugin using pip. Ensure Python3 is installed as a prerequisite. ```bash python3 -m pip install dbt-risingwave ``` -------------------------------- ### Verify CLI Installation Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/cloud/install-cli.mdx Check the installed `rwc` version and display the help message to confirm the installation was successful. ```bash rwc version rwc -h ``` -------------------------------- ### Install sqlalchemy-risingwave driver Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/visualization/superset.mdx Install the RisingWave SQLAlchemy driver within your Docker container if it's not already present. Restart the container after installation. ```shell docker compose exec bash pip install sqlalchemy-risingwave exit docker compose restart ``` -------------------------------- ### Install arrow-udf framework Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/udfs/use-udfs-in-python.mdx Install the arrow-udf Python SDK to define and run UDFs outside of the RisingWave process. Ensure Python 3.8 or later is installed. ```bash pip install arrow-udf ``` -------------------------------- ### Verify CLI Setup Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/cloud/install-cli.mdx Confirm that the CLI is correctly authenticated and configured by listing the current context and clusters. ```bash rwc context list # shows account URL, region, and auth method rwc cluster list # returns your clusters (or an empty list) ``` -------------------------------- ### Start RisingWave Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/docs/superpowers/plans/2026-04-11-docs-restructure.md Downloads and starts a RisingWave instance using a curl script. ```bash curl -L https://risingwave.com/sh | sh && risingwave ``` -------------------------------- ### CREATE SOURCE Example (Kafka) Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/ingestion/create-source-vs-create-table.mdx Establishes a direct, non-persistent connection to a Kafka topic. Data is accessible but not stored within RisingWave. ```sql CREATE SOURCE my_kafka_source ( user_id INT, product_id VARCHAR, timestamp TIMESTAMP ) WITH ( connector='kafka', topic='user_activity', properties.bootstrap.server='broker1:9092' ) FORMAT PLAIN ENCODE JSON; ``` -------------------------------- ### GRANT Example: All Source Privileges Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-grant.mdx Example of granting all privileges for all sources in a schema. ```APIDOC ## GRANT Example: All Source Privileges ### Description This example demonstrates how to grant all privileges for all sources within a specific schema to a user. ### Method SQL ### Endpoint N/A (SQL Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```sql GRANT ALL PRIVILEGES ON ALL SOURCES IN SCHEMA schema1 TO user1 GRANTED BY user; ``` ### Response #### Success Response (200) Privileges granted successfully. #### Response Example None ``` -------------------------------- ### Install WarpStream Agent Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/sources/warpstream.mdx Installs the WarpStream Agent or CLI for interacting with a WarpStream cluster. ```bash curl https://console.warpstream.com/install.sh | bash ``` -------------------------------- ### Register and Log in to CLI with Email and Password Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/cloud/install-cli.mdx Register a new account with email and password, activate it via a magic link, and then log in to the CLI. ```bash rwc auth register --account '' --password '' # Check your inbox and click the magic link to activate the account before logging in. rwc auth login --account '' --password '' ``` -------------------------------- ### Example: Reset Source Splits Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/risectl-source-commands.mdx An example of how to reset splits for a source with ID 123. ```bash risectl meta reset-source-splits --source-id 123 ``` -------------------------------- ### Create Protobuf Source with Kafka Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/ingestion/sources/kafka.mdx Example of creating a Kafka source with Protobuf format. Requires message name, schema registry location, and credentials. ```sql CREATE SOURCE IF NOT EXISTS source_abc WITH ( connector='kafka', topic='demo_topic', properties.bootstrap.server='172.10.1.1:9090,172.10.1.2:9090', scan.startup.mode='latest', scan.startup.timestamp.millis='140000000' ) FORMAT PLAIN ENCODE PROTOBUF ( message = 'package.message_name', access_key = 'your_access_key', secret_key = 'your secret_key', -- compiled from protoc location = 'https://demo_bucket_name.s3-us-west-2.amazonaws.com/schema_descriptor.pb' ); ``` -------------------------------- ### Get array dimensions Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/functions/array.mdx Use `array_dims` to get the dimensions of a one-dimensional array as a string. ```sql array_dims ( array ) → string ``` ```sql array_dims(array[2,3,4]) → [1:3] ``` -------------------------------- ### Start psql with Preloaded Parameters Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/iceberg/quickstart/internal-s3-tables.mdx Initiate an interactive psql session, passing necessary connection and configuration parameters as variables. ```bash psql -h localhost -p 4566 -d dev -U root \ -v ak="'$AWS_ACCESS_KEY_ID'" \ -v sk="'$AWS_SECRET_ACCESS_KEY'" \ -v region="'$REGION'" \ -v wh="'$TABLE_BUCKET_ARN'" \ -v ns="$NAMESPACE" \ -v tb="$RW_TABLE" \ -v uri="'$CATALOG_URI'" ``` -------------------------------- ### Start Docker Compose services Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/web-ui/risingwave-console/installation-setup.mdx Starts the defined Docker Compose services in detached mode. ```shell docker compose up -d ``` -------------------------------- ### GRANT Example: Specific Source Privilege Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-grant.mdx Example of granting SELECT privilege on a specific source. ```APIDOC ## GRANT Example: Specific Source Privilege ### Description This example demonstrates granting the SELECT privilege on a particular source to a user. ### Method SQL ### Endpoint N/A (SQL Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```sql GRANT SELECT ON SOURCE s1 TO user1; ``` ### Response #### Success Response (200) Privileges granted successfully. #### Response Example None ``` -------------------------------- ### Create Database with Custom Barrier and Checkpoint Settings Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-create-database.mdx Example demonstrating how to create a database with custom settings for barrier interval and checkpoint frequency. This allows for fine-tuning data persistence timing per database. Requires RisingWave v2.5.0 or later. ```sql CREATE DATABASE IF NOT EXISTS travel WITH OWNER = travel_admin BARRIER_INTERVAL_MS = 1500 CHECKPOINT_FREQUENCY = 5; ``` -------------------------------- ### Install RisingWave via Helm Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/sources/webhook.mdx Command to install the RisingWave Helm release with the webhook listener enabled. ```bash helm install --set tags.bundle=true,frontendComponent.webhookListener=true risingwave risingwavelabs/risingwave --version 0.2.38 ``` -------------------------------- ### Create Table and Index Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-show-create-index.mdx Before using SHOW CREATE INDEX, you typically need to create a table and then an index on that table. This example shows how to create a table 't3' and an index 'idx1' on its 'v1' and 'v2' columns. ```sql CREATE TABLE IF NOT EXISTS t3 ( v1 int, v2 int, v3 int); CREATE INDEX idx1 ON t3 (v1,v2); ``` -------------------------------- ### Change Function Schema Example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-alter-function.mdx Example demonstrating how to change the schema of a function named 'test_func' to 'test_schema'. ```sql -- Change the schema of the function named "test_func" to a schema named "test_schema" ALTER FUNCTION test_func(INT) SET SCHEMA test_schema; ``` -------------------------------- ### Verify dbt Plugin Installation Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/dbt.mdx Run this command to confirm that the dbt-risingwave plugin is successfully installed and recognized by dbt. ```bash dbt --version ``` -------------------------------- ### Create and populate PostgreSQL test table Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/sources/postgresql-table.mdx Sets up a sample table in the PostgreSQL database for querying. ```sql CREATE TABLE test (id bigint primary key, x int); INSERT INTO test SELECT id, id::int FROM generate_series(1, 100) AS t(id); ``` -------------------------------- ### Install libpq on macOS Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/deploy/install-psql-without-postgresql.mdx Install the libpq package, which includes the psql client and other utilities, using Homebrew on macOS. ```bash brew install libpq ``` -------------------------------- ### Initiate a dbt Project Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/dbt.mdx Start a new dbt project. You will be prompted to enter a project name and specify database configurations for RisingWave. ```bash dbt init ``` -------------------------------- ### Provide RisingWave Configuration File Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/deploy/node-specific-configurations.mdx Start a RisingWave node with a specified configuration file using the --config-path argument. ```bash risingwave --config-path=/path/to/risingwave.toml ``` -------------------------------- ### Start a UDF Server with Registered Functions Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/udfs/use-udfs-in-java.mdx Create a UDF server instance, register your custom functions (e.g., 'gcd', 'series'), and start the server. The server listens on a specified address and port, awaiting requests from RisingWave. Ensure proper exception handling. ```java import com.risingwave.functions.UdfServer; public class App { public static void main(String[] args) { try (var server = new UdfServer("0.0.0.0", 8815)) { // Register functions server.addFunction("gcd", new Gcd()); server.addFunction("series", new Series()); // Start the server server.start(); server.awaitTermination(); } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Get array length Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/functions/array.mdx Use `array_length` to get the total number of elements in an array or the length of a specific dimension. ```sql array_length ( array ) → int ``` ```sql array_length(array[1,2,3,4,1]) → 5 ``` ```sql array_length ( array, int ) → int ``` ```sql array_length(array[2, 3, 4], 1) → 3 ``` -------------------------------- ### Install SQLMesh with RisingWave Adapter Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/integrations/other/sqlmesh.mdx Install the SQLMesh Python package, including the specific adapter for RisingWave, using pip. ```bash pip install "sqlmesh[risingwave]" ``` -------------------------------- ### Create and Insert Data for Example Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/query-syntax/set-operations.mdx These SQL statements create two tables, 'employees' and 'managers', and populate them with sample data to demonstrate the CORRESPONDING keyword. ```sql CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR, age INT, gender VARCHAR ); CREATE TABLE managers ( id INT PRIMARY KEY, name VARCHAR, salary DECIMAL, gender VARCHAR ); INSERT INTO employees (id, name, age, gender) VALUES (1, 'Alice', 30, 'Female'), (2, 'Bob', 25, 'Male'), (3, 'Charlie', 28, 'Male'); INSERT INTO managers (id, name, salary, gender) VALUES (1, 'David', 80000, 'Male'), (2, 'Eve', 90000, 'Female'), (3, 'Frank', 75000, 'Male'); ``` -------------------------------- ### Install Lakekeeper Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/iceberg/catalogs/lakekeeper.mdx Install Lakekeeper into the 'risingwave' namespace using its Helm chart. This command names the Lakekeeper release 'my-lakekeeper'. ```bash helm install -n risingwave my-lakekeeper lakekeeper/lakekeeper ``` -------------------------------- ### Example Parameter Mapping for restore-meta Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/operate/meta-backup.mdx Illustrates how to map RisingWave cluster parameters to `risectl meta restore-meta` arguments for restoring from a snapshot. ```bash psql=> show parameters; Name | Value | Mutable ---------------------------------------+--------------------------------------+--------- state_store | hummock+s3://state_bucket | f data_directory | state_data | f backup_storage_url | s3://backup_bucket | t backup_storage_directory | backup_data | t ``` -------------------------------- ### Create Table, Subscription, and Cursor Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/serve/subscription.mdx Sets up a basic RisingWave environment by creating a table, defining a subscription for it, and then declaring a cursor for that subscription. ```sql -- Create a table and insert some data. create table t1(v1 int, v2 int, v3 int); insert into t1 values(1,1,1); -- Create a subscription. create subscription sub from t1 with (retention = '1D'); -- Create a subscription cursor. declare cur subscription cursor for sub full; ``` -------------------------------- ### START TRANSACTION Syntax Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/sql/commands/sql-start-transaction.mdx This is the basic syntax for the START TRANSACTION command. Note that for read-only transactions, `READ ONLY` must be appended. ```sql START TRANSACTION; ``` -------------------------------- ### Deploy RisingWave Console via Binary Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/web-ui/risingwave-console/installation-setup.mdx Run the console binary by providing the license path, PostgreSQL DSN, and root password as environment variables. ```shell RW_LICENSE_KEY_PATH=/etc/rconsole/license.jwt \ RCONSOLE_SERVER_PG_DSN="postgres://rconsole_user:rconsole_password@postgres.example:5432/rconsole" \ RCONSOLE_ROOT_PASSWORD="your_secure_password" \ ./risingwave-console ``` -------------------------------- ### Start Demo Cluster with Docker Compose Source: https://github.com/risingwavelabs/risingwave-docs/blob/main/demos/clickstream-analysis.mdx Navigate to the clickstream integration test directory and start the demo cluster using Docker Compose. This command launches RisingWave components and a workload generator feeding data into Kafka. ```bash cd risingwave/integration_tests/clickstream docker compose up -d ```