I need to use '!=' symbol in my hive query with partitions. I tried something like
from sample_table
insert overwrite table sample1
partition (src='a')
select * where act=10
insert overwrite table sample1
partition (src!='a')
select * where act=20
But it is showing error at '!=' symbol. How can i replace !=
Hive Relational Operators Returns TRUE when A is equal to B, FLASE when they are not equal. Similar to = operator. Same as = and == operator for non-null values. Returns TRUE if A is not equal to B, otherwise FALSE.
Though the IN operator in hive works just fine in this case as well but NOT IN doesn't. If I replace NOT IN with IN operator, that works. Inact using NOT IN with a list of strings specified works too but it somehow does not work with select statement.
Hey, Yes, now Hive supports IN or EXIST, operators.
Hive enables data summarization, querying, and analysis of data. Hive queries are written in HiveQL, which is a query language similar to SQL. Hive allows you to project structure on largely unstructured data. After you define the structure, you can use HiveQL to query the data without knowledge of Java or MapReduce.
Try to use rlike/regex function in hive to specify condition.
I think you can also use not operator <>
not !=
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With