Categories

Apr 1 in Big Data | Hadoop
Q:
Order By

Order By clause helps to sort data.

hive> select * from person;
OK
1    John    23    15000.0    IT
2    Harry    30    42000.0    HR
3    Royen    45    85000.0    PR
4    Tim    48    52000.0    IT
5    Rony    28    35000.0    HR


hive> select * from person order by salary;
Output:-
1    John    23    15000.0
5    Rony    28    35000.0
2    Harry    30    42000.0
4    Tim    48    52000.0
3    Royen    45    85000.0

Order By uses one reducer because it does the global ordering. When a large data set and data are being sent to one reducer, there will be memory issues. So the solution to this is SORT BY.

Related questions

Madanswer
Jan 10 in Big Data | Hadoop
Jan 12 in Big Data | Hadoop
Apr 1 in Big Data | Hadoop
...