stevenzwu commented on code in PR #14739:
URL: https://github.com/apache/iceberg/pull/14739#discussion_r2583705840


##########
core/src/main/java/org/apache/iceberg/ContentFileParser.java:
##########
@@ -345,4 +347,24 @@ private static PartitionData partitionFromJson(
 
     return partitionData;
   }
+
+  private static FileContent fileContentFromJson(String content) {
+    Preconditions.checkArgument(content != null, "Invalid file content: null");
+    switch (content) {
+      case "data":
+        return FileContent.DATA;
+      case "position-deletes":
+        return FileContent.POSITION_DELETES;
+      case "equality-deletes":
+        return FileContent.EQUALITY_DELETES;

Review Comment:
   it seems that the REST spec consistently use the lower case and hyphen for 
enum values. e.g.
   ```
       NullOrder:
         type: string
         enum: ["nulls-first", "nulls-last"]
   ```
   
   The `SortOrderParser` (used by `TableMetadataParser`) is consistent with the 
REST spec.
   ```
     private static String toJson(NullOrder nullOrder) {
       return nullOrder == NULLS_FIRST ? "nulls-first" : "nulls-last";
     }
   ```  
   
   So I think it makes sense to adjust the parser impl. It just need to read 
both old and new format like the other PR #14702 



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