Worked around Pig bug by moving a sort.