Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.4, 4.0.0
-
None
Description
I am facing some issues while using Like operator & newline (\n) character. Below is the in details description :
-------------------------------------------------- Hive Queries ------------------------------------------------------------
– consider these are the reproduce steps.
create table default.withdraw(
id string
) stored as parquet;
insert into default.withdraw select 'withdraw\ncash';
– note here, added '\n' character
--1) result = success
hive> select * from default.withdraw where id like '%withdraw%';
OK
withdraw
cash
Time taken: 0.078 seconds, Fetched: 1 row(s)
--2) result = wrong
hive> select * from default.withdraw where id like '%withdraw%cash';
OK
Time taken: 0.066 seconds
--3) result = success
hive> select * from default.withdraw where id like '%cash%';
OK
withdraw
cash
Time taken: 0.086 seconds, Fetched: 1 row(s)
-------------------------------------------------- Presto Queries -----------------------------------------------------
FYI - Presto (v0.221) is using above table meta store. We tested above queries on presto too.
--1) result = success
presto> select * from default.withdraw where id like '%withdraw%';
id
----------
withdraw
cash
(1 row)
--2) result = success
presto> select * from default.withdraw where id like '%withdraw%cash';
id
----------
withdraw
cash
(1 row)
--3) result = success
presto> select * from default.withdraw where id like '%cash%';
id
----------
withdraw
cash
(1 row)
------------------------------------------------- -------------------------------------------------