You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by hm...@apache.org on 2019/04/03 17:35:24 UTC

[drill] branch master updated: DRILL-7146: Query failing with NPE when ZK queue is enabled.

This is an automated email from the ASF dual-hosted git repository.

hmaduri pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new d29a5b1  DRILL-7146: Query failing with NPE when ZK queue is enabled.
d29a5b1 is described below

commit d29a5b1749a77b863be3eac1423f4ecf6d244ebf
Author: HanumathRao <ha...@gmail.com>
AuthorDate: Mon Apr 1 14:23:27 2019 -0700

    DRILL-7146: Query failing with NPE when ZK queue is enabled.
---
 .../exec/planner/fragment/QueueQueryParallelizer.java     |  2 +-
 .../drill/exec/planner/rm/TestMemoryCalculator.java       | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/QueueQueryParallelizer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/QueueQueryParallelizer.java
index c986fca..5cd4a09 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/QueueQueryParallelizer.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/QueueQueryParallelizer.java
@@ -55,7 +55,7 @@ public class QueueQueryParallelizer extends SimpleParallelizer {
   // return the memory computed for a physical operator on a drillbitendpoint.
   public BiFunction<DrillbitEndpoint, PhysicalOperator, Long> getMemory() {
     return (endpoint, operator) -> {
-      if (planHasMemory) {
+      if (!planHasMemory) {
         return operators.get(endpoint).get(operator);
       }
       else {
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/planner/rm/TestMemoryCalculator.java b/exec/java-exec/src/test/java/org/apache/drill/exec/planner/rm/TestMemoryCalculator.java
index 4893a36..891b4a6 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/planner/rm/TestMemoryCalculator.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/planner/rm/TestMemoryCalculator.java
@@ -34,6 +34,7 @@ import org.apache.drill.exec.proto.UserBitShared;
 import org.apache.drill.exec.proto.UserProtos;
 import org.apache.drill.exec.rpc.user.UserSession;
 import org.apache.drill.exec.server.DrillbitContext;
+import org.apache.drill.exec.work.foreman.rm.EmbeddedQueryQueue;
 import org.apache.drill.shaded.guava.com.google.common.collect.Iterables;
 import org.apache.drill.test.ClientFixture;
 import org.apache.drill.test.ClusterFixture;
@@ -224,4 +225,18 @@ public class TestMemoryCalculator extends PlanTestBase {
     parallelizer.adjustMemory(planningSet, createSet(planningSet.getRootWrapper()), activeEndpoints);
     assertTrue("memory requirement is different", Iterables.all(resources.entrySet(), (e) -> e.getValue().getMemory() == 481490));
   }
+
+  @Test
+  public void TestZKBasedQueue() throws Exception {
+    String sql = "select * from cp.`employee.json`";
+    ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(EmbeddedQueryQueue.ENABLED, true);
+
+    try (ClusterFixture cluster = builder.build();
+         ClientFixture client = cluster.clientFixture()) {
+      client
+        .queryBuilder()
+        .sql(sql)
+        .run();
+    }
+  }
 }