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 C53BD184B4 for ; Mon, 28 Mar 2016 23:01:25 +0000 (UTC) Received: (qmail 88406 invoked by uid 500); 28 Mar 2016 23:01:25 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 88373 invoked by uid 500); 28 Mar 2016 23:01:25 -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 88353 invoked by uid 99); 28 Mar 2016 23:01:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Mar 2016 23:01:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7CC572C14FB for ; Mon, 28 Mar 2016 23:01:25 +0000 (UTC) Date: Mon, 28 Mar 2016 23:01:25 +0000 (UTC) From: "Aleksei Statkevich (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13372) Hive Macro overwritten when multiple macros are used in one column 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-13372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksei Statkevich updated HIVE-13372: -------------------------------------- Description: When multiple macros are used in one column, results of the later ones are over written by that of the first. For example: Suppose we have created a table called macro_test with single column x in STRING type, and with data as: "a" "bb" "ccc" We also create three macros: {code} CREATE TEMPORARY MACRO STRING_LEN(x string) length(x); CREATE TEMPORARY MACRO STRING_LEN_PLUS_ONE(x string) length(x)+1; CREATE TEMPORARY MACRO STRING_LEN_PLUS_TWO(x string) length(x)+2; {code} When we ran the following query, {code} SELECT CONCAT(STRING_LEN(x), ":", STRING_LEN_PLUS_ONE(x), ":", STRING_LEN_PLUS_TWO(x)) a FROM macro_test SORT BY a DESC; {code} We get result: 3:3:3 2:2:2 1:1:1 instead of expected: 3:4:5 2:3:4 1:2:3 Currently we are using Hive 1.2.1, and have applied both HIVE-11432 and HIVE-12277 patches. was: When multiple macros are used in one column, results of the later ones are over written by that of the first. For example: Suppose we have created a table called macro_test with single column x in STRING type, and with data as: "a" "bb" "ccc" We also create three macros: CREATE TEMPORARY MACRO STRING_LEN(x string) length(x); CREATE TEMPORARY MACRO STRING_LEN_PLUS_ONE(x string) length(x)+1; CREATE TEMPORARY MACRO STRING_LEN_PLUS_TWO(x string) length(x)+2; When we ran the following query, SELECT CONCAT(STRING_LEN(x), ":", STRING_LEN_PLUS_ONE(x), ":", STRING_LEN_PLUS_TWO(x)) a FROM macro_test SORT BY a DESC; We get result: 3:3:3 2:2:2 1:1:1 instead of expected: 3:4:5 2:3:4 1:2:3 Currently we are using Hive 1.2.1, and have applied both HIVE-11432 and HIVE-12277 patches. > Hive Macro overwritten when multiple macros are used in one column > ------------------------------------------------------------------ > > Key: HIVE-13372 > URL: https://issues.apache.org/jira/browse/HIVE-13372 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 1.2.1 > Reporter: Lin Liu > Assignee: Pengcheng Xiong > Priority: Critical > > When multiple macros are used in one column, results of the later ones are over written by that of the first. > For example: > Suppose we have created a table called macro_test with single column x in STRING type, and with data as: > "a" > "bb" > "ccc" > We also create three macros: > {code} > CREATE TEMPORARY MACRO STRING_LEN(x string) length(x); > CREATE TEMPORARY MACRO STRING_LEN_PLUS_ONE(x string) length(x)+1; > CREATE TEMPORARY MACRO STRING_LEN_PLUS_TWO(x string) length(x)+2; > {code} > When we ran the following query, > {code} > SELECT > CONCAT(STRING_LEN(x), ":", STRING_LEN_PLUS_ONE(x), ":", STRING_LEN_PLUS_TWO(x)) a > FROM macro_test > SORT BY a DESC; > {code} > We get result: > 3:3:3 > 2:2:2 > 1:1:1 > instead of expected: > 3:4:5 > 2:3:4 > 1:2:3 > Currently we are using Hive 1.2.1, and have applied both HIVE-11432 and HIVE-12277 patches. -- This message was sent by Atlassian JIRA (v6.3.4#6332)