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 5DBCC17FF1 for ; Fri, 23 Jan 2015 05:39:35 +0000 (UTC) Received: (qmail 40218 invoked by uid 500); 23 Jan 2015 05:39:35 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 40132 invoked by uid 500); 23 Jan 2015 05:39:35 -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 40120 invoked by uid 500); 23 Jan 2015 05:39:35 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 40117 invoked by uid 99); 23 Jan 2015 05:39:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jan 2015 05:39:35 +0000 Date: Fri, 23 Jan 2015 05:39:34 +0000 (UTC) From: "Navis (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9228) Problem with subquery using windowing functions 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-9228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Navis updated HIVE-9228: ------------------------ Attachment: HIVE-9228.1.patch.txt CP problem > Problem with subquery using windowing functions > ----------------------------------------------- > > Key: HIVE-9228 > URL: https://issues.apache.org/jira/browse/HIVE-9228 > Project: Hive > Issue Type: Bug > Components: PTF-Windowing > Affects Versions: 0.13.1 > Reporter: Aihua Xu > Assignee: Aihua Xu > Attachments: HIVE-9228.1.patch.txt, create_table_tab1.sql, tab1.csv > > Original Estimate: 96h > Remaining Estimate: 96h > > The following query with window functions failed. The internal query works fine. > select col1, col2, col3 from (select col1,col2, col3, count(case when col4=1 then 1 end ) over (partition by col1, col2) as col5, row_number() over (partition by col1, col2 order by col4) as col6 from tab1) t; > HIVE generates an execution plan with 2 jobs. > 1. The first job is to basically calculate window function for col5. > 2. The second job is to calculate window function for col6 and output. > The plan says the first job outputs the columns (col1, col2, col3, col4) to a tmp file since only these columns are used in later stage. While, the PTF operator for the first job outputs (_wcol0, col1, col2, col3, col4) with _wcol0 as the result of the window function even it's not used. > In the second job, the map operator still reads the 4 columns (col1, col2, col3, col4) from the temp file using the plan. That causes the exception. -- This message was sent by Atlassian JIRA (v6.3.4#6332)