You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/29 09:50:46 UTC

[GitHub] [iceberg] pvary commented on a diff in pull request #4942: [Spark][Test]: Check before creating default namespace to avoid noisy AlreadyExistsExceptions in test logs

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


##########
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/sql/TestNamespaceSQL.java:
##########
@@ -134,15 +134,9 @@ public void testListNamespace() {
 
     List<Object[]> namespaces = sql("SHOW NAMESPACES IN %s", catalogName);
 
-    if (isHadoopCatalog) {
-      Assert.assertEquals("Should have 1 namespace", 1, namespaces.size());
-      Set<String> namespaceNames = namespaces.stream().map(arr -> arr[0].toString()).collect(Collectors.toSet());
-      Assert.assertEquals("Should have only db namespace", ImmutableSet.of("db"), namespaceNames);
-    } else {
-      Assert.assertEquals("Should have 2 namespaces", 2, namespaces.size());
-      Set<String> namespaceNames = namespaces.stream().map(arr -> arr[0].toString()).collect(Collectors.toSet());
-      Assert.assertEquals("Should have default and db namespaces", ImmutableSet.of("default", "db"), namespaceNames);
-    }
+    Assert.assertEquals("Should have 2 namespaces", 2, namespaces.size());
+    Set<String> namespaceNames = namespaces.stream().map(arr -> arr[0].toString()).collect(Collectors.toSet());
+    Assert.assertEquals("Should have default and db namespaces", ImmutableSet.of("default", "db"), namespaceNames);

Review Comment:
   The question is whether the test aims to test the creation using the `CREATE NAMESPACE IF NOT EXISTS default` sql too, or the only goal was to test if the NS is created by using the catalog API.
   
   Someone with more knowledge about the Spark test could be good here.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org