marton-bod commented on a change in pull request #2054:
URL: https://github.com/apache/iceberg/pull/2054#discussion_r555029102



##########
File path: 
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
##########
@@ -491,5 +497,17 @@ public void testCreateTableWithNotSupportedTypes() {
           }
       );
     }
+
+    shell.executeStatement("SET " + InputFormatConfig.SCHEMA_AUTO_CONVERSION + 
"=true");

Review comment:
       nit: you can probably use 
`shell.setHiveSessionValue(InputFormatConfig.SCHEMA_AUTO_CONVERSION, "true");` 
instead

##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
##########
@@ -73,9 +75,13 @@ Type convertType(TypeInfo typeInfo) {
             return Types.BooleanType.get();
           case BYTE:
           case SHORT:
-            throw new IllegalArgumentException("Unsupported Hive type (" +
-                ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory() +
-                ") for Iceberg tables. Consider using INT/INTEGER type 
instead.");
+            if (autoConvert) {
+              return Types.IntegerType.get();

Review comment:
       can we add some logging so we can track where autoconversion happened? 
should be useful for debugging




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