You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2017/03/10 19:58:04 UTC

[jira] [Commented] (DRILL-5331) NPE in FunctionImplementationRegistry.findDrillFunction() if dynamic UDFs disabled

    [ https://issues.apache.org/jira/browse/DRILL-5331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905615#comment-15905615 ] 

Paul Rogers commented on DRILL-5331:
------------------------------------

Fix done as part of the parent task: DRILL-5330.

> 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: Sub-task
>    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}}:
> {code}
>   String USE_DYNAMIC_UDFS_KEY = "exec.udf.use_dynamic";
>   BooleanValidator USE_DYNAMIC_UDFS = new BooleanValidator(USE_DYNAMIC_UDFS_KEY, true);
> {code}
> 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 function:
> {code}
>   public DrillFuncHolder findDrillFunction(FunctionResolver functionResolver, FunctionCall functionCall) {
>     ...
>     if (holder == null) {
>       syncWithRemoteRegistry(version.get());
>       List<DrillFuncHolder> updatedFunctions = localFunctionRegistry.getMethods(newFunctionName, version);
>       holder = functionResolver.getBestMatch(updatedFunctions, functionCall);
>     }
> {code}
> The result is an NPE:
> {code}
> 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) ~[classes/:na]
> {code}
> The fix is simply to add a DUDF-enabled check:
> {code}
>     if (holder == null) {
>       boolean useDynamicUdfs = optionManager != null && optionManager.getOption(ExecConstants.USE_DYNAMIC_UDFS);
>       if (useDynamicUdfs) {
>         syncWithRemoteRegistry(version.get());
>         ...
> {code}
> Then, disable dynamic UDFs for the test case by setting {{ExecConstants.USE_DYNAMIC_UDFS}} to false.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)