geruh opened a new pull request, #14739:
URL: https://github.com/apache/iceberg/pull/14739

   ## Summary
   
   This PR updates `ContentFileParser` to align with the REST spec for the 
content field.
   
   
https://github.com/apache/iceberg/blob/35d66a3fe8ad76e1c76b39a898d9477f1da023ae/open-api/rest-catalog-open-api.yaml#L4339-L4343
   
   Instead of writing the enum names: `DATA, POSITION_DELETES, 
EQUALITY_DELETES`, we now serialize the lowercase, hyphenated values defined in 
the REST spec.
   
   On read, the parser now accepts the rest enums but is open to accept the 
enum values of `FileContent` mentioned above. 
   
   Currently, there are bounds with the variations like mixed cases which fail 
fast but open to making this robust ignoring case.
   
   ## Testing
   
   Updated the tests to reflect the new toJson behavior.
   
   **Serialization of a `positional_delete`**
   
   Before:
   
   ```
   {
     "content": "POSITION_DELETES",
     ....
   }
   ```
   
   After:
   
   ```
   {
     "content": "position-deletes",
     ....
   }
   ```
   
   **Invalid content values fail** 
   
   Input:
   
   ```
   { "content": "DataFile" }
   ```
   
   Error:
   ```
   Invalid file content 'DataFile'
   ```


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