-
Notifications
You must be signed in to change notification settings - Fork 596
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
refactor(frontend): rearrange column binding steps in create table handler #19917
base: main
Are you sure you want to change the base?
Conversation
&generated_column_names, | ||
pk_column_ids, | ||
)?; | ||
// Check if generated column references another generated column. |
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.
This inlines the function.
// Check if impure generated columns are part of the primary key. | ||
for column in &columns { |
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.
This step used to be in bind_sql_column_constraints
, now moved into bind_pk_and_row_id_on_relation
as a post check.
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.
To be honest, I am not sure about if we need to support row_id in generated column...
dev=> explain create table t(v int, k bigint as _row_id::bigint);
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------
------
StreamMaterialize { columns: [v, k, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: Overwr
ite }
└─StreamRowIdGen { row_id_index: 2 }
└─StreamUnion { all: true }
└─StreamExchange { dist: HashShard(_row_id) }
└─StreamProject { exprs: [v, _row_id::Int64 as $expr1, _row_id] }
└─StreamDml { columns: [v, _row_id] }
└─StreamSource
(7 rows)
168965d
to
04928f1
Compare
f141ea7
to
2d02e3e
Compare
8d19f9f
to
9f28773
Compare
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
9f28773
to
b8e0b14
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Rearrange some column binding steps in
CREATE TABLE
handler.Basically, it makes
gen_create_table_plan_without_source
lightweight and not take AST types as arguments. This is in preparation for #19866.Checklist
Documentation
Release note