pvary commented on code in PR #10112:
URL: https://github.com/apache/iceberg/pull/10112#discussion_r1560437038


##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/FlinkTestBase.java:
##########
@@ -126,4 +126,18 @@ protected void dropCatalog(String catalogName, boolean 
ifExists) {
     sql("USE CATALOG default_catalog");
     sql("DROP CATALOG %s %s", ifExists ? "IF EXISTS" : "", catalogName);
   }
+
+  /**
+   * We can not drop currently used database after FLINK-33226, so we have 
make sure that we do not
+   * use the current database before dropping it. This method creates a 
database called 'temp', uses
+   * it and drops the one requested.
+   *
+   * @param database The database to drop
+   * @param ifExists If we should use the 'IF EXISTS' when dropping the 
database
+   */
+  protected void dropDatabase(String database, boolean ifExists) {
+    sql("CREATE DATABASE IF NOT EXISTS temp");

Review Comment:
   Do we have a default database to use? I find it strange that we are creating 
a database to drop a database 😄 
   What happens in Flink if we do not create/use a database before creating a 
table?



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

Reply via email to