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 7ABF2200CA5 for ; Sat, 27 May 2017 01:02:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 793CD160BC8; Fri, 26 May 2017 23:02:32 +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 E60D1160B9C for ; Sat, 27 May 2017 01:02:31 +0200 (CEST) Received: (qmail 8995 invoked by uid 500); 26 May 2017 23:02:31 -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 8984 invoked by uid 99); 26 May 2017 23:02:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 May 2017 23:02:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9DA18DFC2E; Fri, 26 May 2017 23:02:30 +0000 (UTC) From: jinfengni To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #844: DRILL-5538: Exclude ProjectRemoveRule during PHYSIC... Content-Type: text/plain Message-Id: <20170526230230.9DA18DFC2E@git1-us-west.apache.org> Date: Fri, 26 May 2017 23:02:30 +0000 (UTC) archived-at: Fri, 26 May 2017 23:02:32 -0000 Github user jinfengni commented on a diff in the pull request: https://github.com/apache/drill/pull/844#discussion_r118802952 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/PlannerPhase.java --- @@ -180,9 +180,19 @@ public RuleSet getRules(OptimizerRulesContext context, Collection PHYSICAL("Physical Planning") { public RuleSet getRules(OptimizerRulesContext context, Collection plugins) { + final RuleSet storageRules = getStorageRules(context, plugins, this); + + final Builder newStorageRulesBuilder = ImmutableSet.builder(); + for (final RelOptRule relOptRule : storageRules) { + // exclude ProjectRemoveRule to prevent Drill from losing column alias or displaying implicit columns + if (!(relOptRule instanceof ProjectRemoveRule)) { --- End diff -- For query "select version as current_version from t;", why will ProjectRemoveRule think that the Project operator is a trivial project? I assume that the input/output's field name is different. If there is bug in ProjectRemoveRule, it's better to fix that, in stead of removing it completely. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---