Community Articles

Find and share helpful community-sourced technical articles.
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;

2,935 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.