You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Yongzhi Chen (JIRA)" <ji...@apache.org> on 2014/12/23 21:06:13 UTC

[jira] [Created] (HIVE-9201) Lazy functions does not handle newlines and carriage returns properly

Yongzhi Chen created HIVE-9201:
----------------------------------

             Summary: Lazy functions does not handle newlines and carriage returns properly
                 Key: HIVE-9201
                 URL: https://issues.apache.org/jira/browse/HIVE-9201
             Project: Hive
          Issue Type: Bug
            Reporter: Yongzhi Chen


Hive returns wrong result when returning string has char \r or \n in it.  This happens when the query can trigger mapreduce jobs. 
For example, for a table named strsim with only one row:
As shown following, query 1 returns 1 row while query 2 returns 3 rows.
Query 1:
select "abc", narray from strsim LATERAL VIEW explode(array(1)) C AS narray;

Query 2:
select "a\rb\nc", narray from strsim LATERAL VIEW explode(array(1)) C AS narray;

select "abc", narray from strsim LATERAL VIEW e 
xplode(array(1)) C AS narray;
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : Job running in-process (local Hadoop)
INFO  : 2014-12-23 15:00:08,958 Stage-1 map = 0%,  reduce = 0%
INFO  : Ended Job = job_local1178499218_0015
+------+---------+--+
1 row selected (1.283 seconds)
| _c0  | narray  |
+------+---------+--+
| abc  | 1       |
+------+---------+--+


select "a\rb\nc", narray from strsim LATERAL VI 
EW explode(array(1)) C AS narray;
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : Job running in-process (local Hadoop)
INFO  : 2014-12-23 15:04:35,441 Stage-1 map = 0%,  reduce = 0%
INFO  : Ended Job = job_local1816711099_0016
+------+---------+--+
3 rows selected (1.135 seconds)
| _c0  | narray  |
+------+---------+--+
| a    | NULL    |
| b    | NULL    |
| c    | 1       |
+------+---------+--+






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)