alamb opened a new pull request, #10506:
URL: https://github.com/apache/arrow-rs/pull/10506

   # Which issue does this PR close?
   
   N/A
   
   # Rationale for this change
   
   #10297 changed the default map field names from `keys`/`values` to 
`key`/`value` to match the Arrow spec. This is a good change to align with the 
spec, but it is a breaking change: it broke the DataFusion upgrade 
(https://github.com/apache/datafusion/pull/24030) because data produced 
elsewhere (e.g. by other Arrow implementations) uses the old `keys`/`values` 
field names, causing schema mismatches such as:
   
   ```
   InvalidArgumentError("Incorrect datatype for StructArray field \"metadata\", 
expected Map(\"entries\": non-null Struct(\"keys\": non-null Utf8, \"values\": 
Utf8), unsorted) got Map(\"entries\": non-null Struct(\"key\": non-null Utf8, 
\"value\": Utf8), unsorted)")
   ```
   
   See discussion on #10297: 
https://github.com/apache/arrow-rs/pull/10297#issuecomment-5147036600
   
   We should hold the field name change for the next breaking release to 
minimize downstream churn on a minor release, rather than ship it in a minor 
release.
   
   # What changes are included in this PR?
   
   - Reverts b963ecf64745367274a4903f73a49b52958e412d (#10297), restoring the 
default map field names to `keys`/`values` (plural).
   - Updates a test added by #10475 after #10297 merged 
(`test_map_non_nullable_value` in `arrow-json/src/reader/mod.rs`) that 
referenced the constants removed by this revert, so it now uses literal field 
names consistent with the restored defaults.
   
   # Are these changes tested?
   
   Existing tests.
   
   # Are there any user-facing changes?
   
   Yes: this reverts the default `MapFieldNames` back to `keys`/`values` (as it 
was prior to #10297), rather than `key`/`value`. The intent is to reapply 
#10297 as part of the next breaking release.


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

Reply via email to