[ 
https://issues.apache.org/jira/browse/HIVE-25587?focusedWorklogId=659436&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-659436
 ]

ASF GitHub Bot logged work on HIVE-25587:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Oct/21 07:39
            Start Date: 04/Oct/21 07:39
    Worklog Time Spent: 10m 
      Work Description: 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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 659436)
    Time Spent: 1h  (was: 50m)

> 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: 1h
>  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)

Reply via email to