regexstringhiverowrlike

Extract rows from a table with regular expression hive sql


Check the table info here

Please check the link for the result and table info. I need to query rows with value '343' in Col B with a regular expression . All columns are strings . Also please be kind enough to point any good learning materials in how to write good REGEX in Hive . Thank you


Solution

  • this will work:

    select * from tablename where regexp_like(B,'(.*)(343)(.*)');
    

    hive equivalent is :

    select * from tablename where rlike(B,'(.*)(343)(.*)');