The managed external sort was introduced in
DRILL-5080. Since that time, extensive testing has identified a number of minor fixes and improvements. Given the long PR cycles, it is not practical to spend a week or two to do a PR for each fix individually. This ticket represents a roll-up of a combination of a number of fixes. Small fixes are listed here, larger items appear as sub-tasks.