From b3b8282cbd9c5c90a409a68c5156604f1eac9e69 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan <> Date: Fri, 11 Dec 2020 17:58:37 -0800 Subject: [PATCH] remove unnecessary check. anyMatch returns false for empty list. --- .../sql/sql/parser/AstAggregationBuilder.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sql/src/main/java/com/amazon/opendistroforelasticsearch/sql/sql/parser/AstAggregationBuilder.java b/sql/src/main/java/com/amazon/opendistroforelasticsearch/sql/sql/parser/AstAggregationBuilder.java index 235774f558..4c56d3c64d 100644 --- a/sql/src/main/java/com/amazon/opendistroforelasticsearch/sql/sql/parser/AstAggregationBuilder.java +++ b/sql/src/main/java/com/amazon/opendistroforelasticsearch/sql/sql/parser/AstAggregationBuilder.java @@ -146,10 +146,6 @@ private boolean isNonLiteralFunction(UnresolvedExpression expr) { } if (expr instanceof Function) { List children = expr.getChild(); - // The base case for functions without input. e.g. PI(), NOW(), etc. - if (children.isEmpty()) { - return false; - } return children.stream().anyMatch(child -> isNonLiteralFunction((UnresolvedExpression) child)); }