Complete list of special characters for hive LIKE operator

20,701

You can use RLIKE (regular expression) : select * from table where column rlike '.*a\|b.*'

Share:
20,701
Mukul Gupta
Author by

Mukul Gupta

Updated on August 26, 2020

Comments

  • Mukul Gupta
    Mukul Gupta over 3 years
    select * from table where column like '%a|b%'
    

    The above query matches all rows with the column having either 'a' OR 'b' as a substring. What if I want to match the substring "a|b"? Using the query,

    select * from table where column like '%a\|b%'
    

    yields the same result.

    Can I get the complete reference for the LIKE operator in hive? The UDF manual seems insufficient.

  • Wai Ha Lee
    Wai Ha Lee over 8 years
    Can you explain your answer please? Code-only answers are liable to be deleted because they only answer the specific problem asked, and don't help others to learn how they can apply the techniques used to their own situations.