Got it

LIKE and RLIKE

Created: Apr 30, 2022 22:41:10Latest reply: Apr 30, 2022 23:16:47 131 1 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

What is the difference between LIKE and RLIKE operators in Hive?


  • x
  • convention:

Featured Answers
wissal
MVE Created Apr 30, 2022 23:16:47

Hello,

LIKE is an operator similar to LIKE in SQL. We use LIKE to search for string with similar text.

E.g. user_name LIKE ‘%Smith’



RLIKE (Right-Like) is a special function in Hive where if any substring of A matches with B then it evaluates to true. It also obeys Java regular expression pattern. Users don't need to put % symbol for a simple match in RLIKE.

Hive provides RLIKE operator that can be used for searching advanced Regular Expressions in Java.

E.g. user_name RLIKE ‘.(Smith|Sam).’

More
https://forum.huawei.com/enterprise/en/what-is-the-difference-between-like-and-rlike-operators-in-hive/thread/595016-893#:~:text=LIKE is an operator similar,for string with similar text.&text=RLIKE (Right-Like) is,then it evaluates to true.

Thanks
View more
  • x
  • convention:

All Answers
wissal
wissal MVE Created Apr 30, 2022 23:16:47

Hello,

LIKE is an operator similar to LIKE in SQL. We use LIKE to search for string with similar text.

E.g. user_name LIKE ‘%Smith’



RLIKE (Right-Like) is a special function in Hive where if any substring of A matches with B then it evaluates to true. It also obeys Java regular expression pattern. Users don't need to put % symbol for a simple match in RLIKE.

Hive provides RLIKE operator that can be used for searching advanced Regular Expressions in Java.

E.g. user_name RLIKE ‘.(Smith|Sam).’

More
https://forum.huawei.com/enterprise/en/what-is-the-difference-between-like-and-rlike-operators-in-hive/thread/595016-893#:~:text=LIKE is an operator similar,for string with similar text.&text=RLIKE (Right-Like) is,then it evaluates to true.

Thanks
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.