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 F2E3D18C08 for ; Tue, 21 Jul 2015 19:23:35 +0000 (UTC) Received: (qmail 1071 invoked by uid 500); 21 Jul 2015 19:23:35 -0000 Delivered-To: apmail-calcite-dev-archive@calcite.apache.org Received: (qmail 1002 invoked by uid 500); 21 Jul 2015 19:23:35 -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 991 invoked by uid 99); 21 Jul 2015 19:23:35 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 19:23:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AADFD1A74D4 for ; Tue, 21 Jul 2015 19:23:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.99 X-Spam-Level: X-Spam-Status: No, score=0.99 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 70pNQEoSLdO2 for ; Tue, 21 Jul 2015 19:23:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 379B320D14 for ; Tue, 21 Jul 2015 19:23:28 +0000 (UTC) Received: (qmail 966 invoked by uid 99); 21 Jul 2015 19:23:27 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 19:23:27 +0000 Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D37881A0040 for ; Tue, 21 Jul 2015 19:23:26 +0000 (UTC) Received: by oibn4 with SMTP id n4so130319129oib.3 for ; Tue, 21 Jul 2015 12:23:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.212.205 with SMTP id l196mr24845282oig.54.1437506605579; Tue, 21 Jul 2015 12:23:25 -0700 (PDT) Received: by 10.202.115.15 with HTTP; Tue, 21 Jul 2015 12:23:25 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Jul 2015 12:23:25 -0700 Message-ID: Subject: Re: ProjectMergeRule From: Julian Hyde To: dev@calcite.incubator.apache.org Content-Type: text/plain; charset=UTF-8 Jacques, I can make the default instance (ProjectMergeRule.INSTANCE) have force=true (currently it has force=false) and only remove a renaming project if force=true. Then most people will get the benefit, but if there is a problem you can switch Drill to using a custom instance. Also, this would be good reason to test Drill against a 1.4-SNAPSHOT when it is posted. Julian On Tue, Jul 21, 2015 at 11:18 AM, Jacques Nadeau wrote: > I'm a little nervous about that for Drill. Despite the goal to do full > testing to make sure we weren't accidentally using field names anywhere, we > haven't yet gotten very far. We know we're not supposed to depend on > anything but ordinal but as a name based system, it is likely something > depends on something there. > > On Tue, Jul 21, 2015 at 11:04 AM, Julian Hyde wrote: > >> ProjectMergeRule currently refuses to reduce identity projects if the >> fields have different names. >> >> For instance suppose you have a table Dept (deptno, name) and the algebra >> >> 2: Project($1 as X, $0 as Y) >> 1: Project($1, $0) >> 0: Scan(Dept) >> >> Observe that if you combine projects #1 and #2 you end up with >> >> 3: Project($0 as X, $1 as Y) >> 0: Scan(Dept) >> >> Although the new project (#3) is an identity, it renames the fields. >> ProjectMergeRule will return the new project (#3), but it could return >> Scan(Dept) (#0). >> >> Does anyone think they will break if I make it return #0? >> >> Julian >>