github-actions[bot] commented on code in PR #69812:
URL: https://github.com/apache/doris/pull/69812#discussion_r4412619815
##########
fe/fe-catalog/src/main/java/org/apache/doris/catalog/Column.java:
##########
@@ -912,13 +925,14 @@ public String toSql(boolean isUniqueTable, boolean
isCompatible) {
public String toSql(boolean isUniqueTable, boolean isCompatible, boolean
useGeneratedColumnPlaceholder) {
StringBuilder sb = new StringBuilder();
sb.append("`").append(name).append("` ");
- String typeStr = type.toSql();
-
- // show change datetimeV2/dateV2 to datetime/date
- if (isCompatible) {
+ if (type instanceof VariantType) {
Review Comment:
[P2] Preserve V1 when printing legacy ScalarType VARIANT columns
Old VARIANT columns can still deserialize as plain `ScalarType` (as
`ScalarTypeTest` explicitly verifies), so they bypass this `instanceof
VariantType` branch and print only `variant`, without the V1 policy. With
`default_variant_max_subcolumns_count=0` and doc/nested defaults disabled,
`CREATE TABLE clone LIKE legacy` reparses that text through the new V2 parser
default: the source remains V1/count-zero (every dynamic path materialized),
but the clone becomes V2/count-zero (every dynamic path sparse). Replaying
`SHOW CREATE TABLE` has the same problem, so an upgraded legacy table loses its
storage/index layout when recreated even with the same count setting. Format
the legacy `ScalarType` representation with explicit V1/count-zero properties
as well, and cover this metadata class in the DDL round-trip test.
--
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]