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 453A6200CBB for ; Tue, 20 Jun 2017 02:50:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 43C93160BF1; Tue, 20 Jun 2017 00:50:07 +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 8B12D160BE1 for ; Tue, 20 Jun 2017 02:50:06 +0200 (CEST) Received: (qmail 46903 invoked by uid 500); 20 Jun 2017 00:50:05 -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 46893 invoked by uid 99); 20 Jun 2017 00:50:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2017 00:50:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 45D121B0BA7 for ; Tue, 20 Jun 2017 00:50:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id q69nxB5b7lUX for ; Tue, 20 Jun 2017 00:50:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7D62960CFC for ; Tue, 20 Jun 2017 00:50:01 +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 C334AE0D57 for ; Tue, 20 Jun 2017 00:50:00 +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 2724B24003 for ; Tue, 20 Jun 2017 00:50:00 +0000 (UTC) Date: Tue, 20 Jun 2017 00:50:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5457) Support Spill to Disk for the Hash Aggregate Operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 20 Jun 2017 00:50:07 -0000 [ https://issues.apache.org/jira/browse/DRILL-5457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055009#comment-16055009 ] ASF GitHub Bot commented on DRILL-5457: --------------------------------------- Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/822#discussion_r122858748 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggBatch.java --- @@ -149,14 +149,24 @@ public IterOutcome innerNext() { if ( aggOut == HashAggregator.AggIterOutcome.AGG_OK ) { return IterOutcome.OK; } // if RESTART - continue below with doWork() - read some spilled partition, just like reading incoming incoming = aggregator.getNewIncoming(); // Restart - incoming was just changed - if ( wasKilled ) { // if kill() was called before, then finish up - aggregator.cleanup(); - incoming.kill(false); - return IterOutcome.NONE; - } } - AggOutcome out = aggregator.doWork(); + if ( wasKilled ) { // if kill() was called before, then finish up + aggregator.cleanup(); + incoming.kill(false); + return IterOutcome.NONE; + } + + // Read and aggregate records + // ( may need to run again if the spilled partition that was read + // generated new partitions that were all spilled ) + AggOutcome out = AggOutcome.CALL_WORK_AGAIN; + while ( out == AggOutcome.CALL_WORK_AGAIN) { + // + // Read incoming batches and process their records + // + out = aggregator.doWork(); + } --- End diff -- Scratch that, I see you need the value of "out". So: ``` AggOutcome out; do { // // Read incoming batches and process their records // out = aggregator.doWork(); } while (out == AggOutcome.CALL_WORK_AGAIN) { ``` Or Even: ``` // Read incoming batches and process their records AggOutcome out; while ((out = aggregator.doWork()) == AggOutcome.CALL_WORK_AGAIN) { // Nothing to do } ``` > Support Spill to Disk for the Hash Aggregate Operator > ----------------------------------------------------- > > Key: DRILL-5457 > URL: https://issues.apache.org/jira/browse/DRILL-5457 > Project: Apache Drill > Issue Type: Improvement > Components: Execution - Relational Operators > Affects Versions: 1.10.0 > Reporter: Boaz Ben-Zvi > Assignee: Boaz Ben-Zvi > Fix For: 1.11.0 > > > Support gradual spilling memory to disk as the available memory gets too small to allow in memory work for the Hash Aggregate Operator. -- This message was sent by Atlassian JIRA (v6.4.14#64029)