Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-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 117DD173CC for ; Sat, 21 Feb 2015 07:29:12 +0000 (UTC) Received: (qmail 27227 invoked by uid 500); 21 Feb 2015 07:29:11 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 27154 invoked by uid 500); 21 Feb 2015 07:29:11 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 27143 invoked by uid 500); 21 Feb 2015 07:29:11 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 27140 invoked by uid 99); 21 Feb 2015 07:29:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Feb 2015 07:29:11 +0000 Date: Sat, 21 Feb 2015 07:29:11 +0000 (UTC) From: "Gopal V (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9644) CASE comparison operator rotation optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-9644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gopal V updated HIVE-9644: -------------------------- Summary: CASE comparison operator rotation optimization (was: Constant folding case for CASE/WHEN) > CASE comparison operator rotation optimization > ---------------------------------------------- > > Key: HIVE-9644 > URL: https://issues.apache.org/jira/browse/HIVE-9644 > Project: Hive > Issue Type: Bug > Components: Logical Optimizer > Affects Versions: 1.2.0 > Reporter: Gopal V > > Constant folding for queries don't kick in for some automatically generated query patterns which look like this. > {code} > hive> explain select count(1) from store_sales where (case ss_sold_date when '1998-01-01' then 1 else null end)=1; > {code} > This should get rewritten by pushing the equality into the case branches. > {code} > select count(1) from store_sales where (case ss_sold_date when '1998-01-01' then 1=1 else null=1 end); > {code} > Ending up with a simplified filter condition, resolving itself as > {code} > select count(1) from store_sales where ss_sold_date= '1998-01-01' ; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)