Verify no mask symbol when implementing filtered aggregation
@@ -30,6 +30,7 @@ import java.util.Optional;
import static com.facebook.presto.spi.type.BooleanType.BOOLEAN;
import static com.facebook.presto.sql.planner.plan.Patterns.aggregation;
+import static com.google.common.base.Verify.verify;
/**
* Implements filtered aggregations by transforming plans of the following shape:
@@ -87,6 +88,7 @@ public class ImplementFilteredAggregations
if (call.getFilter().isPresent()) {
Expression filter = call.getFilter().get();
Symbol symbol = context.getSymbolAllocator().newSymbol(filter, BOOLEAN);
+ verify(!mask.isPresent(), "Expected aggregation without mask symbols, see Rule pattern");
newAssignments.put(symbol, filter);
mask = Optional.of(symbol);
}
