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 43D681878E for ; Mon, 7 Mar 2016 06:33:41 +0000 (UTC) Received: (qmail 7838 invoked by uid 500); 7 Mar 2016 06:33:40 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 7808 invoked by uid 500); 7 Mar 2016 06:33:40 -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 7798 invoked by uid 99); 7 Mar 2016 06:33:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Mar 2016 06:33:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AAD9E2C0453 for ; Mon, 7 Mar 2016 06:33:40 +0000 (UTC) Date: Mon, 7 Mar 2016 06:33:40 +0000 (UTC) From: "Deneche A. Hakim (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-4443) MIN/MAX on VARCHAR throw a NullPointerException 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:all-tabpanel ] Deneche A. Hakim updated DRILL-4443: ------------------------------------ Description: Using a simple csv file that contains at least 2 groups of rows: {noformat} a, a, a, b, {noformat} Running a query with min/max throws a NullPointerException: {noformat} SELECT MIN(columns[1]) FROM `test4443.csv` GROUP BY columns[0]; Error: SYSTEM ERROR: NullPointerException ... {noformat} {noformat} SELECT MAX(columns[1]) FROM `test4443.csv` GROUP BY columns[0]; Error: SYSTEM ERROR: NullPointerException ... {noformat} The problem is caused by {{VarCharAggrFunctions.java}} that is not reseting it's internal buffer properly. was: Using a simple csv file that contains at least 2 groups of rows: {noformat} {noformat} 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} > MIN/MAX on VARCHAR throw a NullPointerException > ----------------------------------------------- > > 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 > Fix For: 1.6.0 > > Attachments: DRILL_4443.parquet, test4443.csv > > > Using a simple csv file that contains at least 2 groups of rows: > {noformat} > a, > a, > a, > b, > {noformat} > Running a query with min/max throws a NullPointerException: > {noformat} > SELECT MIN(columns[1]) FROM `test4443.csv` GROUP BY columns[0]; > Error: SYSTEM ERROR: NullPointerException > ... > {noformat} > {noformat} > SELECT MAX(columns[1]) FROM `test4443.csv` GROUP BY columns[0]; > Error: SYSTEM ERROR: NullPointerException > ... > {noformat} > The problem is caused by {{VarCharAggrFunctions.java}} that is not reseting it's internal buffer properly. -- This message was sent by Atlassian JIRA (v6.3.4#6332)