deniskuzZ commented on code in PR #6074: URL: https://github.com/apache/hive/pull/6074#discussion_r2355670184
########## iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java: ########## @@ -129,24 +162,42 @@ Type convertType(TypeInfo typeInfo) { StructTypeInfo structTypeInfo = (StructTypeInfo) typeInfo; List<Types.NestedField> fields = convertInternal(structTypeInfo.getAllStructFieldNames(), structTypeInfo.getAllStructFieldTypeInfos(), - Collections.emptyList()); + Collections.emptyList(), getDefaultValuesMap(defaultValue)); return Types.StructType.of(fields); case MAP: MapTypeInfo mapTypeInfo = (MapTypeInfo) typeInfo; int keyId = id++; - Type keyType = convertType(mapTypeInfo.getMapKeyTypeInfo()); + Type keyType = convertType(mapTypeInfo.getMapKeyTypeInfo(), defaultValue); int valueId = id++; - Type valueType = convertType(mapTypeInfo.getMapValueTypeInfo()); + Type valueType = convertType(mapTypeInfo.getMapValueTypeInfo(), defaultValue); return Types.MapType.ofOptional(keyId, valueId, keyType, valueType); case LIST: ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; int listId = id++; - Type listType = convertType(listTypeInfo.getListElementTypeInfo()); + Type listType = convertType(listTypeInfo.getListElementTypeInfo(), defaultValue); return Types.ListType.ofOptional(listId, listType); case VARIANT: return Types.VariantType.get(); default: throw new IllegalArgumentException("Unknown type " + typeInfo.getCategory()); } } + + private Map<String, String> getDefaultValuesMap(String defaultValue) { + if (defaultValue == null || defaultValue.isEmpty()) { Review Comment: could be simplified with `StringUtils.isEmpty()` -- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org