godfreyhe commented on a change in pull request #12456:
URL: https://github.com/apache/flink/pull/12456#discussion_r435732006



##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
##########
@@ -602,42 +601,22 @@ private void callDropTable(SqlCommandCall cmdCall) {
        }
 
        private void callCreateView(SqlCommandCall cmdCall) {
-               final String name = cmdCall.operands[0];
-               final String query = cmdCall.operands[1];
-
-               final ViewEntry previousView = 
executor.listViews(sessionId).get(name);
-               if (previousView != null) {
-                       
printExecutionError(CliStrings.MESSAGE_VIEW_ALREADY_EXISTS);
-                       return;
-               }
-
                try {
                        // perform and validate change
-                       executor.addView(sessionId, name, query);
+                       executor.executeSql(sessionId, cmdCall.operands[0]);
                        printInfo(CliStrings.MESSAGE_VIEW_CREATED);
                } catch (SqlExecutionException e) {
-                       // rollback change
-                       executor.removeView(sessionId, name);
                        printExecutionException(e);
                }
        }
 
        private void callDropView(SqlCommandCall cmdCall) {

Review comment:
       ditto

##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
##########
@@ -602,42 +601,22 @@ private void callDropTable(SqlCommandCall cmdCall) {
        }
 
        private void callCreateView(SqlCommandCall cmdCall) {

Review comment:
       please rebase master, and delete this method, call `callDml` method 
instead.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to