Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F89D19341 for ; Wed, 9 Mar 2016 22:01:41 +0000 (UTC) Received: (qmail 16196 invoked by uid 500); 9 Mar 2016 22:01:41 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 16151 invoked by uid 500); 9 Mar 2016 22:01:41 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 16037 invoked by uid 99); 9 Mar 2016 22:01:41 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2016 22:01:41 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1306D2C1F60 for ; Wed, 9 Mar 2016 22:01:41 +0000 (UTC) Date: Wed, 9 Mar 2016 22:01:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-4476) Enhance Union-All operator for dealing with empty left input or empty both inputs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15188136#comment-15188136 ] ASF GitHub Bot commented on DRILL-4476: --------------------------------------- Github user hsuanyi commented on a diff in the pull request: https://github.com/apache/drill/pull/407#discussion_r55597867 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java --- @@ -294,13 +313,41 @@ public UnionAllInput(UnionAllRecordBatch unionAllRecordBatch, RecordBatch left, rightSide = new OneSideInput(right); } + private boolean isBothSideEmpty() { + return leftIsFinish && rightIsFinish; + } + public IterOutcome nextBatch() throws SchemaChangeException { if(upstream == RecordBatch.IterOutcome.NOT_YET) { IterOutcome iterLeft = leftSide.nextBatch(); switch(iterLeft) { case OK_NEW_SCHEMA: - break; + whileLoop: + while(leftSide.getRecordBatch().getRecordCount() == 0) { + iterLeft = leftSide.nextBatch(); + + switch(iterLeft) { + case STOP: + case OUT_OF_MEMORY: + return iterLeft; + + case NONE: --- End diff -- The while is for the case where the first few batches are empty and then union-all receive NONE. So we need to replicate this logic to right side too. > Enhance Union-All operator for dealing with empty left input or empty both inputs > --------------------------------------------------------------------------------- > > Key: DRILL-4476 > URL: https://issues.apache.org/jira/browse/DRILL-4476 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Relational Operators > Reporter: Sean Hsuan-Yi Chu > Assignee: Sean Hsuan-Yi Chu > > Union-All operator does not deal with the situation where left side comes from empty source. > Due to DRILL-2288's enhancement for empty sources, Union-All operator now can be allowed to support this scenario. -- This message was sent by Atlassian JIRA (v6.3.4#6332)