marton-bod commented on a change in pull request #2696:
URL: https://github.com/apache/hive/pull/2696#discussion_r721108666



##########
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:
       I think `testMigrationFailsForUnsupportedSourceFileFormat` already 
provides tests for unsupported source table file formats. Or do you mean having 
a test where the source table is managed AND its format is unsupported at the 
same time?




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