You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/10/15 19:26:01 UTC

[GitHub] amansinha100 closed pull request #1498: DRILL-6775: The schema for empty output is not shown in Drill Web UI

amansinha100 closed pull request #1498: DRILL-6775: The schema for empty output is not shown in Drill Web UI
URL: https://github.com/apache/drill/pull/1498
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
index 42427aa4cbb..4e0985852c2 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
@@ -19,7 +19,6 @@
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.drill.shaded.guava.com.google.common.collect.Maps;
 
 import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.common.exceptions.UserRemoteException;
@@ -115,10 +114,6 @@ public QueryResult run(final WorkManager workManager, final WebUserConnection we
       throw new UserRemoteException(webUserConnection.getError());
     }
 
-    if (webUserConnection.results.isEmpty()) {
-      webUserConnection.results.add(Maps.<String, String>newHashMap());
-    }
-
     // Return the QueryResult.
     return new QueryResult(queryId, webUserConnection.columns, webUserConnection.results);
   }
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java
index df4c8a5b1b6..9d6e7e41f42 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java
@@ -75,20 +75,20 @@ public UserSession getSession() {
 
   @Override
   public void sendData(RpcOutcomeListener<Ack> listener, QueryWritableBatch result) {
-    // Check if there is any data or not. There can be overflow here but DrillBuf doesn't support allocating with
+    // There can be overflow here but DrillBuf doesn't support allocating with
     // bytes in long. Hence we are just preserving the earlier behavior and logging debug log for the case.
     final int dataByteCount = (int) result.getByteCount();
 
-    if (dataByteCount <= 0) {
+    if (dataByteCount < 0) {
       if (logger.isDebugEnabled()) {
-        logger.debug("Either no data received in this batch or there is BufferOverflow in dataByteCount: {}",
+        logger.debug("There is BufferOverflow in dataByteCount: {}",
             dataByteCount);
       }
       listener.success(Acks.OK, null);
       return;
     }
 
-    // If here that means there is some data for sure. Create a ByteBuf with all the data in it.
+    // Create a ByteBuf with all the data in it.
     final int rows = result.getHeader().getRowCount();
     final BufferAllocator allocator = webSessionResources.getAllocator();
     final DrillBuf bufferWithData = allocator.buffer(dataByteCount);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services