You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "pvary (via GitHub)" <gi...@apache.org> on 2023/02/22 15:54:44 UTC

[GitHub] [iceberg] pvary commented on a diff in pull request #6499: AWS, Core, Hive: Fix `checkCommitStatus` when create table commit fails

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


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommits.java:
##########
@@ -320,6 +326,57 @@ public void testAlreadyExistsException() {
         () -> catalog.createTable(TABLE_IDENTIFIER, schema, PartitionSpec.unpartitioned()));
   }
 
+  @Test
+  public void testCreateTableCommitThrowsUnknownException()
+      throws TException, InterruptedException {
+    String namespace = DB_NAME;
+    String tableName = getRandomName();
+    TableIdentifier tableIdentifier = TableIdentifier.of(namespace, tableName);
+
+    HiveTableOperations hiveTableOperations =
+        (HiveTableOperations) catalog.newTableOps(tableIdentifier);
+
+    String tableLocation = catalog.defaultWarehouseLocation(tableIdentifier);
+    TableMetadata metadataV1 = createTableMetadata(tableLocation);
+
+    HiveTableOperations spyOps = spy(hiveTableOperations);
+    failCommitAndThrowException(spyOps);
+
+    Assertions.assertThatThrownBy(() -> spyOps.commit(null, metadataV1))
+        .isInstanceOf(RuntimeException.class)
+        .hasMessageContaining("Datacenter on fire");
+
+    Assert.assertEquals(
+        "One metadata files should exist",
+        1,
+        metadataFileCount(tableLocation + "/writeMetaDataLoc"));

Review Comment:
   Could we just test the default Hive locations instead of changing the default behaviour and  a specifying the locations by table properties?
   
   



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