nastra commented on code in PR #9487: URL: https://github.com/apache/iceberg/pull/9487#discussion_r1458831926
########## core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java: ########## @@ -503,6 +541,78 @@ public boolean namespaceExists(Namespace namespace) { return JdbcUtil.namespaceExists(catalogName, connections, namespace); } + @Override + public boolean dropView(TableIdentifier identifier) { + int deletedRecords = + execute( + JdbcUtil.dropViewSql(), + catalogName, + JdbcUtil.namespaceToString(identifier.namespace()), + identifier.name()); + + if (deletedRecords == 0) { + LOG.info("Skipping drop, view does not exist: {}", identifier); + return false; + } + + LOG.info("Dropped view: {}", identifier); + return true; + } + + @Override + public List<TableIdentifier> listViews(Namespace namespace) { + if (!namespaceExists(namespace)) { + throw new NoSuchNamespaceException("Namespace does not exist: %s", namespace); + } + return fetch( + row -> + JdbcUtil.stringToTableIdentifier( + row.getString(JdbcUtil.VIEW_NAMESPACE), row.getString(JdbcUtil.VIEW_NAME)), + JdbcUtil.listViewsSql(), + catalogName, + JdbcUtil.namespaceToString(namespace)); + } + + @Override + public void renameView(TableIdentifier from, TableIdentifier to) { + if (!viewExists(from)) { + throw new NoSuchViewException("View does not exist"); + } + if (!namespaceExists(to.namespace())) { Review Comment: nit: the code convention (which unfortunately isn't enforced by tools) in Iceberg is to add a space after a closing } -- 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. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org