github-actions[bot] commented on code in PR #63888:
URL: https://github.com/apache/doris/pull/63888#discussion_r3323197429
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java:
##########
@@ -92,7 +92,7 @@ public void checkLegalityBeforeTypeCoercion() {
public void checkLegalityAfterRewrite() {
// after rewrite, count(distinct bitmap_column) should be rewritten to
bitmap_union_count(bitmap_column)
for (Expression argument : getArguments()) {
- if (distinct && (argument.getDataType().isComplexType()
+ if (distinct && ((argument.getDataType().isComplexType() &&
!argument.getDataType().isArrayType())
Review Comment:
This now exempts every top-level `ARRAY` from the complex-type rejection, so
unsupported nested shapes like `count(distinct array(map(...)))`,
`count(distinct array(named_struct(...)))`, or arrays nested around those types
bypass the same MAP/STRUCT rejection that this PR keeps for top-level `m` and
`s`. Those types still lack an explicit COUNT DISTINCT contract here, and the
new tests only cover `array<int>`. Please recursively inspect
`ArrayType.getItemType()` and only allow the array element shapes that the
backend distinct path actually supports, with negative coverage for arrays
wrapping unsupported complex types.
--
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]