riverandeye opened a new pull request, #2837:
URL: https://github.com/apache/iceberg-go/pull/2837

   The REST catalog matched the `snapshot-loading-mode` property 
case-sensitively. Java reads it as the enum names `ALL` and `REFS` and accepts 
any case. So a server that returns `"snapshot-loading-mode": "REFS"` in its 
config defaults works for Java clients, but `rest.NewCatalog` failed with 
`invalid snapshot-loading-mode "REFS"`. The same happened when the client set 
`ALL` or `Refs`.
   
   ### Cause
   
   - `fetchConfig`, which `NewCatalog` calls, compared the raw property value 
with `"all"` and `"refs"`.
   - Java parses the value with 
`SnapshotMode.valueOf(value.toUpperCase(Locale.US))`, and its default is the 
upper-case name `ALL`.
   
   ### Fix
   
   - `fetchConfig` lower-cases the value before the check. The rest of the 
client and the `snapshots` query parameter sent to the server keep using `all` 
and `refs`, as before.
   - An invalid value is still rejected. The error message now shows it in 
lower case.
   
   ### Tests
   
   - `TestSnapshotLoadingModeIgnoresCase`: sets `REFS` as a server default and 
`Refs` and `ALL` as client properties. Checks that the catalog is created, that 
the table load sends the lower-case `snapshots` parameter, and that the loaded 
table is limited to refs only for `refs`.
   


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