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 4F7C6178DD for ; Thu, 6 Nov 2014 23:35:36 +0000 (UTC) Received: (qmail 29596 invoked by uid 500); 6 Nov 2014 23:35:35 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 29506 invoked by uid 500); 6 Nov 2014 23:35: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 29395 invoked by uid 500); 6 Nov 2014 23:35:35 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 29382 invoked by uid 99); 6 Nov 2014 23:35:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2014 23:35:35 +0000 Date: Thu, 6 Nov 2014 23:35:35 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-8099) IN operator for partition column fails when the partition column type is DATE 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-8099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14201209#comment-14201209 ] Ashutosh Chauhan commented on HIVE-8099: ---------------------------------------- Please hold on committing this. I want to take a look to see how hard it is to fix the right way and what impact it has fixing it wrong way. > IN operator for partition column fails when the partition column type is DATE > ----------------------------------------------------------------------------- > > Key: HIVE-8099 > URL: https://issues.apache.org/jira/browse/HIVE-8099 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.13.0, 0.13.1 > Reporter: Venki Korukanti > Assignee: Venki Korukanti > Fix For: 0.14.0 > > Attachments: HIVE-8099.1.patch, HIVE-8099.2.patch > > > Test table DLL: > {code} > CREATE TABLE testTbl(col1 string) PARTITIONED BY (date_prt date); > {code} > Following query used to work fine in Hive 0.12 as the constant types are 'string' and partition column type is considered as 'string' throughout the planning and optimization (including partition pruning). > {code} > SELECT * FROM testTbl WHERE date_prt IN ('2014-08-09', '2014-08-08'); > {code} > In trunk the above query fails with: > {code} > Line 1:33 Wrong arguments ''2014-08-08'': The arguments for IN should be the same type! Types are: {date IN (string, string)} > {code} > HIVE-6642 changed the SemanticAnalyzer.java to consider partition type given in table definition instead of hardcoded 'string' type. (Modified [Hive 0.12 code|https://github.com/apache/hive/blob/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L7778]). So changed the query as follows to go past the above error: > {code} > SELECT * FROM testTbl WHERE date_prt IN (CAST('2014-08-09' AS DATE), CAST('2014-08-08' AS DATE)); > {code} > Now query goes past the error in SemanticAnalyzer, but hits the same issue (default 'string' type for partition columns) in partition pruning optimization. (Realted code [here|https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartExprEvalUtils.java#L110]). > > {code} > 14/09/14 20:07:20 ERROR ql.Driver: FAILED: SemanticException MetaException(message:The arguments for IN should be the same type! Types are: {string IN (date, date)}) > {code} > We need to change partition pruning code to consider the partition column as the type given in table definition. -- This message was sent by Atlassian JIRA (v6.3.4#6332)