Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22008

LIKE Operator should match multi-line input

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.4, 4.0.0
    • 4.0.0-alpha-1
    • Hive
    • 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)
       
       
      ------------------------------------------------- ------------------------------------------------- 
       
       

      Attachments

        1. HIVE-22008.2.patch
          3 kB
          Gopal Vijayaraghavan
        2. HIVE-22008.1.patch
          1 kB
          Gopal Vijayaraghavan

        Activity

          People

            gopalv Gopal Vijayaraghavan
            ssmane3 Shankar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: