-
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
fix(frontend): check data type in column id generator #19828
Conversation
0583ff4
to
f191ab0
Compare
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
46ded5b
to
b0bc757
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
&Field::with_name( | ||
StructType::new([("f1", DataType::Int32)]).into(), | ||
"nested", | ||
), |
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.
Yet another example of why Field::sub_fields
(and ColumnDesc::field_descs
) shall be consolidated into StructType
. Currently Field::with_name
on struct
produces incomplete results - and there is a special Field::with_struct
.
No need to fix the usage in this PR as the incomplete results are NEVER used except describe
#17128
Signed-off-by: Bugen Zhao <[email protected]>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
When generating column ID for existing columns (by name), also check and reject if the data type changes. Otherwise, the persisted data will be incompatible and lead to undefined behavior.
Note that for struct types, the nested fields are encoded with value-encoding (instead of column-aware encoding) under current implementation. As a result, adding new nested fields cannot be supported and should be rejected as well. Close #19736.
This won't be hit for a regular table as we don't provide syntax support for altering the data type for an existing column. However, schema registries may consider this as a compatible change so it can be hit by
ALTER TABLE REFRESH SCHEMA
.Checklist
Documentation
Release note