[fix](stats) skip collect agg_state type (#27640)

This commit is contained in:
AKIRA
2023-11-28 11:43:48 +08:00
committed by GitHub
parent f329b90696
commit fc2129a09f
3 changed files with 9 additions and 6 deletions

View File

@ -34,7 +34,6 @@ import org.apache.doris.datasource.CatalogIf;
import org.apache.doris.mysql.privilege.PrivPredicate;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.statistics.AnalysisInfo.AnalysisType;
import org.apache.doris.statistics.ColumnStatistic;
import org.apache.doris.statistics.util.StatisticsUtil;
import com.google.common.collect.Sets;
@ -193,7 +192,7 @@ public class AnalyzeTblStmt extends AnalyzeStmt {
ErrorReport.reportAnalysisException(ErrorCode.ERR_WRONG_COLUMN_NAME,
colName, FeNameFormat.getColumnNameRegex());
}
if (ColumnStatistic.UNSUPPORTED_TYPE.contains(column.getType())) {
if (StatisticsUtil.isUnsupportedType(column.getType())) {
containsUnsupportedTytpe = true;
}
}

View File

@ -31,6 +31,7 @@ import org.apache.doris.analysis.StringLiteral;
import org.apache.doris.analysis.TableName;
import org.apache.doris.analysis.UserIdentity;
import org.apache.doris.analysis.VariableExpr;
import org.apache.doris.catalog.AggStateType;
import org.apache.doris.catalog.ArrayType;
import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.DatabaseIf;
@ -761,7 +762,8 @@ public class StatisticsUtil {
return type instanceof ArrayType
|| type instanceof StructType
|| type instanceof MapType
|| type instanceof VariantType;
|| type instanceof VariantType
|| type instanceof AggStateType;
}
public static void sleep(long millis) {

View File

@ -17,12 +17,14 @@
suite("test_analyze_with_agg_complex_type") {
sql """drop table if exists test_agg_complex_type;"""
sql """set enable_agg_state=true"""
sql """create table test_agg_complex_type (
datekey int,
device_id bitmap BITMAP_UNION NULL,
hll_test hll hll_union,
qs QUANTILE_STATE QUANTILE_UNION
qs QUANTILE_STATE QUANTILE_UNION,
agg_st_1 agg_state max_by(int ,int)
)
aggregate key (datekey)
distributed by hash(datekey) buckets 1
@ -30,9 +32,9 @@ suite("test_analyze_with_agg_complex_type") {
"replication_num" = "1"
);"""
sql """insert into test_agg_complex_type values (1,to_bitmap(1), hll_hash("11"), TO_QUANTILE_STATE("11", 1.0));"""
sql """insert into test_agg_complex_type values (1,to_bitmap(1), hll_hash("11"), TO_QUANTILE_STATE("11", 1.0), max_by_state(1,2));"""
sql """insert into test_agg_complex_type values (2, to_bitmap(1), hll_hash("12"), TO_QUANTILE_STATE("11", 1.0));"""
sql """insert into test_agg_complex_type values (2, to_bitmap(1), hll_hash("12"), TO_QUANTILE_STATE("11", 1.0), max_by_state(1,2));"""
sql """ANALYZE TABLE test_agg_complex_type WITH SYNC"""