xiedeyantu commented on code in PR #4730:
URL: https://github.com/apache/calcite/pull/4730#discussion_r2670305232


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCollect.java:
##########
@@ -109,15 +109,21 @@ public static Collect create(RelNode input, RelDataType 
rowType) {
       RelDataType childRecordType = 
result.physType.getRowType().getFieldList().get(0).getType();
 
       if (!SqlTypeUtil.sameNamedType(collectionComponentType, 
childRecordType)) {
-        // In the internal representation of multisets , every element must be 
a record. In case the
-        // result above is a scalar type we have to wrap it around a physical 
type capable of
-        // representing records. For this reason the following conversion is 
necessary.
+        // In the internal representation of multisets, every element must be 
a record.
+        // In case the result above is a scalar type we have to wrap it around 
a
+        // physical type capable of representing records.
+        // For ARRAY type with a single field, we use SCALAR format to avoid

Review Comment:
   Is the following description acceptable?
   ```
   For multiple array types, we use SCALAR format to avoid unnecessary wrapping
   ```



-- 
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]

Reply via email to