<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Hive2 vs Hive3 regexp_replace differences in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394525#M248738</link>
    <description>&lt;P&gt;For a hive2 cluster, I do not have to escape a double quote inside a&amp;nbsp; regexp_replace&amp;nbsp; where the&amp;nbsp; single quotes to start and end the regex.&lt;BR /&gt;But on hive3 in order for the code to work, the double quote needs to be escaped (Example to follow).&lt;BR /&gt;Why the difference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;-- Works in Hive 2 but not hive3
select  
   id
   , case when
        url rlike '(?i)^https://www.linkedin.com/("?in|pub|company|profile)' then url
            else regexp_replace(url,'^https://www.linkedin.com/','https://www.linkedin.com/in/')
     end as social_url
from db.table
limit 10

-- Works in hive3
select  
   id
   , case when
        url rlike '(?i)^https://www.linkedin.com/(\"?in|pub|company|profile)' then url
            else regexp_replace(url,'^https://www.linkedin.com/','https://www.linkedin.com/in/')
     end as social_url
from db.table
limit 10&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2024 18:34:46 GMT</pubDate>
    <dc:creator>IanWilloughby</dc:creator>
    <dc:date>2024-10-03T18:34:46Z</dc:date>
    <item>
      <title>Hive2 vs Hive3 regexp_replace differences</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394525#M248738</link>
      <description>&lt;P&gt;For a hive2 cluster, I do not have to escape a double quote inside a&amp;nbsp; regexp_replace&amp;nbsp; where the&amp;nbsp; single quotes to start and end the regex.&lt;BR /&gt;But on hive3 in order for the code to work, the double quote needs to be escaped (Example to follow).&lt;BR /&gt;Why the difference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;-- Works in Hive 2 but not hive3
select  
   id
   , case when
        url rlike '(?i)^https://www.linkedin.com/("?in|pub|company|profile)' then url
            else regexp_replace(url,'^https://www.linkedin.com/','https://www.linkedin.com/in/')
     end as social_url
from db.table
limit 10

-- Works in hive3
select  
   id
   , case when
        url rlike '(?i)^https://www.linkedin.com/(\"?in|pub|company|profile)' then url
            else regexp_replace(url,'^https://www.linkedin.com/','https://www.linkedin.com/in/')
     end as social_url
from db.table
limit 10&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 18:34:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394525#M248738</guid>
      <dc:creator>IanWilloughby</dc:creator>
      <dc:date>2024-10-03T18:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hive2 vs Hive3 regexp_replace differences</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394539#M248740</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118077"&gt;@IanWilloughby&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Hive experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70785"&gt;@Shmoo&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38161"&gt;@cravani&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 23:29:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394539#M248740</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-10-03T23:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hive2 vs Hive3 regexp_replace differences</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394634#M248772</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118077"&gt;@IanWilloughby&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Would it be possible for you to provide some sample records for the 'URL' column to help me gain a clearer understanding? Additionally, could you please share the specific versions of HIVE2 and HIVE3&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 08:02:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394634#M248772</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2024-10-07T08:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hive2 vs Hive3 regexp_replace differences</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394971#M248838</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118077"&gt;@IanWilloughby&lt;/a&gt;&amp;nbsp;If you are still experiencing the issue, can you provide the information @ggandharan has requested? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 23:28:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive2-vs-Hive3-regexp-replace-differences/m-p/394971#M248838</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-10-10T23:28:31Z</dc:date>
    </item>
  </channel>
</rss>

