DRILL-7663: Code refactor to DefaultFunctionResolver
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/DefaultFunctionResolver.java b/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/DefaultFunctionResolver.java
index b768792..ae3c68b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/DefaultFunctionResolver.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/resolver/DefaultFunctionResolver.java
@@ -19,8 +19,7 @@
import java.util.LinkedList;
import java.util.List;
-
-import org.apache.drill.shaded.guava.com.google.common.collect.Lists;
+import java.util.stream.Collectors;
import org.apache.drill.common.expression.FunctionCall;
import org.apache.drill.common.expression.LogicalExpression;
import org.apache.drill.common.types.TypeProtos;
@@ -38,12 +37,10 @@
int currcost = Integer.MAX_VALUE;
DrillFuncHolder bestmatch = null;
final List<DrillFuncHolder> bestMatchAlternatives = new LinkedList<>();
-
+ List<TypeProtos.MajorType> argumentTypes = call.args().stream()
+ .map(LogicalExpression::getMajorType)
+ .collect(Collectors.toList());
for (DrillFuncHolder h : methods) {
- final List<TypeProtos.MajorType> argumentTypes = Lists.newArrayList();
- for (LogicalExpression expression : call.args()) {
- argumentTypes.add(expression.getMajorType());
- }
currcost = TypeCastRules.getCost(argumentTypes, h);
// if cost is lower than 0, func implementation is not matched, either w/ or w/o implicit casts