vanliu-tx commented on a change in pull request #1097:
URL: https://github.com/apache/iceberg/pull/1097#discussion_r437351056



##########
File path: hive/src/test/java/org/apache/iceberg/hive/HiveTableTest.java
##########
@@ -238,6 +238,19 @@ public void testExistingTableUpdate() throws TException {
         .map(Types.NestedField::name)
         .collect(Collectors.toList());
     Assert.assertEquals(icebergColumns, hiveColumns);
+
+    // Add two columns with different types, then verify we could delete the 
first column in hive metastore
+    // as hive conf METASTORE_DISALLOW_INCOMPATIBLE_COL_TYPE_CHANGES was set 
to false. If this was set to true,
+    // an InvalidOperationException would thrown in method 
MetaStoreUtils#throwExceptionIfIncompatibleColTypeChange()
+    int columnCount = icebergTable.schema().columns().size();
+    icebergTable.updateSchema()
+            .addColumn("str1", Types.StringType.get())
+            .addColumn("int1", Types.IntegerType.get())
+            .commit();
+    Assert.assertEquals("2 columns added", columnCount + 2, 
icebergTable.schema().columns().size());
+
+    icebergTable.updateSchema().deleteColumn("str1").commit();
+    Assert.assertEquals("1 column deleted", columnCount + 1, 
icebergTable.schema().columns().size());

Review comment:
       added a new test method testColumnTypeChangeInMetastore()




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to