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 4663918C21 for ; Tue, 25 Aug 2015 21:54:46 +0000 (UTC) Received: (qmail 97443 invoked by uid 500); 25 Aug 2015 21:54:46 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 97381 invoked by uid 500); 25 Aug 2015 21:54:46 -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 97292 invoked by uid 99); 25 Aug 2015 21:54:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2015 21:54:46 +0000 Date: Tue, 25 Aug 2015 21:54:46 +0000 (UTC) From: "Mehant Baid (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-3702) PartitionPruning hit ClassCastException in Interpreter when the pruning filter expression is of non-nullable type. 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-3702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14712046#comment-14712046 ] Mehant Baid commented on DRILL-3702: ------------------------------------ +1 > PartitionPruning hit ClassCastException in Interpreter when the pruning filter expression is of non-nullable type. > ------------------------------------------------------------------------------------------------------------------ > > Key: DRILL-3702 > URL: https://issues.apache.org/jira/browse/DRILL-3702 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Reporter: Jinfeng Ni > Assignee: Mehant Baid > Fix For: 1.2.0 > > Attachments: 0001-DRILL-3702-Fix-partition-pruning-rule-when-the-pruni.patch > > > I have the following parquet table, created using partition by clause: > {code} > create table mypart (id, name) partition by (id) as select cast(n_regionkey as varchar(20)), n_name from cp.`tpch/nation.parquet`; > {code} > The generated parquet table consists of 5 files, each representing a partition: > {code} > 0_0_1.parquet 0_0_2.parquet 0_0_3.parquet 0_0_4.parquet 0_0_5.parquet > {code} > For the following query, partition pruning works as expected: > {code} > select id, name from mypart where id = '0' ; > 00-01 Project(id=[$1], name=[$0]) > 00-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tmp/mypart/0_0_1.parquet]], selectionRoot=file:/tmp/mypart, numFiles=1, columns=[`id`, `name`]]]) > "selectionRoot" : "file:/tmp/mypart", > "fileSet" : [ "/tmp/mypart/0_0_1.parquet" ], > "cost" : 5.0 > {code} > However, the following query would hit ClassCastException when PruneScanRule calls interpreter to evaluate the filtering condition, which happens to be non-nullable. > {code} > select id, name from mypart where concat(id,'') = '0' ; > 00-05 Project(id=[$1], name=[$0]) > 00-06 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=file:/tmp/mypart]], selectionRoot=file:/tmp/mypart, numFiles=1, columns=[`id`, `name`]]]) > "selectionRoot" : "file:/tmp/mypart", > "fileSet" : [ "/tmp/mypart/0_0_1.parquet", "/tmp/mypart/0_0_4.parquet", "/tmp/mypart/0_0_5.parquet", "/tmp/mypart/0_0_2.parquet", "/tmp/mypart/0_0_3.parquet" ], > "cost" : 25.0 > }, > {code} > Here is the error for the ClassCastException, raised in Interpreter: > {code} > java.lang.ClassCastException: org.apache.drill.exec.expr.holders.BitHolder cannot be cast to org.apache.drill.exec.expr.holders.NullableBitHolder > {code} > The cause of the problem is that PruneScanRule assumes the output type of a filter condition is NullableBit, while in this case the filter condition is Bit type, which leads to ClassCastException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)