TEIID-3250 fixing the rewrite