[ 
https://issues.apache.org/jira/browse/HIVE-9201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14266175#comment-14266175
 ] 

Yongzhi Chen commented on HIVE-9201:
------------------------------------

Even we will support line terminator other than \n in the future, we have to 
handle the case when line terminator used in string value. Any suggestions or 
corrections for my current approach? Or any better ideas? Thanks

> Lazy functions do not handle newlines and carriage returns properly
> -------------------------------------------------------------------
>
>                 Key: HIVE-9201
>                 URL: https://issues.apache.org/jira/browse/HIVE-9201
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.14.0, 0.13.1
>            Reporter: Yongzhi Chen
>            Assignee: Yongzhi Chen
>         Attachments: HIVE-9201.1.patch
>
>
> 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)

Reply via email to