drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Rogers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5331) NPE in FunctionImplementationRegistry.findDrillFunction() if dynamic UDFs disabled
Date Wed, 08 Mar 2017 00:35:37 GMT
Paul Rogers created DRILL-5331:

             Summary: NPE in FunctionImplementationRegistry.findDrillFunction() if dynamic
UDFs disabled
                 Key: DRILL-5331
                 URL: https://issues.apache.org/jira/browse/DRILL-5331
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.10.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers
             Fix For: 1.11.0

Drill provides the Dynamic UDF (DUDF) functionality. DUFDs can be disabled using the following
option in {{ExecConstants}}:

  String USE_DYNAMIC_UDFS_KEY = "exec.udf.use_dynamic";
  BooleanValidator USE_DYNAMIC_UDFS = new BooleanValidator(USE_DYNAMIC_UDFS_KEY, true);

In a unit test, we created a setup in which we wish to use only the local function registry,
no DUDF support is needed. Run the code. The following code is invoked when asking for a non-existent

  public DrillFuncHolder findDrillFunction(FunctionResolver functionResolver, FunctionCall
functionCall) {
    if (holder == null) {
      List<DrillFuncHolder> updatedFunctions = localFunctionRegistry.getMethods(newFunctionName,
      holder = functionResolver.getBestMatch(updatedFunctions, functionCall);

The result is an NPE:

ERROR o.a.d.e.e.f.r.RemoteFunctionRegistry - Problem during trying to access remote function
registry [registry]
java.lang.NullPointerException: null
	at org.apache.drill.exec.expr.fn.registry.RemoteFunctionRegistry.getRegistryVersion(RemoteFunctionRegistry.java:119)

The fix is simply to add a DUDF-enabled check:

    if (holder == null) {
      boolean useDynamicUdfs = optionManager != null && optionManager.getOption(ExecConstants.USE_DYNAMIC_UDFS);
      if (useDynamicUdfs) {

This message was sent by Atlassian JIRA

View raw message