Github user hsuanyi commented on a diff in the pull request: https://github.com/apache/drill/pull/397#discussion_r54952798 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java --- @@ -17,40 +17,60 @@ */ package org.apache.drill.exec.expr.fn; -import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Map.Entry; -import java.util.Set; -import org.apache.calcite.sql.SqlOperator; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.tuple.Pair; import org.apache.drill.common.scanner.persistence.AnnotatedClassDescriptor; import org.apache.drill.common.scanner.persistence.ScanResult; -import org.apache.drill.exec.expr.DrillFunc; import org.apache.drill.exec.planner.logical.DrillConstExecutor; import org.apache.drill.exec.planner.sql.DrillOperatorTable; import org.apache.drill.exec.planner.sql.DrillSqlAggOperator; import org.apache.drill.exec.planner.sql.DrillSqlOperator; import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Sets; +/** + * Registry of Drill functions. + */ public class DrillFunctionRegistry { - static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillFunctionRegistry.class); + private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillFunctionRegistry.class); - private ArrayListMultimap<String, DrillFuncHolder> methods = ArrayListMultimap.create(); + // key: function name (lowercase) value: list of functions with that name + private final ArrayListMultimap<String, DrillFuncHolder> registeredFunctions = ArrayListMultimap.create(); - /* Hash map to prevent registering functions with exactly matching signatures - * key: Function Name + Input's Major Type - * Value: Class name where function is implemented - */ - private HashMap<String, String> functionSignatureMap = new HashMap<>(); + private static final Map<String, Pair<Integer, Integer>> drillFuncToRange = Maps.newHashMap(); --- End diff -- addressed
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---