Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ public class ContainDistinctFunctionRollupHandler extends AggFunctionRollUpHandl
public static final ContainDistinctFunctionRollupHandler INSTANCE = new ContainDistinctFunctionRollupHandler();
public static Set<AggregateFunction> SUPPORTED_AGGREGATE_FUNCTION_SET = ImmutableSet.of(
new Max(true, Any.INSTANCE), new Min(true, Any.INSTANCE),
new Max(true, Any.INSTANCE).withAlwaysNullable(true),
new Min(true, Any.INSTANCE).withAlwaysNullable(true),
new Max(false, Any.INSTANCE), new Min(false, Any.INSTANCE),
new Count(true, Any.INSTANCE), new Sum(true, Any.INSTANCE),
new Avg(true, Any.INSTANCE));
new Max(false, Any.INSTANCE).withAlwaysNullable(true),
new Min(false, Any.INSTANCE).withAlwaysNullable(true),
new Count(true, Any.INSTANCE),
new Sum(true, Any.INSTANCE), new Sum(true, Any.INSTANCE).withAlwaysNullable(true),
new Avg(true, Any.INSTANCE), new Avg(true, Any.INSTANCE).withAlwaysNullable(true));

@Override
public boolean canRollup(AggregateFunction queryAggregateFunction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
-4

-- !select_avg --
-4
-4.0

Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ suite ("agg_use_key_direct") {
order_qt_select_min """select min(distinct k3) from agg_use_key_direct"""

mv_rewrite_success("""select avg(distinct k3) from agg_use_key_direct""", "common_mv")
order_qt_select_avg """select min(distinct k3) from agg_use_key_direct"""
order_qt_select_avg """select avg(distinct k3) from agg_use_key_direct"""
}