Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BE58F200C14 for ; Tue, 7 Feb 2017 19:21:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BCE80160B3E; Tue, 7 Feb 2017 18:21:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E2D83160B32 for ; Tue, 7 Feb 2017 19:21:20 +0100 (CET) Received: (qmail 39787 invoked by uid 500); 7 Feb 2017 18:21:20 -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 Delivered-To: moderator for dev@drill.apache.org Received: (qmail 49878 invoked by uid 99); 7 Feb 2017 16:36:13 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.978 X-Spam-Level: * X-Spam-Status: No, score=1.978 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=mapr.onmicrosoft.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mapr.onmicrosoft.com; s=selector1-mapr-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=h8XnPHDV0zI9XQtJQsBHDEN7Td9iVptxW0vb2shBwJA=; b=tpPNREdCVHl6xMr7Gt5Yn0qK9LFqK4wTx+NI1uPpoCu/41CWeJY9Thf+WioZq744Gie6Pxio5gyvpJ3DZNEYtEQkM9koWeYMEQzwKV+5U1TT0cXUFkKuzOhUSaxsdWy3WIxmR0W7ZOBm6VeO0WfY6OMXfkLDQmtvLygICb5Cvo4= From: Khurram Faraaz To: "dev@drill.apache.org" Subject: Re: Column ordering is incorrect when ORDER BY is used with LIMIT clause in query over parquet data Thread-Topic: Column ordering is incorrect when ORDER BY is used with LIMIT clause in query over parquet data Thread-Index: AQHSgFp7QRjX8DkB7Eup8j+gJ+ZpyKFdv5pl Date: Tue, 7 Feb 2017 16:36:02 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kfaraaz@mapr.com; x-originating-ip: [25.175.142.132] x-ms-office365-filtering-correlation-id: 4a0cb55a-3ec9-4fd2-ea89-08d44f7767df x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR16MB1735; x-microsoft-exchange-diagnostics: 1;CY4PR16MB1735;7:KaoQi07QG2+abhg88u0dKHJ5hi2cA/ua049XYChCYhEmLcu+BtnKaQilmQjprDjnjzgIhTI8mO4WPLfs+4+UlnGi9SX+ty3ZEhCIOgLEkiIjh4F1c+hYk4DPQuLZv4LI/NfiInLf8ZnTTL/5U3r7uAACUSq3SCxnTdnMDAeg+xxRrkKM8Ghaeym2oYbsdwF6F/KhWIVsK8KGubVAshwUN10KLxcCuHSyFFQ73x2zoLOLiM3vpcC8wYgQJXA3J3JW79uDbe2RUwpKfVU4rU58MFX7/zC4+oEj3K3gj9+5E15Jp9fMvy8iJGVu9pL4k7Rb8ALms9r8E5lvcdNkfm9D3alnNuBMxCOYNgKggfl+wlwNatepowA072kqiJa/4Ju8/jaqVdAjanqsshXV4RZn+ttik+jIro8A5jLZklXMQt00Sl8tzCT30Ff0wg3mVvkMlYeacBMYfZIewq1pYBQWTQ/8KDqLwK3yE5nlp/9E6uhGeAyLWiZc8XK2fNIWWNMiKChzwFdc7+PIafTdiZc3d1nuAGypyegG/1MjpbfHfad10h7FcKipnyJQod7w24Kb x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(2017020603029)(20170203043)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558025)(6072148);SRVR:CY4PR16MB1735;BCL:0;PCL:0;RULEID:;SRVR:CY4PR16MB1735; x-forefront-prvs: 0211965D06 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39450400003)(199003)(189002)(377454003)(377424004)(3660700001)(106356001)(122556002)(55016002)(68736007)(97736004)(81156014)(8936002)(33656002)(1730700003)(6916009)(6246003)(2501003)(54356999)(77096006)(189998001)(8676002)(53546003)(5660300001)(76176999)(6436002)(2900100001)(7736002)(92566002)(450100001)(99286003)(74316002)(106116001)(7696004)(229853002)(25786008)(3846002)(6506006)(9686003)(2950100002)(575784001)(3280700002)(105586002)(81166006)(86362001)(102836003)(50986999)(54896002)(66066001)(2906002)(6116002)(5640700003)(2351001)(53936002)(101416001)(38730400002)(110136004);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR16MB1735;H:CY4PR16MB1733.namprd16.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: mapr.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_CY4PR16MB17330BD84F7CB4C353CB8E76DF430CY4PR16MB1733namp_" MIME-Version: 1.0 X-OriginatorOrg: mapr.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2017 16:36:02.6971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 2573c0c8-6f2a-4418-a58a-a742cf6415fb X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR16MB1735 archived-at: Tue, 07 Feb 2017 18:21:21 -0000 --_000_CY4PR16MB17330BD84F7CB4C353CB8E76DF430CY4PR16MB1733namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can someone please look at this. Is this a bug ? Thanks, Khurram ________________________________ From: Khurram Faraaz Sent: Monday, February 6, 2017 2:52:25 PM To: dev@drill.apache.org Subject: Column ordering is incorrect when ORDER BY is used with LIMIT clau= se in query over parquet data All, This looks incorrect. Query with order by + limit clause, the ordering of the columns returned in= the query results is NOT the same as the column ordering in the parquet fi= le. {noformat} 0: jdbc:drill:schema=3Ddfs.tmp> SELECT * FROM typeall_l ORDER BY col_int li= mit 1; +----------+----------+-------------+------------+----------+--------------= ---+----------------+-----------+------------------------+----------------+= -------------+ | col_bln | col_chr | col_dt | col_flt | col_int | col_intrvl_da= y | col_intrvl_yr | col_tim | col_tmstmp | col_vrchr1 |= col_vrchr2 | +----------+----------+-------------+------------+----------+--------------= ---+----------------+-----------+------------------------+----------------+= -------------+ | false | MI | 1967-05-01 | 32.901897 | 0 | P12DT20775S = | P196M | 19:50:17 | 2004-10-15 17:49:36.0 | Felecia Gourd |= NLBQMg9 | +----------+----------+-------------+------------+----------+--------------= ---+----------------+-----------+------------------------+----------------+= -------------+ 1 row selected (0.279 seconds) {noformat} Without the ORDER BY clause the columns are returned in correct order, same= as the ordering in the parquet file. {noformat} 0: jdbc:drill:schema=3Ddfs.tmp> SELECT * FROM typeall_l limit 1; +----------+----------+----------------+-----------------------------------= ---------------------------------------------------------------------------= -------+-------------+-----------+------------------------+------------+---= -------------+-----------------+----------+ | col_int | col_chr | col_vrchr1 | = col_vrchr2 = | col_dt | col_tim | col_tmstmp | col_flt | co= l_intrvl_yr | col_intrvl_day | col_bln | +----------+----------+----------------+-----------------------------------= ---------------------------------------------------------------------------= -------+-------------+-----------+------------------------+------------+---= -------------+-----------------+----------+ | 45436 | WV | John Mcginity | Rhbf6VFLJguvH9ejrWNkY1CDO8QqumTZAG= jwa9cHfjBnLmNIWvo9YfcGObxbeXwa1NkemW9ULxsq5293wEA2v5FFCduwt03D7ysI3RlH8b4B0= XAPKY | 2011-11-04 | 18:02:26 | 1988-09-23 16:58:42.0 | 10.193293 | P3= 14M | P26DT27386S | false | +----------+----------+----------------+-----------------------------------= ---------------------------------------------------------------------------= -------+-------------+-----------+------------------------+------------+---= -------------+-----------------+----------+ 1 row selected (0.22 seconds) {noformat} Thanks, Khurram --_000_CY4PR16MB17330BD84F7CB4C353CB8E76DF430CY4PR16MB1733namp_--