-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support altering the target table’s columns of the sink. #17203
Conversation
fd985ab
to
4679d4d
Compare
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
original_target_columns
compatibility code is scattered across the meta and frontend, and only performs compatibility after changing the schema of the table. Seems a bit easy to get wrong. Can we execute the compatibility code on meta startup to fill all sink values?
872fe27
to
ecabd06
Compare
926593b
to
cdc7696
Compare
cdc7696
to
b64a33f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
input: vec![StreamNode { | ||
node_body: Some(NodeBody::Merge(MergeNode { | ||
..Default::default() | ||
})), | ||
..Default::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be clear to explicitly populate these defaults value and add an todo comment here? #17658
47a6563
to
e8178e4
Compare
It seems like there's no way to resolve the single node test stackoverflow issue. 🥵 |
:lark_cry |
Shall we try |
… `DdlController`, and `catalog::Sink`.
74d0c29
to
66b79d7
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Title: Enhance Sink Behavior to Handle Table Alterations and Add Associated Tests
Summary:
This pull request implements enhancements to the system's behavior concerning sinks when table alterations occur. The changes span across several areas of the codebase, including test scripts, protobuf definitions, and Rust source code. Here's a breakdown of the key additions and modifications:
A new end-to-end test script
alter_column.slt
has been added undere2e_test/sink/sink_into_table
. This script validates the system's ability to manage sinks during various table alteration operations, including creating tables and sinks, inserting values, and adding or attempting to drop columns. It further checks if the sink tables reflect the correct state after these operations.Removal of a specific test case from
basic.slt
indicates an important change in the behavior of the system. The removed test case previously checked for an error when altering a table by adding a column with active incoming sinks. This change implies that the system may now support adding columns to a populated sink table.The protobuf definition for a
Sink
withincatalog.proto
has been updated to incorporate arepeated field original_target_columns
. This new field stores the initial structure of a sink's target table, facilitating the management of table alterations in relation to sinks.The main body of Rust source code changes revolves around handling table alterations when sinks are involved:
sink/catalog/desc.rs
andsink/catalog/mod.rs
have been updated to manage the neworiginal_target_columns
data.default_column_exprs
has been added tofrontend/src/catalog/table_catalog.rs
. This function generates default expressions for columns, which is essential for populating default values in rows added to altered tables.frontend/src/handler/alter_table_column.rs
has been augmented to enable table alterations in the presence of sinks, highlighting improved support for adding columns to tables with active sinks.The pull request also notes the use of Rust
HashMap
andVec
collections to maintain the newly introduced data points, signaling improvements in data handling, particularly for append-only tables engaged in sink operations.This pull request presents a comprehensive enhancement to the system, focusing on improved sink interaction with table alterations. Reviewers can delve into the individual elements of this update for a more detailed understanding, and further discussions are encouraged to fine-tune these changes.
Please review these changes and provide feedback on any aspects that may benefit from further clarification
Checklist
./risedev check
(or alias,./risedev c
)