How Sort By order will work in hive

0 votes

Hi,

I am new to hive and not able to understand and solve all the keywords. Can anyone help how Sort By keyword works?

May 16, 2019 by rana
1,185 views

1 answer to this question.

0 votes

Hey,

Sort by clause performs on column names of Hive tables to sort the output, We can mention DESC for sorting the order in descending order and mention ASC for Ascending order of the sort.

For instance, if column types are numeric it will sort in numeric order if the columns types are string it will sort in lexicographical order.

Query you can use:

SELECT * from table_name SORT BY Id DESC;
answered May 16, 2019 by Gitika
• 65,770 points

Related Questions

+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,050 points
2,106 views
0 votes
2 answers

How to sort an ArrayList of custom object by property in Java?

You can Sort using java 8 yourList.sort(Comparator.comparing(Classname::getName)); or  yourList.stream().forEach(a -> ...READ MORE

answered Aug 14, 2018 in Java by samarth295
• 2,220 points
3,335 views
0 votes
2 answers

How to sort array in descending order

there are some traditional ways that you ...READ MORE

answered Jul 4, 2018 in Java by Priyaj
• 58,020 points
1,396 views
0 votes
1 answer

If there are two joins in hive, how many mapreduce jobs will run?

There are two conditions for no. of ...READ MORE

answered Dec 19, 2018 in Big Data Hadoop by Omkar
• 69,220 points
7,115 views
0 votes
1 answer

How to sort by any measure in a Tableau table?

Hi Sindhu, Once you have created a bar ...READ MORE

answered Mar 8, 2019 in Tableau by Cherukuri
• 33,050 points
10,887 views
0 votes
0 answers

how can sort the list in increasing order of numbers in list

May 21, 2019 by anonymous
204 views
0 votes
1 answer

How to Use Order By for Multiple Columns in Laravel ?

Hii, Use order by like this: return User::orderBy('name', 'DESC') ...READ MORE

answered Nov 11, 2020 in Laravel by Niroj
• 82,840 points
28,375 views
0 votes
3 answers

How can I sort a dictionary by key in python?

Another way could be: color_dict = {'red':'#FF0000',           'green':'#008000',           'black':'#000000',           'white':'#FFFFFF'} for ...READ MORE

answered Dec 28, 2020 in Python by Thomas Walenta
1,374 views
0 votes
0 answers

How to sort an array of associative arrays by value of a given key in PHP?

Given this array: $inventory = array( ...READ MORE

Jul 24, 2022 in PHP by Kithuzzz
• 38,000 points
761 views
0 votes
0 answers

How can I sort my pre-conditions by execution in an automated test?

The question "How would I sort my ...READ MORE

Oct 15, 2024 in DevOps Tools by Anila
• 5,070 points
167 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