use of com.facebook.presto.sql.tree.Literal in project presto by prestodb.
the class SimplifyCountOverConstant method isCountOverConstant.
private static boolean isCountOverConstant(AggregationNode.Aggregation aggregation, Assignments inputs) {
Signature signature = aggregation.getSignature();
if (!signature.getName().equals("count") || signature.getArgumentTypes().size() != 1) {
return false;
}
Expression argument = aggregation.getCall().getArguments().get(0);
if (argument instanceof SymbolReference) {
argument = inputs.get(Symbol.from(argument));
}
return argument instanceof Literal && !(argument instanceof NullLiteral);
}
Aggregations