[ https://issues.apache.org/jira/browse/HIVE-25587?focusedWorklogId=659408&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-659408 ]
ASF GitHub Bot logged work on HIVE-25587: ----------------------------------------- Author: ASF GitHub Bot Created on: 04/Oct/21 05:17 Start Date: 04/Oct/21 05:17 Worklog Time Spent: 10m Work Description: pvary commented on a change in pull request #2696: URL: https://github.com/apache/hive/pull/2696#discussion_r721048383 ########## 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: Do we want to have a test for unsupported fileformat? -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 659408) Time Spent: 40m (was: 0.5h) > Disable Iceberg table migration for unsupported source file formats > ------------------------------------------------------------------- > > Key: HIVE-25587 > URL: https://issues.apache.org/jira/browse/HIVE-25587 > Project: Hive > Issue Type: Improvement > Reporter: Marton Bod > Assignee: Marton Bod > Priority: Major > Labels: pull-request-available > Time Spent: 40m > Remaining Estimate: 0h > > Currently, we only support migrating ORC, Parquet and Avro tables to Iceberg. > However, there is no check in the code to fail early for other formats (e.g. > text, json, rcfile), which can lead to wasted effort at best, and leaving the > source table unusable at worst. Therefore, we should check the source format > early and shortcircuit for unsupported types. -- This message was sent by Atlassian Jira (v8.3.4#803005)