Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Hive equivalent of SQL "not like"

While Hive supports positive like queries: ex.

select * from table_name where column_name like 'root~%';

Hive Does not support negative like queries: ex.

select * from table_name where column_name not like 'root~%';

Does anyone know an equivalent solution that Hive does support?

like image 762
CMaury Avatar asked Apr 11 '11 21:04

CMaury


People also ask

Is Hive like SQL?

Key differences between Hive and SQL: Architecture: Hive is a data warehouse project for data analysis; SQL is a programming language. (However, Hive performs data analysis via a programming language called HiveQL, similar to SQL.) Set-up: Hive is a data warehouse built on the open-source software program Hadoop.

Why is Hive faster than SQL?

While SQL Server is built to be able to respond in realtime from a single machine, hive is for processing large data sets that may span hundreds or thousands of machines. Hive (via hadoop) has a lot of overhead for starting up a job. Hive and hadoop will not cache data in memory like sql server does.


1 Answers

Try this:

Where Not (Col_Name like '%whatever%') 

also works with rlike:

Where Not (Col_Name rlike '.*whatever.*') 
like image 127
HAL9000 Avatar answered Sep 19 '22 18:09

HAL9000