pvary commented on a change in pull request #2696:
URL: https://github.com/apache/hive/pull/2696#discussion_r721110740



##########
File path: 
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergMigration.java
##########
@@ -133,6 +135,39 @@ public void 
testRollbackMigratePartitionedBucketedHiveTableToIceberg() throws TE
     validateMigrationRollback(tableName);
   }
 
+  @Test
+  public void testMigrationFailsForUnsupportedSourceFileFormat() {
+    // enough to test once
+    Assume.assumeTrue(fileFormat == FileFormat.ORC && isVectorized &&
+        testTableType == TestTables.TestTableType.HIVE_CATALOG);
+    String tableName = "tbl_unsupported";
+    List<String> formats = ImmutableList.of("TEXTFILE", "JSONFILE", "RCFILE", 
"SEQUENCEFILE");
+    formats.forEach(format -> {
+      shell.executeStatement("CREATE EXTERNAL TABLE " +  tableName + " (a int) 
STORED AS " + format + " " +
+          testTables.locationForCreateTableSQL(TableIdentifier.of("default", 
tableName)));
+      shell.executeStatement("INSERT INTO " + tableName + " VALUES (1), (2), 
(3)");
+      AssertHelpers.assertThrows("Migrating a " + format + " table to Iceberg 
should have thrown an exception.",
+          IllegalArgumentException.class, "Cannot convert hive table to 
iceberg with input format: ",
+          () -> shell.executeStatement("ALTER TABLE " + tableName + " SET 
TBLPROPERTIES " +
+              
"('storage_handler'='org.apache.iceberg.mr.hive.HiveIcebergStorageHandler')"));
+      shell.executeStatement("DROP TABLE " + tableName);
+    });
+  }
+
+  @Test
+  public void testMigrationFailsForManagedTable() {
+    // enough to test once
+    Assume.assumeTrue(fileFormat == FileFormat.ORC && isVectorized &&

Review comment:
       Nope - I did not know we have 
`testMigrationFailsForUnsupportedSourceFileFormat`. Please disregard my comment




-- 
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: [email protected]

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