diff options
author | Padma Penumarthy <ppenumar97@yahoo.com> | 2017-02-22 10:31:01 -0800 |
---|---|---|
committer | Jinfeng Ni <jni@apache.org> | 2017-03-02 10:46:48 -0800 |
commit | 2b5a6f0b523859297f86298ef384cd146e425f72 (patch) | |
tree | 3b7a1e48f88331538708a939e6cdbbb15789841c /exec/java-exec/src/main/java/org/apache/drill/exec/ops | |
parent | 4a0fd56c106550eee26ca68eaed6108f0dbad798 (diff) |
DRILL-5290: Provide an option to build operator table once for built-in static functions and reuse it across queries.
close #757
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/ops')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java index 707815a70..df3f4f4fd 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java @@ -91,7 +91,14 @@ public class QueryContext implements AutoCloseable, OptimizerRulesContext, Schem executionControls = new ExecutionControls(queryOptions, drillbitContext.getEndpoint()); plannerSettings = new PlannerSettings(queryOptions, getFunctionRegistry()); plannerSettings.setNumEndPoints(drillbitContext.getBits().size()); - table = new DrillOperatorTable(getFunctionRegistry(), drillbitContext.getOptionManager()); + + // If we do not need to support dynamic UDFs for this query, just use static operator table + // built at the startup. Else, build new operator table from latest version of function registry. + if (queryOptions.getOption(ExecConstants.USE_DYNAMIC_UDFS)) { + this.table = new DrillOperatorTable(drillbitContext.getFunctionImplementationRegistry(), drillbitContext.getOptionManager()); + } else { + this.table = drillbitContext.getOperatorTable(); + } queryContextInfo = Utilities.createQueryContextInfo(session.getDefaultSchemaPath(), session.getSessionId()); contextInformation = new ContextInformation(session.getCredentials(), queryContextInfo); |