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 57A5C18D65 for ; Fri, 12 Feb 2016 17:31:18 +0000 (UTC) Received: (qmail 23973 invoked by uid 500); 12 Feb 2016 17:31:18 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 23950 invoked by uid 500); 12 Feb 2016 17:31:18 -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 23926 invoked by uid 99); 12 Feb 2016 17:31:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2016 17:31:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 25FBE2C14F4 for ; Fri, 12 Feb 2016 17:31:18 +0000 (UTC) Date: Fri, 12 Feb 2016 17:31:18 +0000 (UTC) From: "Aleksey Vovchenko (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-12749) Constant propagate returns string values in incorrect format 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-12749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15144904#comment-15144904 ] Aleksey Vovchenko commented on HIVE-12749: ------------------------------------------ I changed only query execution plans and did not change the data type. > Constant propagate returns string values in incorrect format > ------------------------------------------------------------ > > Key: HIVE-12749 > URL: https://issues.apache.org/jira/browse/HIVE-12749 > Project: Hive > Issue Type: Bug > Affects Versions: 1.0.0, 1.2.0 > Reporter: Oleksiy Sayankin > Assignee: Aleksey Vovchenko > Attachments: HIVE-12749.1.patch, HIVE-12749.2.patch > > > h2. STEP 1. Create and upload test data > Execute in command line: > {noformat} > nano stest.data > {noformat} > Add to file: > {noformat} > 000126,000777 > 000126,000778 > 000126,000779 > 000474,000888 > 000468,000889 > 000272,000880 > {noformat} > {noformat} > hadoop fs -put stest.data / > {noformat} > {noformat} > hive> create table stest(x STRING, y STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','; > hive> LOAD DATA INPATH '/stest.data' OVERWRITE INTO TABLE stest; > {noformat} > h2. STEP 2. Execute test query (with cast for x) > {noformat} > select x from stest where cast(x as int) = 126; > {noformat} > EXPECTED RESULT: > {noformat} > 000126 > 000126 > 000126 > {noformat} > ACTUAL RESULT: > {noformat} > 126 > 126 > 126 > {noformat} > h2. STEP 3. Execute test query (no cast for x) > {noformat} > hive> select x from stest where x = 126; > {noformat} > EXPECTED RESULT: > {noformat} > 000126 > 000126 > 000126 > {noformat} > ACTUAL RESULT: > {noformat} > 126 > 126 > 126 > {noformat} > In steps #2, #3 I expected '000126' because the origin type of x is STRING in stest table. > Note, setting hive.optimize.constant.propagation=false fixes the issue. > {noformat} > hive> set hive.optimize.constant.propagation=false; > hive> select x from stest where x = 126; > OK > 000126 > 000126 > 000126 > {noformat} > Related to HIVE-11104, HIVE-8555 -- This message was sent by Atlassian JIRA (v6.3.4#6332)