Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
In the below example I create year_month and month_year vars. These each should be yyyymm and mmyyyy integer strings but it appears as if hive is calling the first function twice such that it is returning mmmm and yyyyyyyy.
hive> select
> month(a.joined) month,
> year(a.joined) year,
> concat(cast(year(a.joined) as string),cast(month(a.joined) as string)) year_month,
> concat(cast(month(a.joined) as string),cast(year(a.joined) as string)) month_year
> from a limit 20;
OK
month year year_month month_year
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
7 2014 20142014 77
Time taken: 0.109 seconds, Fetched: 20 row(s)
Other users appear to experience similar issues in this stack overflow: http://stackoverflow.com/questions/27740866/convert-date-to-decimal-format-in-hive .
I tested this in 0.13 and 0.14 and it does not appear to be an issue in 0.13.
I looked around and could not find a similar issue so hopefully this is not a duplicate.
Attachments
Issue Links
- duplicates
-
HIVE-9278 Cached expression feature broken in one case
- Closed