[ https://issues.apache.org/jira/browse/DRILL-6348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16455583#comment-16455583 ]
ASF GitHub Bot commented on DRILL-6348: --------------------------------------- Github user vrozov commented on a diff in the pull request: https://github.com/apache/drill/pull/1237#discussion_r184559236 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unorderedreceiver/UnorderedReceiverBatch.java --- @@ -149,25 +149,32 @@ private RawFragmentBatch getNextBatch() throws IOException { } } + private RawFragmentBatch getNextNotEmptyBatch() throws IOException { + RawFragmentBatch batch; + try { + stats.startWait(); + batch = getNextBatch(); + + // skip over empty batches. we do this since these are basically control messages. + while (batch != null && batch.getHeader().getDef().getRecordCount() == 0 + && (!first || batch.getHeader().getDef().getFieldCount() == 0)) { + batch = getNextBatch(); + } + } finally { + stats.stopWait(); + } + return batch; + } + @Override public IterOutcome next() { batchLoader.resetRecordCount(); stats.startProcessing(); - try{ - RawFragmentBatch batch; - try { - stats.startWait(); - batch = getNextBatch(); - // skip over empty batches. we do this since these are basically control messages. - while (batch != null && batch.getHeader().getDef().getRecordCount() == 0 - && (!first || batch.getHeader().getDef().getFieldCount() == 0)) { - batch = getNextBatch(); - } - } finally { - stats.stopWait(); - } + RawFragmentBatch batch = null; + try { + batch = getNextNotEmptyBatch(); first = false; if (batch == null) { --- End diff -- I think that `batchLoader.clear()` is not required as it is part of `close()`. Consider changing the return to a ternary operator. > Unordered Receiver does not report its memory usage > --------------------------------------------------- > > Key: DRILL-6348 > URL: https://issues.apache.org/jira/browse/DRILL-6348 > Project: Apache Drill > Issue Type: Task > Components: Execution - Flow > Reporter: salim achouche > Assignee: salim achouche > Priority: Major > Fix For: 1.14.0 > > > The Drill Profile functionality doesn't show any memory usage for the > Unordered Receiver operator. This is problematic when analyzing OOM > conditions since we cannot account for all of a query memory usage. This Jira > is to fix memory reporting for the Unordered Receiver operator. -- This message was sent by Atlassian JIRA (v7.6.3#76005)