Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E1ED185C1 for ; Mon, 6 Jul 2015 20:20:06 +0000 (UTC) Received: (qmail 55977 invoked by uid 500); 6 Jul 2015 20:20:06 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 55931 invoked by uid 500); 6 Jul 2015 20:20:06 -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 55708 invoked by uid 99); 6 Jul 2015 20:20:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 20:20:06 +0000 Date: Mon, 6 Jul 2015 20:20:06 +0000 (UTC) From: "Mehant Baid (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DRILL-3056) Numeric literal in an IN list is casted to decimal even when decimal type is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-3056?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Mehant Baid resolved DRILL-3056. -------------------------------- Resolution: Fixed Even though the record type indicates Decimal type when the IN list is conv= erted we still use double data type. > Numeric literal in an IN list is casted to decimal even when decimal type= is disabled > -------------------------------------------------------------------------= ------------ > > Key: DRILL-3056 > URL: https://issues.apache.org/jira/browse/DRILL-3056 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 1.0.0 > Reporter: Victoria Markman > Assignee: Mehant Baid > Fix For: 1.2.0 > > > {code} > 0: jdbc:drill:schema=3Ddfs> select * from sys.options where name like '%d= ecimal%'; > +------------+------------+------------+------------+------------+-------= -----+------------+------------+ > | name | kind | type | status | num_val | string= _val | bool_val | float_val | > +------------+------------+------------+------------+------------+-------= -----+------------+------------+ > | planner.enable_decimal_data_type | BOOLEAN | SYSTEM | DEFAULT = | null | null | false | null | > +------------+------------+------------+------------+------------+-------= -----+------------+------------+ > 1 row selected (0.212 seconds) > {code} > In list that contains more than 20 numeric literals. > We are casting number with the decimal point to decimal type even though = decimal type is disabled: > {code} > 0: jdbc:drill:schema=3Ddfs> explain plan including all attributes for sel= ect * from t1 where a1 in (1,2,3,4,5,6,7,8,9,0,10,11,12,13,14,15,16,17,18,1= 9,20,21,22,23,24,25.0); > +------------+------------+ > | text | json | > +------------+------------+ > | 00-00 Screen : rowType =3D RecordType(ANY *): rowcount =3D 10.0, cum= ulative cost =3D {24.0 rows, 158.0 cpu, 0.0 io, 0.0 network, 35.2 memory}, = id =3D 4921 > 00-01 Project(*=3D[$0]) : rowType =3D RecordType(ANY *): rowcount = =3D 10.0, cumulative cost =3D {23.0 rows, 157.0 cpu, 0.0 io, 0.0 network, 3= 5.2 memory}, id =3D 4920 > 00-02 Project(T7=C2=A6=C2=A6*=3D[$0]) : rowType =3D RecordType(ANY= T7=C2=A6=C2=A6*): rowcount =3D 10.0, cumulative cost =3D {23.0 rows, 157.0= cpu, 0.0 io, 0.0 network, 35.2 memory}, id =3D 4919 > 00-03 HashJoin(condition=3D[=3D($2, $3)], joinType=3D[inner]) : = rowType =3D RecordType(ANY T7=C2=A6=C2=A6*, ANY a1, ANY a10, DECIMAL(11, 1)= ROW_VALUE): rowcount =3D 10.0, cumulative cost =3D {23.0 rows, 157.0 cpu, = 0.0 io, 0.0 network, 35.2 memory}, id =3D 4918 > 00-05 Project(T7=C2=A6=C2=A6*=3D[$0], a1=3D[$1], a10=3D[$1]) := rowType =3D RecordType(ANY T7=C2=A6=C2=A6*, ANY a1, ANY a10): rowcount =3D= 10.0, cumulative cost =3D {10.0 rows, 20.0 cpu, 0.0 io, 0.0 network, 0.0 m= emory}, id =3D 4915 > 00-07 Project(T7=C2=A6=C2=A6*=3D[$0], a1=3D[$1]) : rowType = =3D RecordType(ANY T7=C2=A6=C2=A6*, ANY a1): rowcount =3D 10.0, cumulative = cost =3D {10.0 rows, 20.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id =3D 491= 4 > 00-08 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadE= ntryWithPath [path=3Dmaprfs:/drill/testdata/subqueries/t1]], selectionRoot= =3D/drill/testdata/subqueries/t1, numFiles=3D1, columns=3D[`*`]]]) : rowTyp= e =3D (DrillRecordRow[*, a1]): rowcount =3D 10.0, cumulative cost =3D {10.0= rows, 20.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id =3D 4913 > 00-04 HashAgg(group=3D[{0}]) : rowType =3D RecordType(DECIMAL(= 11, 1) ROW_VALUE): rowcount =3D 1.0, cumulative cost =3D {2.0 rows, 9.0 cpu= , 0.0 io, 0.0 network, 17.6 memory}, id =3D 4917 > 00-06 Values : rowType =3D RecordType(DECIMAL(11, 1) ROW_VAL= UE): rowcount =3D 1.0, cumulative cost =3D {1.0 rows, 1.0 cpu, 0.0 io, 0.0 = network, 0.0 memory}, id =3D 4916 > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)