From issues-return-50325-archive-asf-public=cust-asf.ponee.io@drill.apache.org Sat Mar 3 16:38:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3D542180654 for ; Sat, 3 Mar 2018 16:38:04 +0100 (CET) Received: (qmail 11716 invoked by uid 500); 3 Mar 2018 15:38:03 -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 11706 invoked by uid 99); 3 Mar 2018 15:38:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Mar 2018 15:38:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DE0AEC237F for ; Sat, 3 Mar 2018 15:38:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.51 X-Spam-Level: X-Spam-Status: No, score=-109.51 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Chce38iFijow for ; Sat, 3 Mar 2018 15:38:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A2DFC5F2ED for ; Sat, 3 Mar 2018 15:38:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 03D3EE015E for ; Sat, 3 Mar 2018 15:38:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A64D121260 for ; Sat, 3 Mar 2018 15:38:00 +0000 (UTC) Date: Sat, 3 Mar 2018 15:38:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-6118) Handle item star columns during project / filter push down and directory pruning 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-6118?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1638= 4699#comment-16384699 ]=20 ASF GitHub Bot commented on DRILL-6118: --------------------------------------- Github user arina-ielchiieva commented on the issue: https://github.com/apache/drill/pull/1104 =20 Merged into Apache master with commit id 9073aed67d89e8b2188870d6c81270= 6085c9c41b > Handle item star columns during project / filter push down and director= y pruning > -------------------------------------------------------------------------= --------- > > Key: DRILL-6118 > URL: https://issues.apache.org/jira/browse/DRILL-6118 > Project: Apache Drill > Issue Type: Improvement > Affects Versions: 1.12.0 > Reporter: Arina Ielchiieva > Assignee: Arina Ielchiieva > Priority: Major > Labels: doc-impacting, ready-to-commit > Fix For: 1.13.0 > > > Project push down, filter push down and partition pruning does not work w= ith dynamically expanded column with is represented as star in ITEM operato= r:=C2=A0_ITEM($0, 'column_name')_=C2=A0where $0 is a star. > This often occurs when view, sub-select or cte with star is issued. > To solve this issue we can create=C2=A0{{DrillFilterItemStarReWriterRule= }}=C2=A0which will rewrite such ITEM operator before filter push down and d= irectory pruning. For project into scan push down logic will be handled sep= arately in already existing rule=C2=A0{{DrillPushProjectIntoScanRule}}. Bas= ically, we can consider the following queries the same:=C2=A0 > {{select col1 from t}} > {{select col1 from (select * from t)}} > *Use cases* > Since item star columns where not considered during project / filter push= down and directory pruning, push down and pruning did not happen. This was= causing Drill to read all columns from file (when only several are needed)= or ready all files instead. Views with star query is the most common examp= le. Such behavior significantly degrades performance for item star queries = comparing to queries without item star. > *EXAMPLES* > *Data set*=20 > will create table with three files each in dedicated sub-folder: > {noformat} > use dfs.tmp; > create table `order_ctas/t1` as select cast(o_orderdate as date) as o_ord= erdate from cp.`tpch/orders.parquet` where o_orderdate between date '1992-0= 1-01' and date '1992-01-03'; > create table `order_ctas/t2` as select cast(o_orderdate as date) as o_ord= erdate from cp.`tpch/orders.parquet` where o_orderdate between date '1992-0= 1-04' and date '1992-01-06'; > create table `order_ctas/t3` as select cast(o_orderdate as date) as o_ord= erdate from cp.`tpch/orders.parquet` where o_orderdate between date '1992-0= 1-07' and date '1992-01-09'; > {noformat} > *Filter push down* > {{select * from order_ctas where o_orderdate =3D date '1992-01-01'}} will= read only one file > {noformat} > 00-00 Screen > 00-01 Project(**=3D[$0]) > 00-02 Project(T1=C2=A6=C2=A6**=3D[$0]) > 00-03 SelectionVectorRemover > 00-04 Filter(condition=3D[=3D($1, 1992-01-01)]) > 00-05 Project(T1=C2=A6=C2=A6**=3D[$0], o_orderdate=3D[$1]) > 00-06 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadE= ntryWithPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet]], selectionRoot=3D/t= mp/order_ctas, numFiles=3D1, numRowGroups=3D1, usedMetadataFile=3Dfalse, co= lumns=3D[`**`]]]) > {noformat} > {{select * from (select * from order_ctas) where o_orderdate =3D date '19= 92-01-01'}} will ready all three files > {noformat} > 00-00 Screen > 00-01 Project(**=3D[$0]) > 00-02 SelectionVectorRemover > 00-03 Filter(condition=3D[=3D(ITEM($0, 'o_orderdate'), 1992-01-0= 1)]) > 00-04 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadEntry= WithPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet], ReadEntryWithPath [path= =3D/tmp/order_ctas/t2/0_0_0.parquet], ReadEntryWithPath [path=3D/tmp/order_= ctas/t3/0_0_0.parquet]], selectionRoot=3D/tmp/order_ctas, numFiles=3D3, num= RowGroups=3D3, usedMetadataFile=3Dfalse, columns=3D[`**`]]]) > {noformat} > *Directory pruning* > {{select * from order_ctas where dir0 =3D 't1'}} will read data only from= one folder > {noformat} > 00-00 Screen > 00-01 Project(**=3D[$0]) > 00-02 Project(**=3D[$0]) > 00-03 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadEntryWi= thPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet]], selectionRoot=3D/tmporde= r_ctas, numFiles=3D1, numRowGroups=3D1, usedMetadataFile=3Dfalse, columns= =3D[`**`]]]) > {noformat} > {{select * from (select * from order_ctas) where dir0 =3D 't1'}} will rea= d content of all three folders > {noformat} > 00-00 Screen > 00-01 Project(**=3D[$0]) > 00-02 SelectionVectorRemover > 00-03 Filter(condition=3D[=3D(ITEM($0, 'dir0'), 't1')]) > 00-04 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadEntry= WithPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet], ReadEntryWithPath [path= =3D/tmp/order_ctas/t2/0_0_0.parquet], ReadEntryWithPath [path=3D/tmp/order_= ctas/t3/0_0_0.parquet]], selectionRoot=3D/tmp/order_ctas, numFiles=3D3, num= RowGroups=3D3, usedMetadataFile=3Dfalse, columns=3D[`**`]]]) > {noformat} > *Project into Scan push down* > {{select o_orderdate, count(1) from order_ctas group by o_orderdate}} wil= l ready only one column from the files > {noformat} > 00-00 Screen > 00-01 Project(o_orderdate=3D[$0], EXPR$1=3D[$1]) > 00-02 HashAgg(group=3D[{0}], EXPR$1=3D[COUNT()]) > 00-03 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadEntryWi= thPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet], ReadEntryWithPath [path= =3D/tmp/order_ctas/t2/0_0_0.parquet], ReadEntryWithPath [path=3D/tmp/order_= ctas/t3/0_0_0.parquet]], selectionRoot=3D/tmp/order_ctas, numFiles=3D3, num= RowGroups=3D3, usedMetadataFile=3Dfalse, columns=3D[`o_orderdate`]]]) > {noformat} > {{select o_orderdate, count(1) from (select * from order_ctas) group by o= _orderdate}} will ready all columns from the files > {noformat} > 00-00 Screen > 00-01 Project(col_vrchr=3D[$0], EXPR$1=3D[$1]) > 00-02 StreamAgg(group=3D[{0}], EXPR$1=3D[COUNT()]) > 00-03 Sort(sort0=3D[$0], dir0=3D[ASC]) > 00-04 Project(col_vrchr=3D[ITEM($0, 'o_orderdate')]) > 00-05 Scan(groupscan=3D[ParquetGroupScan [entries=3D[ReadEntryWit= hPath [path=3D/tmp/order_ctas/t1/0_0_0.parquet], ReadEntryWithPath [path=3D= /tmp/order_ctas/t2/0_0_0.parquet], ReadEntryWithPath [path=3D/tmp/order_cta= s/t3/0_0_0.parquet]], selectionRoot=3D/tmp/order_ctas, numFiles=3D3, numRow= Groups=3D3, usedMetadataFile=3Dfalse, columns=3D[`**`]]]) > {noformat} > This Jira aims to fix all three described cases above in order to improve= performance for queries with item star columns. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)