syntax - Is there a Hive equivalent of SQL "not like" -


while hive supports positive queries: ex.

select * table_name column_name like 'root~%';

hive does not support negative queries: ex.

select * table_name column_name not 'root~%';

does know equivalent solution hive support?

check out https://cwiki.apache.org/confluence/display/hive/languagemanual if haven't. reference time when i'm writing queries hive.

i haven't done i'm trying match part of word, might check out rlike (in section https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#relational_operators)

this bit of hack job, sub query check if matches positive value , case (http://wiki.apache.org/hadoop/hive/languagemanual/udf#conditional_functions) have known value main query check against see if matches or not.

another option write udf checking.

i'm brainstorming while sitting @ home no access hive, may missing obvious. :)

hope helps in fashion or another. \^_^/

edit: adding in additional method comment below.

for provided example colname rlike '[^r][^o][^o][^t]~\w' may not optimal regex, instead of sub-queries


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -