rdblue commented on a change in pull request #3912:
URL: https://github.com/apache/iceberg/pull/3912#discussion_r786301689
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaUtil.java
##########
@@ -75,7 +79,18 @@ public static Schema convert(List<FieldSchema> fieldSchemas,
boolean autoConvert
typeInfos.add(TypeInfoUtils.getTypeInfoFromTypeString(col.getType()));
comments.add(col.getComment());
}
- return HiveSchemaConverter.convert(names, typeInfos, comments,
autoConvert);
+ Set<Integer> identifierFieldIdSet = identifierFieldIdSetOrThrow(names,
identifierFieldSet);
+ return HiveSchemaConverter.convert(names, typeInfos, comments,
autoConvert, identifierFieldIdSet);
+ }
+
+ public static Set<Integer> identifierFieldIdSetOrThrow(List<String> names,
Set<String> identifierFieldSet) {
+ return identifierFieldSet.stream()
+ .map(field -> {
+ int index = names.indexOf(field);
Review comment:
Field IDs are not indexes, they are the integer identifiers embedded in
an Iceberg schema.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]