jbonofre opened a new pull request, #1531:
URL: https://github.com/apache/arrow-java/pull/1531

   ## What's Changed
   
   Follow-up to #1414.
   
   - `UnionMapWriter` overrides `timeStampSecTZ()`, `timeStampMilliTZ()`, 
`timeStampMicroTZ()` and `timeStampNanoTZ()`. After `key()` or `value()`, they 
return the writer of the `key` or `value` field, as `decimal()` and 
`fixedSizeBinary()` do. Before, they returned the map writer itself, so a write 
went into the entries vector (which was then promoted to a union) and 
`writeNull()` nulled the whole entry. As with `decimal()`, the field must 
already exist; it is created with its timezone by 
`timeStamp*TZ(MapVector.KEY_NAME or MapVector.VALUE_NAME, timezone)`.
   - `ComplexCopier` creates the target key or value field with the source 
timezone, as the struct path does, so TZ map keys and values are copied instead 
of throwing `UnsupportedOperationException`. A key or value backed by a union 
throws an `UnsupportedOperationException` with a clear message, as in the 
struct path.
   
   ## Tests
   
   - `TestComplexCopier#testCopyMapOfTimeStampTZVector` replaces the test that 
expected the throw. It copies a map with `Europe/Paris` millisecond keys and 
`America/Sao_Paulo` nanosecond values, including a null value and a null map, 
into an empty map, and compares the fields and the vectors.
   - `TestMapVector#testTimeStampTZWriter` writes TZ keys and values with 
`UnionMapWriter`, and checks that the timezones are kept and that a null value 
doesn't null the entry.
   
   Both tests fail on `main`.
   
   Closes #1530.
   


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