github-actions[bot] commented on code in PR #63528:
URL: https://github.com/apache/doris/pull/63528#discussion_r3312341950
##########
be/src/storage/segment/segment.cpp:
##########
@@ -659,10 +659,11 @@ Status Segment::new_default_iterator(const TabletColumn&
tablet_column,
"column_type={}",
tablet_column.unique_id(), tablet_column.name(),
tablet_column.type());
}
+ auto serde = remove_nullable(tablet_column.get_vec_type())->get_serde();
Review Comment:
This fixes the default-iterator path by stripping the top-level nullable
wrapper before parsing, but the schema-change path still uses
`column_schema.get_vec_type()->get_serde()->from_fe_string(...)` in
`SchemaChangeJob::_init_column_mapping()`. For a nullable complex column that
serde is `DataTypeNullableSerDe`, whose `from_fe_string()` returns OK and sets
a null/empty `Field` when the nested parse fails. So `ALTER TABLE ... ADD
COLUMN v ARRAY<INT> DEFAULT '["bad"]'` on a nullable column can pass FE's
top-level literal-shape validation, then direct schema change will store NULL
for existing rows via `_schema_mapping[idx].default_value` instead of rejecting
the invalid default. Please apply the same strict parsing there (for example
parse with `remove_nullable(column_schema.get_vec_type())->get_serde()` when a
default value is present) and add a regression case for nullable complex
defaults added by schema change with type-mismatched ARRAY/MAP/STRUCT elements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]