Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9A4F184C7 for ; Mon, 24 Aug 2015 22:43:28 +0000 (UTC) Received: (qmail 91838 invoked by uid 500); 24 Aug 2015 22:43:28 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 91805 invoked by uid 500); 24 Aug 2015 22:43:28 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 91794 invoked by uid 99); 24 Aug 2015 22:43:28 -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; Mon, 24 Aug 2015 22:43:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 70660E10B1; Mon, 24 Aug 2015 22:43:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: amansinha@apache.org To: commits@drill.apache.org Date: Mon, 24 Aug 2015 22:43:28 -0000 Message-Id: <5d85735befa14cb89f34c7ff665376cf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] drill git commit: DRILL-3654: FIRST_VALUE(/) returns IOB Exception Repository: drill Updated Branches: refs/heads/master c5f1bbbb1 -> 18ce02166 DRILL-3654: FIRST_VALUE(/) returns IOB Exception Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a29129cd Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a29129cd Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a29129cd Branch: refs/heads/master Commit: a29129cd26f034bd22ddbcfd9445eeb493e7e78a Parents: c5f1bbb Author: adeneche Authored: Mon Aug 17 14:23:55 2015 -0700 Committer: Aman Sinha Committed: Mon Aug 24 13:52:44 2015 -0700 ---------------------------------------------------------------------- .../drill/exec/physical/impl/window/DefaultFrameTemplate.java | 4 ++-- .../apache/drill/exec/physical/impl/window/TestWindowFrame.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/a29129cd/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java index 83e3754..b56e421 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java @@ -95,6 +95,8 @@ public abstract class DefaultFrameTemplate implements WindowFramer { final WindowDataBatch current = batches.get(0); + setupCopyFirstValue(current, internal); + // we need to store the record count explicitly, because we release current batch at the end of this call outputCount = current.getRecordCount(); @@ -136,14 +138,12 @@ public abstract class DefaultFrameTemplate implements WindowFramer { final long length = computePartitionSize(currentRow); partition = new Partition(length); setupPartition(current, container); - setupCopyFirstValue(current, internal); copyFirstValueToInternal(currentRow); } private void cleanPartition() { partition = null; resetValues(); - internal.zeroVectors(); lagCopiedToInternal = false; } http://git-wip-us.apache.org/repos/asf/drill/blob/a29129cd/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/window/TestWindowFrame.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/window/TestWindowFrame.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/window/TestWindowFrame.java index d76420f..1fd39b9 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/window/TestWindowFrame.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/window/TestWindowFrame.java @@ -277,6 +277,11 @@ public class TestWindowFrame extends BaseTestQuery { } @Test + public void test3654Fix() throws Exception { + test("SELECT FIRST_VALUE(col8) OVER(PARTITION BY col7 ORDER BY col8) FROM dfs_test.`%s/window/3648.parquet`", TEST_RES_PATH); + } + + @Test public void testPartitionNtile() { Partition partition = new Partition(12);