[feature](Nereids): make count() avaliable for all data type (#26180)
make count() avaliable for all data type
This commit is contained in:
@ -18,7 +18,6 @@
|
||||
package org.apache.doris.nereids.trees.expressions.functions.agg;
|
||||
|
||||
import org.apache.doris.catalog.FunctionSignature;
|
||||
import org.apache.doris.catalog.Type;
|
||||
import org.apache.doris.nereids.exceptions.AnalysisException;
|
||||
import org.apache.doris.nereids.trees.expressions.Expression;
|
||||
import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
|
||||
@ -82,11 +81,9 @@ public class Count extends AggregateFunction
|
||||
public void checkLegalityAfterRewrite() {
|
||||
// after rewrite, count(distinct bitmap_column) should be rewritten to bitmap_union_count(bitmap_column)
|
||||
for (Expression argument : getArguments()) {
|
||||
if (argument.getDataType().isObjectType()) {
|
||||
throw new AnalysisException(Type.OnlyObjectTypeErrorMsg);
|
||||
}
|
||||
if (distinct && argument.getDataType().isComplexType()) {
|
||||
throw new AnalysisException("COUNT DISTINCT could not process complex type " + this.toSql());
|
||||
if (distinct && (argument.getDataType().isComplexType()
|
||||
|| argument.getDataType().isObjectType() || argument.getDataType().isJsonType())) {
|
||||
throw new AnalysisException("COUNT DISTINCT could not process type " + this.toSql());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user