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 70A0118FBE for ; Fri, 26 Feb 2016 17:54:18 +0000 (UTC) Received: (qmail 98760 invoked by uid 500); 26 Feb 2016 17:54:18 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 98724 invoked by uid 500); 26 Feb 2016 17:54:18 -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 98712 invoked by uid 99); 26 Feb 2016 17:54:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2016 17:54:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 33AA72C033A for ; Fri, 26 Feb 2016 17:54:18 +0000 (UTC) Date: Fri, 26 Feb 2016 17:54:18 +0000 (UTC) From: "Deneche A. Hakim (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-4443) Query with frame clause RANGE BETWEEN CURRENT ROW AND CURRENT ROW returns NPE 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-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169413#comment-15169413 ] Deneche A. Hakim commented on DRILL-4443: ----------------------------------------- I found the source of the problem. In VarCharAggrFunctions.java I see the following (edited for the sake of this post): {noformat} setup() { ... value = new ObjectHolder(); value.obj = new DrillByteArray() } add() { ... // accesses value.obj.getLength() } reset() { ... value = new ObjectHolder() // we don't set value.obj } {noformat} The code expects setup() to be called whenever we call reset() otherwise we hit a NullPointerException when we call add(). Fixing this method resolves the issue, I sent an email to the dev list to confirm if this is the expected behavior or if the fix should go in the Window operator instead > Query with frame clause RANGE BETWEEN CURRENT ROW AND CURRENT ROW returns NPE > ----------------------------------------------------------------------------- > > Key: DRILL-4443 > URL: https://issues.apache.org/jira/browse/DRILL-4443 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Flow > Affects Versions: 1.6.0 > Environment: 4 node cluster CentOS > Reporter: Khurram Faraaz > Assignee: Deneche A. Hakim > Priority: Critical > Labels: window_function > Fix For: 1.6.0 > > Attachments: DRILL_4443.parquet, test4443.csv > > > Window function query with frame clause RANGE BETWEEN CURRENT ROW AND CURRENT ROW returns NPE. > Drill 1.6.0 commit ID: 6d5f4983 > {noformat} > 0: jdbc:drill:schema=dfs.tmp> SELECT MIN(c4) OVER(PARTITION BY c8 ORDER BY c4 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM dfs.tmp.`t_alltype`; > Error: SYSTEM ERROR: NullPointerException > Fragment 0:0 > [Error Id: 711144c3-8d9e-4d33-bd9e-fc39c021fee4 on centos-03.qa.lab:31010] (state=,code=0) > {noformat} > Stack trace from drillbit.log > {noformat} > 2016-02-26 09:20:22,785 [292fe729-0233-87ae-b941-0b2eeff8aeda:frag:0:0] ERROR o.a.d.e.w.fragment.FragmentExecutor - SYSTEM ERROR: NullPointerException > Fragment 0:0 > [Error Id: 711144c3-8d9e-4d33-bd9e-fc39c021fee4 on centos-03.qa.lab:31010] > org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: NullPointerException > Fragment 0:0 > [Error Id: 711144c3-8d9e-4d33-bd9e-fc39c021fee4 on centos-03.qa.lab:31010] > at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543) ~[drill-common-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.work.fragment.FragmentExecutor.sendFinalState(FragmentExecutor.java:318) [drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.work.fragment.FragmentExecutor.cleanup(FragmentExecutor.java:185) [drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:287) [drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65] > Caused by: java.lang.NullPointerException: null > at org.apache.drill.exec.test.generated.WindowFramerGen256.evaluatePeer(FrameSupportTemplate.java:353) ~[na:na] > at org.apache.drill.exec.test.generated.WindowFramerGen256.aggregatePeers(FrameSupportTemplate.java:275) ~[na:na] > at org.apache.drill.exec.test.generated.WindowFramerGen256.processRANGE(FrameSupportTemplate.java:184) ~[na:na] > at org.apache.drill.exec.test.generated.WindowFramerGen256.processPartition(FrameSupportTemplate.java:152) ~[na:na] > at org.apache.drill.exec.test.generated.WindowFramerGen256.doWork(FrameSupportTemplate.java:113) ~[na:na] > at org.apache.drill.exec.physical.impl.window.WindowFrameRecordBatch.doWork(WindowFrameRecordBatch.java:173) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.window.WindowFrameRecordBatch.innerNext(WindowFrameRecordBatch.java:146) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:119) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:109) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:129) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:119) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:109) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:129) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:104) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:81) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:94) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:257) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:251) ~[drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_65] > at javax.security.auth.Subject.doAs(Subject.java:422) ~[na:1.8.0_65] > at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1595) ~[hadoop-common-2.7.0-mapr-1506.jar:na] > at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:251) [drill-java-exec-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] > ... 4 common frames omitted > {noformat} > Without the frame clause in window definition the query returns empty strings as results > {noformat} > 0: jdbc:drill:schema=dfs.tmp> SELECT MIN(c4) OVER(PARTITION BY c8 ORDER BY c4) FROM dfs.tmp.`t_alltype`; > +---------+ > | EXPR$0 | > +---------+ > | | > | | > | | > | | > | | > | | > ... > | | > | | > | | > | | > +--------+ > 145 rows selected (0.743 seconds) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)