You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Gopal V (JIRA)" <ji...@apache.org> on 2019/07/31 06:13:00 UTC

[jira] [Commented] (HIVE-22008) Apache Hive 2.3.4 - Issue with combination of Like operator & newline (\n) character in data

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

Gopal V commented on HIVE-22008:
--------------------------------

Interestingly, this is working when it hits the ORC fast-path.

{code}
CREATE TEMPORARY TABLE SplitLines(`id` string) STORED AS ORC;
INSERT INTO SplitLines SELECT 'withdraw\ncash';
SELECT * FROM SplitLines WHERE `id` LIKE '%withdraw%cash' ORDER BY id;
SELECT count(*) FROM SplitLines WHERE `id` LIKE '%withdraw%cash';
{code}

that scenario works fine, which means this is a simple enough fix for Parquet with a simple SEL.

> Apache Hive 2.3.4 -  Issue with combination of Like operator & newline (\n) character in data
> ---------------------------------------------------------------------------------------------
>
>                 Key: HIVE-22008
>                 URL: https://issues.apache.org/jira/browse/HIVE-22008
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 4.0.0, 2.3.4
>            Reporter: Shankar
>            Assignee: Gopal V
>            Priority: Major
>
> I am facing some issues while using *Like* operator & *newline* (\n) character. Below is the in details description :
>  
>  
> {color:#263238}*-------------------------------------------------- Hive Queries ------------------------------------------------------------*{color}
> {color:#263238} – consider these are the reproduce steps.{color}
>  
> {color:#263238}create table default.withdraw({color}
> {color:#263238}id string{color}
> {color:#263238}) stored as parquet;{color}
> {color:#263238} {color}
>  
> {color:#263238}
> *insert into default.withdraw select 'withdraw\ncash';*{color}
> -- note here, added '\n' character
>  
> *{color:#263238}--1)  result = {color}{color:#6aa84f}success{color}*
> {color:#263238}hive> select * from default.withdraw where id like '%withdraw%';{color}
> {color:#263238}OK{color}
> {color:#263238}withdraw{color}
> {color:#263238}cash{color}
> {color:#263238}Time taken: 0.078 seconds, Fetched: *1 row(s)*{color}
>  
> *--2)* *{color:#263238}result = {color}{color:#cc0000}wrong{color}*
> {color:#263238}hive> select * from default.withdraw where id like '%withdraw%cash';{color}
> {color:#263238}OK{color}
> {color:#263238}Time taken: 0.066 seconds{color}
>  
> *--3)* *{color:#263238}result = {color}{color:#6aa84f}success{color}*
> {color:#263238}hive> select * from default.withdraw where id like '%cash%';{color}
> {color:#263238}OK{color}
> {color:#263238}withdraw{color}
> {color:#263238}cash{color}
> {color:#263238}Time taken: 0.086 seconds, Fetched: 1 row(s){color}
>  
>  
>  
>  
> {color:#263238}*-------------------------------------------------- Presto Queries -----------------------------------------------------*{color}
> {color:#263238}FYI - Presto (v0.221) is using above table meta store. We tested above queries on presto too. {color}
> {color:#263238} {color}
>  
> *--1)*  *{color:#263238}result ={color}* *{color:#6aa84f}success{color}*
> presto> select * from default.withdraw where id like '%withdraw%';
>    id    
> ----------
> withdraw 
> cash     
> (1 row)
>  
> *--2)* *{color:#263238}result ={color}* *{color:#6aa84f}success{color}*
> presto> select * from default.withdraw where id like '%withdraw%cash';
>    id    
> ----------
> withdraw 
> cash     
> (1 row)
>  
> *--3)* *{color:#263238}result ={color}* *{color:#6aa84f}success{color}*
> presto> select * from default.withdraw where id like '%cash%';
>    id    
> ----------
> withdraw 
> cash     
> (1 row){color:#263238}
> {color}
>  
>  
> *--------------------------------------------------* *--------------------------------------------------* 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)