When multiple macros are used in one column, results of the later ones are over written by that of the first.
Suppose we have created a table called macro_test with single column x in STRING type, and with data as:
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,
CONCAT(STRING_LEN(x), ":", STRING_LEN_PLUS_ONE(x), ":", STRING_LEN_PLUS_TWO(x)) a
SORT BY a DESC;
We get result:
instead of expected:
Currently we are using Hive 1.2.1, and have applied both
HIVE-11432 and HIVE-12277 patches.