Hi,
The ORDER-BY operator is used to display the content of of a relation in a sorted order based on one or more fields.
Suppose you have a .txt file and you have LOAD the file into pig. After that, you can sort the details of that file based on any field you want. You can choose to sort by ASC or DESC manner.
For Example
grunt> file name = ORDER student_details BY age DESC;