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

0 votes


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

May 16, 2019 by anonymous

edited May 16, 2019 by Gitika 116 views

1 answer to this question.

0 votes


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, 2019 by Gitika
• 65,970 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,110 points
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, 2019 in Java by Sirajul
• 59,090 points
–1 vote
0 answers
+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, 2019 in RPA by Abha
• 28,060 points
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, 2019 in Python by anonymous
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, 2019 in RPA by Abha
• 28,060 points