geruh commented on code in PR #14702:
URL: https://github.com/apache/iceberg/pull/14702#discussion_r2572633645


##########
core/src/main/java/org/apache/iceberg/ContentFileParser.java:
##########
@@ -301,4 +291,41 @@ private static Metrics metricsFromJson(JsonNode jsonNode) {
         lowerBounds,
         upperBounds);
   }
+
+  private static void partitionToJson(
+      Types.StructType partitionType, StructLike partitionData, JsonGenerator 
generator)
+      throws IOException {
+    generator.writeStartArray();
+    List<Types.NestedField> fields = partitionType.fields();
+    for (int pos = 0; pos < fields.size(); ++pos) {
+      Types.NestedField field = fields.get(pos);
+      Object partitionValue = partitionData.get(pos, Object.class);
+      SingleValueParser.toJson(field.type(), partitionValue, generator);
+    }
+    generator.writeEndArray();
+  }
+
+  private static PartitionData partitionFromJson(
+      Types.StructType partitionType, JsonNode partitionNode) {
+    Preconditions.checkArgument(
+        partitionNode.isArray(),
+        "Invalid partition data for content file: non-array (%s)",
+        partitionNode);

Review Comment:
   Yeah, I agree. I think that's a good call. I think the important part here 
is for file scan tasks that are sent over the wire, can respect the rest spec, 
and we could have fallback for Flink.



-- 
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]

Reply via email to