alexott commented on a change in pull request #3556: [ZEPPELIN-4488]. Support 
Flink 1.10
URL: https://github.com/apache/zeppelin/pull/3556#discussion_r370933206
 
 

 ##########
 File path: 
flink/src/main/java/org/apache/zeppelin/flink/FlinkSqlInterrpeter.java
 ##########
 @@ -176,13 +199,90 @@ private void callCommand(SqlCommandParser.SqlCommandCall 
cmdCall,
         callSelect(cmdCall.operands[0], context);
         break;
       case INSERT_INTO:
+      case INSERT_OVERWRITE:
         callInsertInto(cmdCall.operands[0], context);
         break;
+      case CREATE_TABLE:
+        callCreateTable(cmdCall.operands[0], context);
+        break;
+      case DROP_TABLE:
+        callDropTable(cmdCall.operands[0], context);
+        break;
+      case CREATE_VIEW:
+        callCreateView(cmdCall.operands[0], cmdCall.operands[1], context);
+        break;
+      case DROP_VIEW:
+        callDropView(cmdCall.operands[0], context);
+        break;
+      case CREATE_DATABASE:
+        callCreateDatabase(cmdCall.operands[0], context);
+        break;
+      case DROP_DATABASE:
+        callDropDatabase(cmdCall.operands[0], context);
+        break;
+      case ALTER_DATABASE:
+        callAlterDatabase(cmdCall.operands[0], context);
+        break;
+      case ALTER_TABLE:
+        callAlterTable(cmdCall.operands[0], context);
+        break;
       default:
         throw new Exception("Unsupported command: " + cmdCall.command);
     }
   }
 
+  private void callAlterTable(String sql, InterpreterContext context) throws 
IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Table has been modified.\n");
+  }
+
+  private void callAlterDatabase(String sql, InterpreterContext context) 
throws IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Database has been modified.\n");
+  }
+
+  private void callDropDatabase(String sql, InterpreterContext context) throws 
IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Database has been dropped.\n");
+  }
+
+  private void callCreateDatabase(String sql, InterpreterContext context) 
throws IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Database has been created.\n");
+  }
+
+  private void callDropView(String sql, InterpreterContext context) throws 
IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("View has been dropped.\n");
+  }
+
+  private void callCreateView(String name, String query, InterpreterContext 
context) {
+    this.tbenv.createTemporaryView(name, tbenv.sqlQuery(query));
+    tbenv.createTemporaryView(name, tbenv.sqlQuery(query));
+  }
+
+  private void callCreateTable(String sql, InterpreterContext context) throws 
IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Table has been created.\n");
+  }
+
+  private void callDropTable(String sql, InterpreterContext context) throws 
IOException {
+    this.tbenv.sqlUpdate(sql);
+    context.out.write("Table has been dropped.\n");
+  }
+
+  private void callUseCatalog(String catalog, InterpreterContext context) {
+    this.tbenv.useCatalog(catalog);
+  }
+
+  private void callShowModules() {
+
+  }
 
 Review comment:
   Forgotten implementation?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to