Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0AE56200D26 for ; Thu, 5 Oct 2017 22:39:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09F581609D2; Thu, 5 Oct 2017 20:39:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 504731609E2 for ; Thu, 5 Oct 2017 22:39:05 +0200 (CEST) Received: (qmail 41685 invoked by uid 500); 5 Oct 2017 20:39:04 -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 41623 invoked by uid 99); 5 Oct 2017 20:39:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Oct 2017 20:39:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9B42218140C for ; Thu, 5 Oct 2017 20:39:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 1zrYMGrNNuBq for ; Thu, 5 Oct 2017 20:39:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1C0465FDF6 for ; Thu, 5 Oct 2017 20:39:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 59AF1E0FA2 for ; Thu, 5 Oct 2017 20:39:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A807024354 for ; Thu, 5 Oct 2017 20:39:00 +0000 (UTC) Date: Thu, 5 Oct 2017 20:39:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5839) Handle Empty Batches in Merge Receiver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Oct 2017 20:39:06 -0000 [ https://issues.apache.org/jira/browse/DRILL-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16193607#comment-16193607 ] ASF GitHub Bot commented on DRILL-5839: --------------------------------------- Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/974#discussion_r143049947 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/mock/MockRecordReader.java --- @@ -52,7 +52,7 @@ public MockRecordReader(FragmentContext context, MockScanEntry config) { private int getEstimatedRecordSize(MockColumn[] types) { int x = 0; - for (int i = 0; i < types.length; i++) { + for (int i = 0; i < (types == null ? 0 : types.length); i++) { --- End diff -- Nit: maybe use: ``` if (types == null) { return 0; } // Original code here.. ``` > Handle Empty Batches in Merge Receiver > -------------------------------------- > > Key: DRILL-5839 > URL: https://issues.apache.org/jira/browse/DRILL-5839 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Flow > Affects Versions: 1.11.0 > Reporter: Padma Penumarthy > Assignee: Padma Penumarthy > Fix For: 1.12.0 > > > merge receiver throws an exception when it receives first batch as empty batch (no rows and no schema) from any of the senders. Problem is that the operator expects at least one batch with schema (0 rows is ok, 0 columns is not) from each of its senders. > The way algorithm works is as follows: > Get the first batch from each of the senders. > Create hyper vector container with this first batch from each of the senders. > Add the batches from senders to the priority queue > Pop from priority queue, get the index for the current batch from that sender, > and use that to copy from the hyper vector to the outgoing vector > When the end of batch from a sender is reached, load the next batch from the sender. > Stop when there are no more batches from any of the senders. > If any of the senders do not send first batch with schema and if we skip adding that batch to the hyper vector, hyper vector is not setup correctly and all the offsets from selection vector to individual batches from senders with in the hyper vector are messed up. > Fix for this problem is when we receive empty batch from any of the senders, create dummy batch with schema from one of the other senders and add it to the hyper vector. > If all senders send empty first batches, we just return NONE to downstream operator. -- This message was sent by Atlassian JIRA (v6.4.14#64029)