Create view stmt throws an error when it contains a subquery

This commit fixes an issue where create view statements throw an error
if they contain subqueries. If the create view statement contains a
subquery it is not rewritten when the view is created but when its view
definition is used in a query statement.

Change-Id: I156b1a8de8fbf5acc58c2e06d2df317529abb75b
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4879
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4883