[Chore](function) remove unused check on count function (#31400)
This commit is contained in:
@ -843,12 +843,6 @@ public class FunctionCallExpr extends Expr {
|
||||
throw new AnalysisException(
|
||||
"COUNT must have DISTINCT for multiple arguments: " + this.toSql());
|
||||
}
|
||||
|
||||
for (Expr child : children) {
|
||||
if (child.type.isOnlyMetricType() && !child.type.isComplexType()) {
|
||||
throw new AnalysisException(Type.OnlyMetricTypeErrorMsg);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ import org.apache.doris.common.ErrorReport;
|
||||
import org.apache.doris.common.UserException;
|
||||
import org.apache.doris.qe.ConnectContext;
|
||||
import org.apache.doris.rewrite.ExprRewriter;
|
||||
import org.apache.doris.rewrite.mvrewrite.CountDistinctToBitmapOrHLLRule;
|
||||
import org.apache.doris.thrift.TQueryOptions;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
@ -275,12 +276,18 @@ public abstract class QueryStmt extends StatementBase implements Queriable {
|
||||
}
|
||||
|
||||
protected Expr rewriteQueryExprByMvColumnExpr(Expr expr, Analyzer analyzer) throws AnalysisException {
|
||||
if (analyzer == null || analyzer.getMVExprRewriter() == null || forbiddenMVRewrite) {
|
||||
if (analyzer == null || analyzer.getMVExprRewriter() == null) {
|
||||
return expr;
|
||||
}
|
||||
ExprRewriter rewriter = analyzer.getMVExprRewriter();
|
||||
rewriter.reset();
|
||||
rewriter.setInfoMVRewriter(disableTuplesMVRewriter, mvSMap, aliasSMap);
|
||||
ExprRewriter rewriter;
|
||||
if (forbiddenMVRewrite) {
|
||||
rewriter = new ExprRewriter(Lists.newArrayList(CountDistinctToBitmapOrHLLRule.INSTANCE),
|
||||
Lists.newArrayList());
|
||||
} else {
|
||||
rewriter = analyzer.getMVExprRewriter();
|
||||
rewriter.reset();
|
||||
rewriter.setInfoMVRewriter(disableTuplesMVRewriter, mvSMap, aliasSMap);
|
||||
}
|
||||
rewriter.setUpBottom();
|
||||
|
||||
Expr result = rewriter.rewrite(expr, analyzer);
|
||||
|
||||
Reference in New Issue
Block a user