[ https://issues.apache.org/jira/browse/DRILL-6775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650667#comment-16650667 ]
ASF GitHub Bot commented on DRILL-6775: --------------------------------------- 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: us...@infra.apache.org > The schema for empty output is not shown in Drill Web UI > -------------------------------------------------------- > > Key: DRILL-6775 > URL: https://issues.apache.org/jira/browse/DRILL-6775 > Project: Apache Drill > Issue Type: Bug > Components: Client - HTTP, Web Server > Affects Versions: 1.14.0 > Reporter: Vitalii Diravka > Assignee: Anton Gozhiy > Priority: Minor > Labels: ready-to-commit > Fix For: 1.15.0 > > Attachments: image-2018-10-05-16-16-45-389.png > > > The query in SqlLine: > {code} > 0: jdbc:drill:zk=local> SELECT employee_id, full_name, first_name, last_name > FROM cp.`employee.json` LIMIT 0; > +--------------+------------+-------------+------------+ > | employee_id | full_name | first_name | last_name | > +--------------+------------+-------------+------------+ > +--------------+------------+-------------+------------+ > No rows selected (0.118 seconds) > {code} > But the same in Drill UI shows nothing, see the attachment. > !image-2018-10-05-16-16-45-389.png! -- This message was sent by Atlassian JIRA (v7.6.3#76005)