Github user paul-rogers commented on the issue:
https://github.com/apache/drill/pull/860
# Additional Revisions
The code contains an optimization for short queries. If the query has just
one batch then the sort need not copy that batch to produce the output.
Instead, the sort simply passes along the input batch along with an SV2. This
commit fixes some issues with transferring that single, buffered, input batch
to the sortâs output container.
While reproducing problems found by QA, it turned out to be useful to be
able to parse SQL statements from a file in the context of the test framework.
Added test methods for this purpose.
The âAllocationHelperâ class turns out to throw an exception if asked
to allocate a vector with zero elements. Since a zero-size can occasionally
come from the record batch sizer (via the âsmart allocation helperâ,
special code was added to handle this case.
Backed out some debugging code that accidentally appeared in the original
PR.
With this set of improvements, the revised, managed sort has become more
stable and reliable than the original version. As a result, this commit enables
the managed sort by default.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---