Skip to main content

Syntax

alter_option depends on the operation you want to perform on the source. For all supported clauses, see the sections below.

Clause

ADD COLUMN

Parameter or clauseDescription
ADD COLUMNThis clause adds a column to the specified source.
col_nameThe name of the new column you want to add to the source.
data_typeThe data type of the newly added column. With the struct data type, you can create a nested table. Elements in a nested table need to be enclosed with angle brackets (<>).
  • To alter columns in a source created with a schema registry, see REFRESH SCHEMA.
  • You cannot add a primary key column to a source or table in RisingWave. To modify the primary key of a source or table, you need to recreate the table.
  • You cannot remove a column from a source in RisingWave. If you intend to remove a column from a source, you’ll need to drop the source and create the source again.

CONNECTOR WITH

Added in v2.6.0.
ParameterDescription
CONNECTOR WITHAllows you to update connector-specific properties for an existing source without recreating it. Be aware that the properties defined in CONNECTION should be altered by ALTER CONNECTION.
property_nameWe currently support altering Kafka connectors only. Support for more sources and properties will be added in future release. For Kafka, supported parameters include: properties.client.id, properties.sync.call.timeout, properties.enable.auto.commit, properties.enable.ssl.certificate.verification, properties.fetch.max.bytes, properties.fetch.queue.backoff.ms, properties.fetch.wait.max.ms, properties.message.max.bytes, properties.queued.max.messages.kbytes, properties.queued.min.messages, properties.receive.message.max.bytes, properties.statistics.interval.ms, properties.ssl.endpoint.identification.algorithm, properties.ssl.ca.location, properties.ssl.ca.pem, properties.ssl.certificate.location, properties.ssl.certificate.pem, properties.ssl.key.location, properties.ssl.key.pem, properties.ssl.key.password, properties.security.protocol, properties.sasl.mechanism, properties.sasl.username, properties.sasl.password
Example
For routine, supported property updates, prefer using ALTER SOURCE ... CONNECTOR WITH. For advanced operational scenarios (such as updating properties not supported by ALTER SOURCE), you can use low-level risectl commands. These are intended for cluster operators and require direct access to the RisingWave binary. See Update source properties with risectl for details.

REFRESH SCHEMA

Fetch the latest schema from the schema registry and update the source schema.
Currently when refreshing the schema registry of a source, it is not allowed to drop columns or change types.
For example, assume we have a source as follows:
Create a source
Then we can refresh its schema with the following statement:
Refresh schema

RENAME TO

Parameter or clauseDescription
RENAME TOThis clause changes the name of the source.
new_source_nameThe new name of the source.

OWNER TO

Parameter or clauseDescription
OWNER TOThis clause changes the owner of the source.
new_userThe new owner you want to assign to the source.

SET SCHEMA

Parameter or clauseDescription
SET SCHEMAThis clause moves the source to a different schema.
schema_nameThe name of the schema to which the source will be moved.

SET PARALLELISM

Added in v2.3.0.
Parameter or clauseDescription
SET PARALLELISMThis clause controls the degree of parallelism for the targeted streaming job.
source_nameShould be a shared source.
parallelism_numberCan be ADAPTIVE or a fixed number (e.g., 1, 2, 3). Setting it to ADAPTIVE expands the job’s parallelism to all available units, while a fixed number locks it at that value. Setting it to 0 is equivalent to ADAPTIVE. The maximum allowed value is determined by the max_parallelism of the job. For more information, see Configuring maximum parallelism.

SET BACKFILL_PARALLELISM

This statement controls the degree of parallelism used during the backfill phase of a source. It lets you tune resource usage for backfilling independently from the source’s steady-state parallelism.
Parameter or clauseDescription
SET BACKFILL_PARALLELISMSets the parallelism for the backfill phase of the streaming job.
parallelism_valueCan be ADAPTIVE or a fixed number (e.g., 1, 2, 3). Setting it to ADAPTIVE or 0 expands backfill parallelism to all available units. A fixed number locks it at that value.
DEFERREDOptional. When specified, the change takes effect after the current backfill completes, without interrupting an ongoing backfill. If omitted, the change is applied immediately.

SET SOURCE_RATE_LIMIT

Use this statement to modify the rate limit of a source. For the specific value of SOURCE_RATE_LIMIT, refer to How to view runtime parameters.
For a newly created materialized view on a source with historical data e.g. Kafka source, it will backfill from the source. The backfilling process will not be affected by the SOURCE_RATE_LIMIT of the source.To modify the rate limit of the backfilling process, please refer to SET BACKFILL_RATE_LIMIT.
Example
Example

SWAP WITH

ParameterDescription
nameThe current name of the source to swap.
target_nameThe target name of the source you want to swap with.