You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "youngxinler (via GitHub)" <gi...@apache.org> on 2023/04/14 08:58:56 UTC

[GitHub] [iceberg] youngxinler commented on a diff in pull request #6886: Spark: allows catalog.warehouse for Spark Hive Catalogs #6863

youngxinler commented on code in PR #6886:
URL: https://github.com/apache/iceberg/pull/6886#discussion_r1166532251


##########
spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/sql/TestCreateTable.java:
##########
@@ -341,4 +343,42 @@ public void testDowngradeTableToFormatV1ThroughTablePropertyFails() {
         "Cannot downgrade v2 table to v1",
         () -> sql("ALTER TABLE %s SET TBLPROPERTIES ('format-version'='1')", tableName));
   }
+
+  @Test
+  public void testCatalogSpecificWarehouseLocation() throws Exception {
+    File warehouseLocation = temp.newFolder(catalogName);
+    Assert.assertTrue(warehouseLocation.delete());
+    String location = "file:" + warehouseLocation.getAbsolutePath();
+    spark.conf().set("spark.sql.catalog." + catalogName + ".warehouse", location);
+    String testNameSpace =
+        (catalogName.equals("spark_catalog") ? "" : catalogName + ".") + "default1";
+    String testTableName = testNameSpace + ".table";
+    TableIdentifier newTableIdentifier = TableIdentifier.of("default1", "table");
+
+    sql("CREATE NAMESPACE IF NOT EXISTS %s", testNameSpace);

Review Comment:
   because `defaultWarehouseLocation(TableIdentifier tableIdentifier)` method will return exist namespace locationUri as warehouseLocation for HiveCatalog,  we can't change exist namespace location when set warehouseLocation, so i create a new namespace.



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