difin commented on code in PR #5248:
URL: https://github.com/apache/hive/pull/5248#discussion_r1650240600
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java:
##########
@@ -345,4 +370,120 @@ public static PartitionData toPartitionData(StructLike
key, Types.StructType key
return data;
}
+ public static PartitionData toPartitionData(StructLike sourceKey,
Types.StructType sourceKeyType,
+ Types.StructType targetKeyType) {
+ PartitionData data = new PartitionData(targetKeyType);
+ for (int i = 0; i < targetKeyType.fields().size(); i++) {
+
+ int fi = i;
+ sourceKeyType.fields().stream()
+ .filter(f -> f.name().equals(targetKeyType.fields().get(fi).name()))
+ .findFirst().map(sourceKeyElem -> {
Review Comment:
Done
--
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]