When the schema of your upstream source changes (i.e. adding or removing columns), you need to modify the schema of the corresponding source or table in RisingWave to ensure they are aligned. If the schema registry is used to create a source or table, you cannot modify the schema of the source or table.Documentation Index
Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
Use this file to discover all available pages before exploring further.
Add a column
To add a column to a source, use this command:Note that 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.
mv1 that is created with this statement:
my_kafka_source:
mv1 does not contain the new column new_col. If you want to pick up this new column, you’ll need to create a new materialized view.
Remove a column
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. If a column of a table is referenced in a materialized view, you cannot remove the column. This is to ensure data consistency and prevent disruptions to downstream data processing. To remove a column from a table, use this command:Refresh the schema registry
Source
At present, combined with the ALTER SOURCE command, you can refresh the schema registry of a source by refilling its FORMAT and ENCODE options. The syntax is:Currently, it is not supported to modify the
data_format and data_encode. Furthermore, when refreshing the schema registry of a source, it is not allowed to drop columns or change types.REFRESH SCHEMA clause of ALTER SOURCE can also be used to refresh the schema of a source.
Table
Similarly, you can use the following statement to refresh the schema of a table with connectors. For more details, see ALTER TABLE. Refresh schema of tableIf a downstream fragment references a column that is either missing or has undergone a type change in the updated schema, the command will be declined.