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 5BE54200D0B for ; Wed, 13 Sep 2017 01:47:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5A4A01609C8; Tue, 12 Sep 2017 23:47:27 +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 983041609B4 for ; Wed, 13 Sep 2017 01:47:26 +0200 (CEST) Received: (qmail 14483 invoked by uid 500); 12 Sep 2017 23:47:25 -0000 Mailing-List: contact dev-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 dev@drill.apache.org Received: (qmail 14469 invoked by uid 99); 12 Sep 2017 23:47:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 23:47:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D25CBF57AA; Tue, 12 Sep 2017 23:47:24 +0000 (UTC) From: Ben-Zvi To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #938: DRILL-5694: Handle HashAgg OOM by spill and retry, ... Content-Type: text/plain Message-Id: <20170912234724.D25CBF57AA@git1-us-west.apache.org> Date: Tue, 12 Sep 2017 23:47:24 +0000 (UTC) archived-at: Tue, 12 Sep 2017 23:47:27 -0000 Github user Ben-Zvi commented on a diff in the pull request: https://github.com/apache/drill/pull/938#discussion_r138494777 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggTemplate.java --- @@ -1178,20 +1273,38 @@ private void checkGroupAndAggrValues(int incomingRowIdx) { hashCode >>>= bitsInMask; HashTable.PutStatus putStatus = null; long allocatedBeforeHTput = allocator.getAllocatedMemory(); - // ========================================== // Insert the key columns into the hash table // ========================================== + boolean noReserveMem = reserveValueBatchMemory == 0; try { + if ( noReserveMem && canSpill ) { throw new RetryAfterSpillException();} // proactive spill, skip put() + putStatus = htables[currentPartition].put(incomingRowIdx, htIdxHolder, hashCode); + + } catch (RetryAfterSpillException re) { --- End diff -- Done. ---