feat(frontend): allow schema change & sink into a CTAS table #20174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Allow performing schema changes (
ALTER TABLE ... [ADD | DROP] COLUMN
) on or create a sink into a table created byCREATE TABLE AS
statement.After #19949, we now have two different methods for retrieving the definition of a table:
create_sql
andcreate_sql_purified
. Prior to this PR,create_sql
always directly return the persisted definition string, whilecreate_sql_purified
will re-assemble a definition with all columns qualified based on theTableCatalog
.However, the definitions for CTAS tables are missing, causing
create_sql_ast
to always return an error. This seems pointless. So this PR makescreate_sql_ast
also run purification if (and only if) the definition is missing (indicating that it's a CTAS table). This enables replacing functionalities for CTAS table, including schema change and sink-into-table.Checklist
Documentation
Release note