This is an automated email from the ASF dual-hosted git repository. amansinha pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill.git
commit ec6acc7ab6ee1a6eb326a4783189978bf55c0bcf Author: Anton Gozhiy <[email protected]> AuthorDate: Tue Oct 9 15:59:16 2018 +0300 DRILL-6775: The schema for empty output is not shown in Drill Web UI Removed an excess check for the result emptiness that prevented retrieval of the column names. close apache/drill#1498 --- .../main/java/org/apache/drill/exec/server/rest/QueryWrapper.java | 5 ----- .../java/org/apache/drill/exec/server/rest/WebUserConnection.java | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) 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 42427aa..4e09858 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 @@ package org.apache.drill.exec.server.rest; 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 class QueryWrapper { 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 df4c8a5..9d6e7e4 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 class WebUserConnection extends AbstractDisposableUserClientConnection im @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);
