LENS-102 Keeping join order same in rewritten and input query
(sushilmohanty via jdhok)