Skip to content

Commit

Permalink
[enhancement](stats) Add process for aggstate type apache#27640 (apac…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikyou1997 authored and eldenmoon committed Dec 3, 2023
1 parent 41cf5c3 commit 8b0297e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
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;
Expand Down Expand Up @@ -193,7 +192,7 @@ private void checkColumn() throws AnalysisException {
ErrorReport.reportAnalysisException(ErrorCode.ERR_WRONG_COLUMN_NAME,
colName, FeNameFormat.getColumnNameRegex());
}
if (ColumnStatistic.UNSUPPORTED_TYPE.contains(column.getType())) {
if (StatisticsUtil.isUnsupportedType(column.getType())) {
containsUnsupportedTytpe = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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;
Expand Down Expand Up @@ -759,7 +760,8 @@ public static boolean isUnsupportedType(Type type) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@

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
properties(
"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"""

Expand Down

0 comments on commit 8b0297e

Please sign in to comment.