Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 79A24200B7F for ; Sun, 11 Sep 2016 13:06:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 78173160AC7; Sun, 11 Sep 2016 11:06:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BD702160AAA for ; Sun, 11 Sep 2016 13:06:34 +0200 (CEST) Received: (qmail 985 invoked by uid 500); 11 Sep 2016 11:06:33 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 965 invoked by uid 99); 11 Sep 2016 11:06:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2016 11:06:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 55F3BE01BA; Sun, 11 Sep 2016 11:06:33 +0000 (UTC) From: arina-ielchiieva To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #574: DRILL-4726: Dynamic UDFs support Content-Type: text/plain Message-Id: <20160911110633.55F3BE01BA@git1-us-west.apache.org> Date: Sun, 11 Sep 2016 11:06:33 +0000 (UTC) archived-at: Sun, 11 Sep 2016 11:06:35 -0000 Github user arina-ielchiieva commented on a diff in the pull request: https://github.com/apache/drill/pull/574#discussion_r78292645 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java --- @@ -138,18 +171,25 @@ private String functionReplacement(FunctionCall functionCall) { /** * Find the Drill function implementation that matches the name, arg types and return type. - * @param name - * @param argTypes - * @param returnType - * @return + * If exact function implementation was not found and in case if Dynamic UDF Support is enabled + * loads all missing remote functions and tries to find Drill implementation one more time. */ public DrillFuncHolder findExactMatchingDrillFunction(String name, List argTypes, MajorType returnType) { + return findExactMatchingDrillFunction(name, argTypes, returnType, true); + } + + private DrillFuncHolder findExactMatchingDrillFunction(String name, List argTypes, MajorType returnType, boolean retry) { for (DrillFuncHolder h : drillFuncRegistry.getMethods(name)) { if (h.matches(returnType, argTypes)) { return h; } } + if (retry && optionManager != null && optionManager.getOption(ExecConstants.DYNAMIC_UDF_SUPPORT_ENABLED).bool_val) { + if (loadRemoteFunctions()) { --- End diff -- Agree. I'll make loadFunctions method thread-safe. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---