You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/11 13:02:07 UTC
[GitHub] [iceberg] marton-bod commented on a change in pull request #2054: Hive: Allow auto conversion of Hive types when the CREATE TABLE statement contains a not supported type
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org