Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/929#discussion_r55475795
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java ---
    @@ -215,12 +216,48 @@ public void serviceInit(Configuration conf) throws 
Exception {
         LOG.info("Tajo Master is initialized.");
       }
     
    +  private Collection<FunctionDesc> loadFunctions() throws IOException, 
AmbiguousFunctionException {
    +    List<FunctionDesc> functionList = new 
ArrayList<>(FunctionLoader.loadBuiltinFunctions().values());
    +
    +    HashMap<Integer, FunctionDesc> funcSet = new HashMap<>();
    +
    +    for (FunctionDesc desc: functionList) {
    +      funcSet.put(desc.hashCodeWithoutType(), desc);
    +    }
    +
    +    
checkUDFduplicateAndMerge(FunctionLoader.loadUserDefinedFunctions(systemConf), 
funcSet, functionList);
    +    checkUDFduplicateAndMerge(HiveFunctionLoader.loadHiveUDFs(systemConf), 
funcSet, functionList);
    +
    +    return functionList;
    +  }
    +
    +  /**
    +   * Checks duplicates between pre-loaded functions and UDFs. And they are 
meged to funcList.
    +   *
    +   * @param udfs UDF list
    +   * @param funcSet set for pre-loaded functions to match signature
    +   * @param funcList list to be merged
    +   * @throws AmbiguousFunctionException
    +   */
    +  private void checkUDFduplicateAndMerge(Optional<List<FunctionDesc>> 
udfs, HashMap<Integer, FunctionDesc> funcSet, List<FunctionDesc> funcList)
    --- End diff --
    
    It would be better if you add a test for this method.


---
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.
---

Reply via email to