You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by jinfengni <gi...@git.apache.org> on 2016/06/14 15:42:20 UTC
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
GitHub user jinfengni opened a pull request:
https://github.com/apache/drill/pull/521
DRILL-4715: Fix java compilation error in run-time generated code whe\u2026
\u2026n query has large number of expressions.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jinfengni/incubator-drill DRILL-4715
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/521.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #521
----
commit 600b01dcaddc2e8e9cb95f728c263ebcfa7441e5
Author: Jinfeng Ni <jn...@apache.org>
Date: 2016-06-10T00:08:45Z
DRILL-4715: Fix java compilation error in run-time generated code when query has large number of expressions.
----
---
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.
---
[GitHub] drill issue #521: DRILL-4715: Fix java compilation error in run-time generat...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on the issue:
https://github.com/apache/drill/pull/521
@sudheeshkatkam , do you want to take a quick look and see if I have addressed your comments? Thanks!
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68148064
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java ---
@@ -17,18 +17,16 @@
*/
package org.apache.drill.exec.physical.impl;
+import static org.apache.drill.exec.RunRootExec.c;
--- End diff --
removed
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68148021
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -247,11 +275,13 @@ void flushCode() {
outer._throws(SchemaChangeException.class);
int methodIndex = 0;
- int blocksInMethod = 0;
+ int exprsInMethod = 0;
boolean isVoidMethod = method.getReturnType() == void.class;
- for(JBlock b : blocks[i++]) {
+ for(SizedJBlock sb : blocks[i++]) {
+ JBlock b = sb.getBlock();
if(!b.isEmpty()) {
- if (blocksInMethod > MAX_BLOCKS_IN_FUNCTION) {
+ if (optionManager != null &&
+ exprsInMethod > optionManager.getOption(ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE).num_val) {
--- End diff --
Done. thx.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68102519
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/SizedJBlock.java ---
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.drill.exec.expr;
+
+import com.sun.codemodel.JBlock;
+
+/**
+ * Uses this class to keep track # of Drill Logical Expressions that are
+ * put to JBlock.
+ */
+public class SizedJBlock {
+ private final JBlock block;
--- End diff --
Added comment.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68102435
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -215,22 +219,47 @@ public JVar declareVectorValueSetupAndMember(DirectExpression batchName, TypedFi
return vv;
}
+ public enum RotateMode {
--- End diff --
Rename it to BlcCreationMode.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r67442811
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/SizedJBlock.java ---
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.drill.exec.expr;
+
+import com.sun.codemodel.JBlock;
+
+/**
+ * Uses this class to keep track # of Drill Logical Expressions that are
+ * put to JBlock.
+ */
+public class SizedJBlock {
+ private final JBlock block;
--- End diff --
Can you add a comment about why the jblock is a member variable rather than SizedJBlock being a derived class of JBlock (which is a final class but is not obvious when looking at this code).
---
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.
---
[GitHub] drill issue #521: DRILL-4715: Fix java compilation error in run-time generat...
Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on the issue:
https://github.com/apache/drill/pull/521
I had couple of minor comments. Changes LGTM. +1.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68148042
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java ---
@@ -186,4 +186,9 @@ public boolean isFunctionComplexOutput(String name) {
}
return false;
}
+
+ public OptionManager getOptionManager() {
--- End diff --
Removed.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68133124
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java ---
@@ -17,17 +17,54 @@
*/
package org.apache.drill.exec;
+import com.codahale.metrics.MetricRegistry;
+import mockit.NonStrictExpectations;
+import org.apache.drill.common.config.DrillConfig;
+import org.apache.drill.common.scanner.ClassPathScanner;
+import org.apache.drill.exec.compile.CodeCompilerTestFactory;
+import org.apache.drill.exec.exception.StoreException;
+import org.apache.drill.exec.memory.RootAllocatorFactory;
import org.apache.drill.exec.metrics.DrillMetrics;
+import org.apache.drill.exec.physical.impl.OperatorCreatorRegistry;
+import org.apache.drill.exec.planner.PhysicalPlanReaderTestFactory;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.server.options.SystemOptionManager;
+import org.apache.drill.exec.store.sys.store.provider.LocalPersistentStoreProvider;
import org.apache.drill.test.DrillTest;
import org.junit.After;
+import org.junit.BeforeClass;
+
+import static org.apache.drill.exec.RunRootExec.c;
public class ExecTest extends DrillTest {
+ protected static SystemOptionManager optionManager;
+
@After
public void clear(){
// TODO: (Re DRILL-1735) Check whether still needed now that
// BootstrapContext.close() resets the metrics.
DrillMetrics.resetMetrics();
}
+
+ @BeforeClass
+ public static void setupOptionManager() throws Exception{
+ final LocalPersistentStoreProvider provider = new LocalPersistentStoreProvider(c);
+ provider.start();
+ optionManager = new SystemOptionManager(PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(c), provider);
+ optionManager.init();
+ }
+
+ protected void initDrillbitContext(final DrillbitContext bitContext) throws Exception {
--- End diff --
How about `mockDrillbitContext(...)`?
---
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.
---
[GitHub] drill issue #521: DRILL-4715: Fix java compilation error in run-time generat...
Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on the issue:
https://github.com/apache/drill/pull/521
Just to be sure, I confirmed with @jinfengni that the new generated code would look like the following: (assume 100 expressions in the Project and limit of 50 exprs per block):
doEval() {
{
generated code for 50 expressions (by default)
}
doEval1();
}
doEval1() {
{
50 expressions
}
// doEval2(); // if needed...each doEval_N() calls doEval_N+1()
}
---
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.
---
[GitHub] drill issue #521: DRILL-4715: Fix java compilation error in run-time generat...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on the issue:
https://github.com/apache/drill/pull/521
@jacques-n @amansinha100 , can you review this PR?
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/drill/pull/521
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68133101
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -247,11 +275,13 @@ void flushCode() {
outer._throws(SchemaChangeException.class);
int methodIndex = 0;
- int blocksInMethod = 0;
+ int exprsInMethod = 0;
boolean isVoidMethod = method.getReturnType() == void.class;
- for(JBlock b : blocks[i++]) {
+ for(SizedJBlock sb : blocks[i++]) {
+ JBlock b = sb.getBlock();
if(!b.isEmpty()) {
- if (blocksInMethod > MAX_BLOCKS_IN_FUNCTION) {
+ if (optionManager != null &&
+ exprsInMethod > optionManager.getOption(ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE).num_val) {
--- End diff --
here as well.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68102305
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -86,14 +88,16 @@ public static MappingSet getDefaultMapping() {
}
@SuppressWarnings("unchecked")
- ClassGenerator(CodeGenerator<T> codeGenerator, MappingSet mappingSet, SignatureHolder signature, EvaluationVisitor eval, JDefinedClass clazz, JCodeModel model) throws JClassAlreadyExistsException {
+ ClassGenerator(CodeGenerator<T> codeGenerator, MappingSet mappingSet, SignatureHolder signature, EvaluationVisitor eval, JDefinedClass clazz, JCodeModel model, OptionManager optionManager) throws JClassAlreadyExistsException {
this.codeGenerator = codeGenerator;
this.clazz = clazz;
this.mappings = mappingSet;
this.sig = signature;
this.evaluationVisitor = eval;
this.model = model;
- blocks = (LinkedList<JBlock>[]) new LinkedList[sig.size()];
+ this.optionManager = optionManager;
--- End diff --
Revise the code to pass in session option manager.
Also refactor some existing unit tests to pass in option manager to unit tests.
@sudheeshkatkam , could you please take a quick look to see if it addresses your comment?
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68133140
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java ---
@@ -17,18 +17,16 @@
*/
package org.apache.drill.exec.physical.impl;
+import static org.apache.drill.exec.RunRootExec.c;
--- End diff --
unused?
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68133092
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -215,22 +218,47 @@ public JVar declareVectorValueSetupAndMember(DirectExpression batchName, TypedFi
return vv;
}
+ public enum BlkCreateMode {
+ TRUE, // Create new block
+ FALSE, // Do not create block; put into existing block.
+ TRUE_IF_BOUND // Create new block only if # of expressions added hit upper-bound (ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE)
+ }
+
public HoldingContainer addExpr(LogicalExpression ex) {
- return addExpr(ex, true);
+ // default behavior is always to put expression into new block.
+ return addExpr(ex, BlkCreateMode.TRUE);
}
- public HoldingContainer addExpr(LogicalExpression ex, boolean rotate) {
-// logger.debug("Adding next write {}", ex);
- if (rotate) {
- rotateBlock();
+ public HoldingContainer addExpr(LogicalExpression ex, BlkCreateMode mode) {
+ if (mode == BlkCreateMode.TRUE || mode == BlkCreateMode.TRUE_IF_BOUND) {
+ rotateBlock(mode);
}
+
+ for (LinkedList<SizedJBlock> b : blocks) {
+ b.getLast().incCounter();
+ }
+
return evaluationVisitor.addExpr(ex, this);
}
public void rotateBlock() {
- evaluationVisitor.previousExpressions.clear();
- for (LinkedList<JBlock> b : blocks) {
- b.add(new JBlock(true, true));
+ // default behavior is always to create new block.
+ rotateBlock(BlkCreateMode.TRUE);
+ }
+
+ private void rotateBlock(BlkCreateMode mode) {
+ boolean blockRotated = false;
+ for (LinkedList<SizedJBlock> b : blocks) {
+ if (mode == BlkCreateMode.TRUE ||
+ (mode == BlkCreateMode.TRUE_IF_BOUND &&
+ optionManager != null &&
+ b.getLast().getCount() > optionManager.getOption(ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE).num_val)) {
--- End diff --
Drop `.num_val`. The OptionValidator is typed (LongValidator).
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68147991
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -215,22 +218,47 @@ public JVar declareVectorValueSetupAndMember(DirectExpression batchName, TypedFi
return vv;
}
+ public enum BlkCreateMode {
+ TRUE, // Create new block
+ FALSE, // Do not create block; put into existing block.
+ TRUE_IF_BOUND // Create new block only if # of expressions added hit upper-bound (ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE)
+ }
+
public HoldingContainer addExpr(LogicalExpression ex) {
- return addExpr(ex, true);
+ // default behavior is always to put expression into new block.
+ return addExpr(ex, BlkCreateMode.TRUE);
}
- public HoldingContainer addExpr(LogicalExpression ex, boolean rotate) {
-// logger.debug("Adding next write {}", ex);
- if (rotate) {
- rotateBlock();
+ public HoldingContainer addExpr(LogicalExpression ex, BlkCreateMode mode) {
+ if (mode == BlkCreateMode.TRUE || mode == BlkCreateMode.TRUE_IF_BOUND) {
+ rotateBlock(mode);
}
+
+ for (LinkedList<SizedJBlock> b : blocks) {
+ b.getLast().incCounter();
+ }
+
return evaluationVisitor.addExpr(ex, this);
}
public void rotateBlock() {
- evaluationVisitor.previousExpressions.clear();
- for (LinkedList<JBlock> b : blocks) {
- b.add(new JBlock(true, true));
+ // default behavior is always to create new block.
+ rotateBlock(BlkCreateMode.TRUE);
+ }
+
+ private void rotateBlock(BlkCreateMode mode) {
+ boolean blockRotated = false;
+ for (LinkedList<SizedJBlock> b : blocks) {
+ if (mode == BlkCreateMode.TRUE ||
+ (mode == BlkCreateMode.TRUE_IF_BOUND &&
+ optionManager != null &&
+ b.getLast().getCount() > optionManager.getOption(ExecConstants.CODE_GEN_EXP_IN_METHOD_SIZE).num_val)) {
--- End diff --
Done.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68148055
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java ---
@@ -17,17 +17,54 @@
*/
package org.apache.drill.exec;
+import com.codahale.metrics.MetricRegistry;
+import mockit.NonStrictExpectations;
+import org.apache.drill.common.config.DrillConfig;
+import org.apache.drill.common.scanner.ClassPathScanner;
+import org.apache.drill.exec.compile.CodeCompilerTestFactory;
+import org.apache.drill.exec.exception.StoreException;
+import org.apache.drill.exec.memory.RootAllocatorFactory;
import org.apache.drill.exec.metrics.DrillMetrics;
+import org.apache.drill.exec.physical.impl.OperatorCreatorRegistry;
+import org.apache.drill.exec.planner.PhysicalPlanReaderTestFactory;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.server.options.SystemOptionManager;
+import org.apache.drill.exec.store.sys.store.provider.LocalPersistentStoreProvider;
import org.apache.drill.test.DrillTest;
import org.junit.After;
+import org.junit.BeforeClass;
+
+import static org.apache.drill.exec.RunRootExec.c;
public class ExecTest extends DrillTest {
+ protected static SystemOptionManager optionManager;
+
@After
public void clear(){
// TODO: (Re DRILL-1735) Check whether still needed now that
// BootstrapContext.close() resets the metrics.
DrillMetrics.resetMetrics();
}
+
+ @BeforeClass
+ public static void setupOptionManager() throws Exception{
+ final LocalPersistentStoreProvider provider = new LocalPersistentStoreProvider(c);
+ provider.start();
+ optionManager = new SystemOptionManager(PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(c), provider);
+ optionManager.init();
+ }
+
+ protected void initDrillbitContext(final DrillbitContext bitContext) throws Exception {
--- End diff --
changed.
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r67442526
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -215,22 +219,47 @@ public JVar declareVectorValueSetupAndMember(DirectExpression batchName, TypedFi
return vv;
}
+ public enum RotateMode {
--- End diff --
The name 'RotateMode' seems a misnomer since there is no actual re-use or rotation of the JBlocks, right ? It is confusing. Should we call this BlockCreationMode ?
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r68133110
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java ---
@@ -186,4 +186,9 @@ public boolean isFunctionComplexOutput(String name) {
}
return false;
}
+
+ public OptionManager getOptionManager() {
--- End diff --
Unused?
---
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.
---
[GitHub] drill pull request #521: DRILL-4715: Fix java compilation error in run-time ...
Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/521#discussion_r67018273
--- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java ---
@@ -86,14 +88,16 @@ public static MappingSet getDefaultMapping() {
}
@SuppressWarnings("unchecked")
- ClassGenerator(CodeGenerator<T> codeGenerator, MappingSet mappingSet, SignatureHolder signature, EvaluationVisitor eval, JDefinedClass clazz, JCodeModel model) throws JClassAlreadyExistsException {
+ ClassGenerator(CodeGenerator<T> codeGenerator, MappingSet mappingSet, SignatureHolder signature, EvaluationVisitor eval, JDefinedClass clazz, JCodeModel model, OptionManager optionManager) throws JClassAlreadyExistsException {
this.codeGenerator = codeGenerator;
this.clazz = clazz;
this.mappings = mappingSet;
this.sig = signature;
this.evaluationVisitor = eval;
this.model = model;
- blocks = (LinkedList<JBlock>[]) new LinkedList[sig.size()];
+ this.optionManager = optionManager;
--- End diff --
Looks like the `optionManager` being passed down is system level. Make this explicit by renaming `optionManager` to `systemOptions`.
Users also need to be aware.
---
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.
---