Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Expert Contributor
Created on 03-13-2016 10:54 AM
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;
Comments
Master Guru
Created on 06-17-2016 03:43 AM
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
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.