Shankar created DRILL-7328:
------------------------------
Summary: Issue with combination of Like operator & newline (\n)
character in data
Key: DRILL-7328
URL: https://issues.apache.org/jira/browse/DRILL-7328
Project: Apache Drill
Issue Type: Bug
Components: Server
Affects Versions: 1.16.0
Reporter: Shankar
Below is the in details description of issue and reproduce steps as well :
{color:#263238}*-------------------------------------------------- Hive Queries
------------------------------------------------------------*{color}
{color:#263238} {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, we have 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:#59afe1}+( I
also saw that hive 2.3.4 also have issue here, But same query is working in
Presto, MySQL, redshift)+{color}{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}*-------------------------------------------------- Drill
Queries -----------------------------------------------------*{color}
Tested on Drill version - 1.16.0 (Docker). I used hive plugin and above
mentioned hive table.
Here are the Drill queries and its outputs:
{color:#263238} {color}
*--1)* *{color:#263238}result = {color}{color:#6aa84f}success{color}*
apache drill> select * from hive.default.withdraw;
+---------------+
| id |
+---------------+
| withdraw
cash |
+---------------+
1 row selected (0.189 seconds)
*--2)* *{color:#263238}result = {color}{color:#6aa84f}success{color}*
apache drill> select * from hive.default.withdraw where id like '%withdraw%';
+---------------+
| id |
+---------------+
| withdraw
cash |
+---------------+
1 row selected (0.168 seconds)
*--3)* *{color:#263238}result = {color}{color:#cc0000}wrong{color}*
apache drill> select * from hive.default.withdraw where id like
'%withdraw%cash';
+----+
| id |
+----+
+----+
No rows selected (0.214 seconds)
*--4)* *{color:#263238}result = {color}{color:#6aa84f}success{color}*
apache drill> select * from hive.default.withdraw where id like '%cash%';
+---------------+
| id |
+---------------+
| withdraw
cash |
+---------------+
1 row selected (0.181 seconds)
*--------------------------------------------------*
*--------------------------------------------------*
Please help here in case i am missing anything.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)