hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "@Sanjiv Singh" <sanjiv.is...@gmail.com>
Subject Is there a Hive equivalent of SQL “LIKE ANY ( SUBQUERY )”
Date Tue, 04 Nov 2014 07:19:37 GMT
Hi ,

While Hive doesn't supports multi-value LIKE queries which are supported in
SQL : ex.

SELECT * FROM user_table WHERE first_name LIKE ANY ( 'root~%' , 'user~%' );

We can convert it into equivalent HIVE queries as :

SELECT * FROM user_table WHERE first_name LIKE 'root~%' OR first_name
LIKE 'user~%'

Does anyone know an equivalent solution that Hive does support in case
sub-query is used with LIKE ? Have a look at below example :

SELECT * FROM user_table WHERE first_name LIKE ANY ( SELECT expr FROM
exprTable);

As It doesn't have values in expression, I can't use same approach for
generating multiple LIKE expression separated with OR / AND operator.
Initially I thought to write HIVE UDF for it ? Can you please help me
supporting such expression and finding HIVE equivalent ?


Regards
Sanjiv Singh
Impetus Infotech
Mob :  +091 9990-447-339

Mime
View raw message