Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Expert Contributor

While using Order By operator in Pig Latin,If we have not mentioned ASC or DESC , by default it sorts by ASC order.

ex- grunt >OrderedData = order studentDetails by age;

This will sort by default in ASC order.

Otherwise We can mention here as below:

OrderedData = order studentDetails by age DESC;

OrderedData = order studentDetails by age ASC;

3,676 Views
0 Kudos
Comments
avatar
Master Guru

Yes ascending is usually a default in most languages.

https://pig.apache.org/docs/r0.14.0/basic.html#order-by

Usage

Note: ORDER BY is NOT stable; if multiple records have the same ORDER BY key, the order in which these records are returned is not defined and is not guarantted to be the same from one run to the next.