Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D08C17CD4 for ; Thu, 23 Apr 2015 16:40:39 +0000 (UTC) Received: (qmail 50831 invoked by uid 500); 23 Apr 2015 16:40:39 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 50811 invoked by uid 500); 23 Apr 2015 16:40:39 -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 50794 invoked by uid 99); 23 Apr 2015 16:40:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 16:40:39 +0000 Date: Thu, 23 Apr 2015 16:40:38 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-10416) CBO (Calcite Return Path): Fix return columns if Sort operator is on top of plan returned by Calcite 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-10416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14509322#comment-14509322 ] Jesus Camacho Rodriguez commented on HIVE-10416: ------------------------------------------------ [~ashutoshc], not yet, I need to discuss with John about his comment. > CBO (Calcite Return Path): Fix return columns if Sort operator is on top of plan returned by Calcite > ---------------------------------------------------------------------------------------------------- > > Key: HIVE-10416 > URL: https://issues.apache.org/jira/browse/HIVE-10416 > Project: Hive > Issue Type: Sub-task > Components: CBO > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Fix For: 1.2.0 > > Attachments: HIVE-10416.01.patch, HIVE-10416.patch > > > When return path is on, if the plan's top operator is a Sort, we need to produce a SelectOp that will output exactly the columns needed by the FS. > The following query reproduces the problem: > {noformat} > select cbo_t3.c_int, c, count(*) > from (select key as a, c_int+1 as b, sum(c_int) as c from cbo_t1 > where (cbo_t1.c_int + 1 >= 0) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0) > group by c_float, cbo_t1.c_int, key order by a) cbo_t1 > join (select key as p, c_int+1 as q, sum(c_int) as r from cbo_t2 > where (cbo_t2.c_int + 1 >= 0) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0) > group by c_float, cbo_t2.c_int, key order by q/10 desc, r asc) cbo_t2 on cbo_t1.a=p > join cbo_t3 on cbo_t1.a=key > where (b + cbo_t2.q >= 0) and (b > 0 or c_int >= 0) > group by cbo_t3.c_int, c order by cbo_t3.c_int+c desc, c; > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)