Copilot commented on code in PR #62782:
URL: https://github.com/apache/doris/pull/62782#discussion_r3135838488
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java:
##########
@@ -184,6 +184,11 @@ public String toSql() {
.append(String.valueOf(variantSparseHashShardCount))
.append("\"");
}
+ if (enableNestedGroup) {
+ sb.append(",");
+ sb.append("\"variant_enable_nested_group\" = \"")
+ .append(String.valueOf(enableNestedGroup)).append("\"");
+ }
Review Comment:
`org.apache.doris.catalog.VariantType#toSql()` intentionally does *not*
serialize `variant_enable_nested_group` (see
fe-common/src/main/java/org/apache/doris/catalog/VariantType.java:155-190, and
the new TypeTest asserting this). But Nereids `VariantType#toSql()` now appends
`"variant_enable_nested_group"` when `enableNestedGroup` is true, which can
emit DDL that FE will reject in 4.1 (LogicalPlanBuilder throws
NotSupportedException when nested group is enabled). Consider removing this
property from Nereids `toSql()` as well (or gating it behind an explicit
“nested group supported” flag) to keep serialization consistent and avoid
generating unsupported SQL.
```suggestion
```
##########
fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java:
##########
@@ -2015,8 +2015,8 @@ public static int
analyzeVariantSparseHashShardCount(Map<String, String> propert
String bucketNumStr =
properties.get(PROPERTIES_VARIANT_SPARSE_HASH_SHARD_COUNT);
try {
bucketNum = Integer.parseInt(bucketNumStr);
- if (bucketNum < 1 || bucketNum > 1024) {
- throw new
AnalysisException("variant_sparse_hash_shard_count must between 1 and 1024 ");
+ if (bucketNum < 0 || bucketNum > 1024) {
+ throw new
AnalysisException("variant_sparse_hash_shard_count must between 0 and 1024 ");
Review Comment:
The updated error message has a trailing space and is grammatically
incorrect ("must between"). Since this message is user-facing, consider
changing it to something like "variant_sparse_hash_shard_count must be between
0 and 1024" (no trailing whitespace).
```suggestion
throw new
AnalysisException("variant_sparse_hash_shard_count must be between 0 and 1024");
```
--
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]