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 53B8A18802 for ; Fri, 7 Aug 2015 00:01:10 +0000 (UTC) Received: (qmail 88584 invoked by uid 500); 7 Aug 2015 00:01:10 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 88553 invoked by uid 500); 7 Aug 2015 00:01:10 -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 88543 invoked by uid 99); 7 Aug 2015 00:01:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 00:01:09 +0000 Date: Fri, 7 Aug 2015 00:01:09 +0000 (UTC) From: "Hari Sankar Sivarama Subramaniyan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-11493) Predicate with integer column equals double evaluates to false 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-11493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661015#comment-14661015 ] Hari Sankar Sivarama Subramaniyan commented on HIVE-11493: ---------------------------------------------------------- Looks like this is happening because of https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java#L1036 The TypeCheckProcFactory thinks the type of double doesnt match with Column type int, hence this predicate = false. Incase of -10.0, we have a intermediate GenericUDFOPNegative node between the equals node and the value node. This prevents us from even entering the above code path all together. One possible fix might be to cast the value in case the columnType does not correspond to the the value type using the correct object inspector converter. Thanks Hari > Predicate with integer column equals double evaluates to false > -------------------------------------------------------------- > > Key: HIVE-11493 > URL: https://issues.apache.org/jira/browse/HIVE-11493 > Project: Hive > Issue Type: Bug > Affects Versions: 2.0.0 > Reporter: Prasanth Jayachandran > Assignee: Pengcheng Xiong > Priority: Blocker > > Filters with integer column equals double constant evaluates to false everytime. Negative double constant works fine. > {code:title=explain select * from orc_ppd where t = 10.0;} > OK > Stage-0 > Fetch Operator > limit:-1 > Select Operator [SEL_2] > outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"] > Filter Operator [FIL_1] > predicate:false (type: boolean) > TableScan [TS_0] > alias:orc_ppd > {code} > {code:title=explain select * from orc_ppd where t = -10.0;} > OK > Stage-0 > Fetch Operator > limit:-1 > Select Operator [SEL_2] > outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"] > Filter Operator [FIL_1] > predicate:(t = (- 10.0)) (type: boolean) > TableScan [TS_0] > alias:orc_ppd > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)