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, 2019 by anonymous

edited May 16, 2019 by Gitika 30 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, 2019 by Gitika
• 26,310 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,090 points
1,189 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, 2019 in Java by Sirajul
• 50,440 points
222 views
0 votes
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
• 27,800 points
195 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, 2019 in Python by anonymous
173 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, 2019 in RPA by Abha
• 27,800 points
180 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,890 points
222 views