drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zelaine Fong (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-5331) NPE in FunctionImplementationRegistry.findDrillFunction() if dynamic UDFs disabled
Date Mon, 20 Mar 2017 15:42:41 GMT

     [ https://issues.apache.org/jira/browse/DRILL-5331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Zelaine Fong updated DRILL-5331:
--------------------------------
    Reviewer: Arina Ielchiieva

Assigned Reviewer to [~arina]

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

Mime
View raw message