pvary commented on a change in pull request #2054:
URL: https://github.com/apache/iceberg/pull/2054#discussion_r559755676
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
##########
@@ -73,9 +79,14 @@ 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) {
+ LOG.debug("Using auto conversion from SHORT to INTEGER");
+ return Types.IntegerType.get();
+ } else {
+ throw new IllegalArgumentException("Unsupported Hive type (" +
+ ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory() +
+ ") for Iceberg tables. Consider using INT/INTEGER type
instead.");
+ }
Review comment:
The code is definitely sorter, if a little bit strange for me 😄
Changed anyway
----------------------------------------------------------------
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]