Github user sohami commented on the issue:
https://github.com/apache/drill/pull/944
Created a separate PR for this JIRA:
https://github.com/apache/drill/pull/1040
1) I have kept the initial commit with the new PR and added new changes as
separate commit.
2) Changes include refactoring of the code, added new tests and fixes done
for the issues.---
