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 346BA200C2F for ; Mon, 6 Mar 2017 09:56:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 33016160B76; Mon, 6 Mar 2017 08:56:37 +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 7BAE8160B73 for ; Mon, 6 Mar 2017 09:56:36 +0100 (CET) Received: (qmail 57532 invoked by uid 500); 6 Mar 2017 08:56:35 -0000 Mailing-List: contact issues-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 issues@hive.apache.org Received: (qmail 57523 invoked by uid 99); 6 Mar 2017 08:56:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2017 08:56:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 50E9618495F for ; Mon, 6 Mar 2017 08:56:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.546 X-Spam-Level: X-Spam-Status: No, score=-1.546 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, LOTS_OF_MONEY=0.001, RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 0VExFG4rB0Ak for ; Mon, 6 Mar 2017 08:56:34 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 42F6D5FC75 for ; Mon, 6 Mar 2017 08:56:34 +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 4FF03E04E7 for ; Mon, 6 Mar 2017 08:56:33 +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 063B124166 for ; Mon, 6 Mar 2017 08:56:33 +0000 (UTC) Date: Mon, 6 Mar 2017 08:56:33 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (HIVE-16117) SortProjectTransposeRule should check for monotonicity preserving CAST MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 06 Mar 2017 08:56:37 -0000 [ https://issues.apache.org/jira/browse/HIVE-16117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesus Camacho Rodriguez reassigned HIVE-16117: ---------------------------------------------- > SortProjectTransposeRule should check for monotonicity preserving CAST > ---------------------------------------------------------------------- > > Key: HIVE-16117 > URL: https://issues.apache.org/jira/browse/HIVE-16117 > Project: Hive > Issue Type: Bug > Components: CBO > Affects Versions: 2.2.0 > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > > Due to CALCITE-1618, we need to move to new Calcite release to fix it. > Due to this, SortProjectTransposeRule ignores CAST in the Project operator. > For instance: > {noformat} > ... > HiveSortLimit(sort0=$4,sort1=$2,dir0=ASC-nulls-first,dir1=DESC-nulls-last,fetch=10) > HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER)) > ... > {noformat} > will be transformed into: > {noformat} > ... > HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER)) > HiveSortLimit(sort0=$0,sort1=$2,dir0=ASC-nulls-first,dir1=DESC-nulls-last,fetch=10) > ... > {noformat} > which is incorrect. > The problem seems to be in the _permutation_ method in RelOptUtil, which is called in L87. The method actually considers a CAST on a reference as a valid column permutation of the column referenced; probably it should not. > _permutation_ is only called by this rule and UnionPullUpConstantsRule, thus it seems it is safe to fix the semantics of the method. -- This message was sent by Atlassian JIRA (v6.3.15#6346)