What is CLUSTER BY keyword and when can we use this keyword in hive?

0 votes

Hi,

Can anyone explain what CLUSTER BY keyword does and why we use this?

May 16 by anonymous

edited May 16 by Gitika 14 views

1 answer to this question.

0 votes

Hey,

Cluster BY clause used on tables present in Hive. Hive uses the columns in Cluster by to distribute the rows among reducers. It ensures sorting orders of values present in multiple reducers.

Query you can use:

SELECT  Id, Name from table_name CLUSTER BY Id;

Cluster By clause mentioned on the Id column name of the table table_name, The output when executing this query will give results to multiple reducers. So if we want to store results into multiple reducers, we go with Cluster By.

answered May 16 by Gitika
• 25,340 points

Related Questions

0 votes
1 answer
0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,050 points
773 views
0 votes
2 answers

What is the use of @Override annotation in Java ? When do we use it ?

@Override annotation is used when we override ...READ MORE

answered Aug 14 in Java by Sirajul
• 35,810 points
111 views
+2 votes
1 answer

what is naming convention in uipath..? why and where we use naming convention..?

Hey, it is recommend to write variable names in Camel ...READ MORE

answered Aug 13 in RPA by Abha
• 27,200 points
85 views
0 votes
1 answer

Can you explain what is the use _init_ and self in python?

Hi, The basic difference between these two are _init_ ...READ MORE

answered Aug 14 in Python by anonymous
64 views
0 votes
2 answers

what is Arguement and why we use aruement in uipath

Hey Teja, Arguments are just like Variables, they are ...READ MORE

answered Aug 19 in RPA by Abha
• 27,200 points
57 views
+1 vote
3 answers
0 votes
2 answers

When and how to use Super() keyword in Java?

super() is used to call immediate parent. super() can be ...READ MORE

answered Jul 9, 2018 in Java by Sushmita
• 6,880 points
121 views