Drill 1145

Change needed for DRILL-1145. This pull request has extra change from Jinfeng which is not pushed into your github drill_wip branch.