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 A4306200CD8 for ; Wed, 2 Aug 2017 20:42:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A295916A20F; Wed, 2 Aug 2017 18:42:04 +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 E9EE016A20B for ; Wed, 2 Aug 2017 20:42:03 +0200 (CEST) Received: (qmail 94102 invoked by uid 500); 2 Aug 2017 18:42:03 -0000 Mailing-List: contact issues-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list issues@impala.incubator.apache.org Received: (qmail 94093 invoked by uid 99); 2 Aug 2017 18:42:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2017 18:42:03 +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 BB997C02AA for ; Wed, 2 Aug 2017 18:42:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id YG97HanO7K72 for ; Wed, 2 Aug 2017 18:42:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4B4BB5F613 for ; Wed, 2 Aug 2017 18:42: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 8D6E4E012F for ; Wed, 2 Aug 2017 18:42:00 +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 44B5F2464A for ; Wed, 2 Aug 2017 18:42:00 +0000 (UTC) Date: Wed, 2 Aug 2017 18:42:00 +0000 (UTC) From: "Thomas Tauber-Marshall (JIRA)" To: issues@impala.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IMPALA-5753) Consider Expr nullability in rewrite rules MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 02 Aug 2017 18:42:04 -0000 Thomas Tauber-Marshall created IMPALA-5753: ---------------------------------------------- Summary: Consider Expr nullability in rewrite rules Key: IMPALA-5753 URL: https://issues.apache.org/jira/browse/IMPALA-5753 Project: IMPALA Issue Type: Improvement Components: Frontend Affects Versions: Impala 2.10.0 Reporter: Thomas Tauber-Marshall A recent change, IMPALA-5016, added an expr rewrite rule that simplifies coalesce(). This rule eliminated the coalesce when its first parameter (that isn't constant null) is non-nullable. It considered parameters to be non-nullable if they were SlotRefs that pointed to non-nullable SlotDescriptors. However, this approach has two problems: - Its incorrect if the slot has been outer joined on (IMPALA-5725) - It misses some opportunities for optimizations, for example ' + ' would be non-nullable but wouldn't have been eliminated since its not just a simple SlotRef. What we really need is a concept of the nullability of Exprs, so for example a SlotRefs nullability would be passed on the nullability of its SlotDescriptor and whether its the output of an outer join, the nullability of a BinaryPredicate would be based on the nullability of its children, etc. This would be useful for other expr rewrite rules besides coalesce() (such as simplifying 'ifnull') -- This message was sent by Atlassian JIRA (v6.4.14#64029)