GerardDellemann commented on a change in pull request #225: METAMODEL-1217 - 
Fixes dropping JDBC Tables with view as TableType
URL: https://github.com/apache/metamodel/pull/225#discussion_r312814112
 
 

 ##########
 File path: 
jdbc/src/main/java/org/apache/metamodel/jdbc/JdbcDropTableBuilder.java
 ##########
 @@ -63,10 +64,15 @@ public void execute() {
     }
 
     protected String createSqlStatement() {
-        FromItem fromItem = new FromItem(getTable());
-        String tableLabel = _queryRewriter.rewriteFromItem(fromItem);
+        final Table table = getTable();
+        final FromItem fromItem = new FromItem(table);
+        final String tableLabel = _queryRewriter.rewriteFromItem(fromItem);
 
-        return "DROP TABLE " + tableLabel;
+        if (table.getType() != null && table.getType() == TableType.VIEW) {
+            return "DROP VIEW " + tableLabel;
 
 Review comment:
   I'll change the variable name.

----------------------------------------------------------------
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