github-actions[bot] commented on code in PR #61539:
URL: https://github.com/apache/doris/pull/61539#discussion_r3097875021
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java:
##########
@@ -181,8 +187,9 @@ public String toSql() {
.append(String.valueOf(variantMaxSparseColumnStatisticsSize))
.append("\"");
sb.append(",");
+ // Output at least 1 for backward compatibility: old data without
this parameter defaults to 0
Review Comment:
This mirror has the same `0 -> 1` normalization as the catalog
`VariantType.toSql()`, so planner-side SQL rendering is still unstable for
legacy `variant_sparse_hash_shard_count = 0` schemas. Please keep the raw value
here as well, otherwise the Nereids and catalog `toSql()` paths continue to
disagree with the stored schema.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -5334,7 +5334,6 @@ public DataType
visitVariantPredefinedFields(VariantPredefinedFieldsContext ctx)
// When doc mode is enabled, disable subcolumn extraction and sparse
column features
if (enableVariantDocMode) {
// Disable sparse column features
- variantMaxSubcolumnsCount = 0;
Review Comment:
Removing the forced `variantMaxSubcolumnsCount = 0` fallback changes the
meaning of existing doc-mode DDL that does not mention the new property. Before
this patch, `VARIANT<PROPERTIES("variant_enable_doc_mode"="true")>` always
stayed in pure doc-value mode; after this removal it inherits
`default_variant_max_subcolumns_count` (2048 by default) and can start
producing downgraded subcolumn-only segments. The fact that many existing
doc-mode tests in this PR had to add `set default_variant_max_subcolumns_count
= 0` is a strong signal of that compatibility break. If the mixed mode is
intentional, can we gate it on an explicit schema property so old DDL keeps the
old storage semantics?
##########
fe/fe-type/src/main/java/org/apache/doris/catalog/VariantType.java:
##########
@@ -183,8 +187,9 @@ public String toSql(int depth) {
sb.append("\"variant_max_sparse_column_statistics_size\" = \"")
.append(String.valueOf(variantMaxSparseColumnStatisticsSize)).append("\"");
sb.append(",");
+ // Output at least 1 for backward compatibility: old data without
this parameter defaults to 0
sb.append("\"variant_sparse_hash_shard_count\" = \"")
-
.append(String.valueOf(variantSparseHashShardCount)).append("\"");
Review Comment:
Normalizing `variantSparseHashShardCount` with `Math.max(1, ...)` makes
`SHOW CREATE TABLE` rewrite a stored `variant_sparse_hash_shard_count = 0` as
`1`. FE still compares the raw values in `Column.checkSupportSchemaChange()`,
so a round-tripped definition now looks like a bucket-count change even though
it came from the same table. Can we preserve the stored value here unless the
comparison path is normalized too?
--
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]