From dev-return-1590-apmail-calcite-dev-archive=calcite.apache.org@calcite.incubator.apache.org Sun Aug 2 03:23:40 2015 Return-Path: X-Original-To: apmail-calcite-dev-archive@www.apache.org Delivered-To: apmail-calcite-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 7C91717E36 for ; Sun, 2 Aug 2015 03:23:40 +0000 (UTC) Received: (qmail 3465 invoked by uid 500); 2 Aug 2015 03:23:40 -0000 Delivered-To: apmail-calcite-dev-archive@calcite.apache.org Received: (qmail 3405 invoked by uid 500); 2 Aug 2015 03:23:40 -0000 Mailing-List: contact dev-help@calcite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@calcite.incubator.apache.org Delivered-To: mailing list dev@calcite.incubator.apache.org Received: (qmail 3394 invoked by uid 99); 2 Aug 2015 03:23:40 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2015 03:23:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C8B04C093B for ; Sun, 2 Aug 2015 03:23:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.97 X-Spam-Level: *** X-Spam-Status: No, score=3.97 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yLKY7yJbHOZ0 for ; Sun, 2 Aug 2015 03:23:33 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id DE60F205B8 for ; Sun, 2 Aug 2015 03:23:32 +0000 (UTC) Received: (qmail 3389 invoked by uid 99); 2 Aug 2015 03:23:32 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2015 03:23:32 +0000 Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.48]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 4C4B01A012E for ; Sun, 2 Aug 2015 03:23:32 +0000 (UTC) Received: by qgeh16 with SMTP id h16so69653144qge.3 for ; Sat, 01 Aug 2015 20:23:31 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.140.194.198 with SMTP id p189mr17300427qha.42.1438485811436; Sat, 01 Aug 2015 20:23:31 -0700 (PDT) Received: by 10.96.48.194 with HTTP; Sat, 1 Aug 2015 20:23:31 -0700 (PDT) In-Reply-To: <04E4B2F0-DCCA-4A4D-AF66-2B39816BF7A8@gmail.com> References: <89645361-0160-4787-8527-AC4D22D99B46@apache.org> <04E4B2F0-DCCA-4A4D-AF66-2B39816BF7A8@gmail.com> Date: Sat, 1 Aug 2015 20:23:31 -0700 Message-ID: Subject: Re: Collation meets relational algebra From: Jacques Nadeau To: dev@calcite.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11431e18ce3b79051c4b9387 --001a11431e18ce3b79051c4b9387 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable :D On Sat, Aug 1, 2015 at 7:02 PM, Julian Hyde wrote: > Careful with making the database adhere to people=E2=80=99s =E2=80=9Cexpe= ctations". MySQL > used to guarantee that the output of GROUP BY is sorted and they lived to > regret it. > > > On Aug 1, 2015, at 8:58 AM, Jacques Nadeau wrote: > > > > I think Aman and Vicki mentioned that this is a situation where most > > databases diverge from the spec since people have a certain expectation= . > > > > On Fri, Jul 31, 2015 at 9:56 PM, Julian Hyde wrote: > > > >> > >>> Jinfeng, the subquery's ORDER-BY can be dropped in some cases but not > >> all.. > >>> for instance in the following query: > >>> SELECT a1 FROM (SELECT a1 FROM t1 WHERE .... ORDER BY a1) LIMIT 10; > >>> The OB should not be dropped. There are other cases, this is one > >> example. > >> > >> FWIW, My understanding of the SQL standard is that that ORDER BY can b= e > >> dropped. You can=E2=80=99t rely on the order of output from a sub-quer= y. If you > >> want the desired effect you have to combine ORDER BY and LIMIT into th= e > >> same clause. > >> > >> Julian > >> > >> > > --001a11431e18ce3b79051c4b9387--