Can we use LIKE operator in Hive

+1 vote
Can anyone suggest we can use LIKE operator in hive? If yes then how?
Jun 19, 2019 in Big Data Hadoop by Chandan
20,431 views

1 answer to this question.

+1 vote

Hey,

Yes, Hive supports LIKE operator, but it doesn’t support multi-value LIKE queries like below:

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

So you can easily use LIKE operator in Hive as and when you require. Also, when you have to use a multi-like operator, break it so that it can work in Hive, as shown below:

WHERE table2.product LIKE concat(‘%’, table1.brand, ‘%’)
answered Jun 19, 2019 by Gitika
• 65,770 points

Hi ,

I need to pass values directly from table, instead of passing column names, is that possible inhive?

WHERE table2.product LIKE concat(‘%’, table1.brand, ‘%’)
Instead of
WHERE table2.product LIKE concat(‘%’, select table.product from tablename table, ‘%’)
Hi

Did you try passing values directly? Try and see what happens.

Related Questions In Big Data Hadoop

0 votes
1 answer
–1 vote
1 answer

How we can run spark SQL over hive tables in our cluster?

Open spark-shell. scala> import org.apache.spark.sql.hive._ scala> val hc = ...READ MORE

answered Dec 26, 2018 in Big Data Hadoop by Omkar
• 69,220 points
1,531 views
0 votes
1 answer

Can I use pattern matching in Hive?

Yes, it is possible to use pattern ...READ MORE

answered May 21, 2019 in Big Data Hadoop by Khan
1,466 views
0 votes
1 answer

How can we configure remote metastore mode in Hive?

Hey,  Basically, hive-site.xml file has to be configured ...READ MORE

answered Jun 19, 2019 in Big Data Hadoop by Gitika
• 65,770 points
1,452 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,029 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,536 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,612 views
0 votes
1 answer

How can we use IN/EXIST operator in Hive?

Hey, Yes, now Hive supports IN or EXIST, ...READ MORE

answered Jun 19, 2019 in Big Data Hadoop by Gitika
• 65,770 points
8,684 views
0 votes
1 answer

How can we access data with simple SQL knowledge in hive?

Hey, The following examples are simple, common data ...READ MORE

answered May 16, 2019 in Big Data Hadoop by Gitika
• 65,770 points
642 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP