github-actions[bot] commented on code in PR #71008:
URL: https://github.com/apache/doris/pull/71008#discussion_r4690994124
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java:
##########
@@ -496,6 +496,12 @@ public void validate(ConnectContext ctx) {
throw new AnalysisException("Disable to create table with
`DECIMAL` type columns,"
+ "please use `DECIMALV3`.");
}
+ DataType type = columnDef.getType();
+ if (type instanceof VariantType && ((VariantType)
type).isExecutionV2()
Review Comment:
[P2] Apply the template check to ALTER ADD as well
This guard only runs in `CreateTableInfo.validate`; `ADD COLUMN` and `ADD
COLUMNS` validate through `ColumnDefinition` and never reach it. With
`enable_variant_v2=true` and `enable_decimal256=true`, a table with
`light_schema_change=true` still accepts `ALTER TABLE t ADD COLUMN v
VARIANT<'amount':DECIMAL(39,2)> NULL`. After inserting a matching non-null
value and flushing, the V2 shredder writes a Decimal256 materialized path, but
reading the whole `v` reaches `append_materialized_value`
(`variant_assembler_value.cpp:129-133`), which explicitly returns
`NotSupported` for Decimal256. Please reuse the mode-gated check in validation
shared by CREATE and ALTER ADD, and cover both ADD forms, so this fix also
closes that route.
--
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]