DRILL-1647: Enable rewrite rule to allow multiple flattens in s a select clause. Fixes a few outstanding issues that were the reason for disabling it.
Fix for the failed Regression test run. Was an issue with removing cast information, simply needed to return the original expression rather than try to clone it if rewriting was not needed.
Was not visiting the child of a project appropriately, this was causing complex expressions nested inside of a sub-query to fail.