Repository navigation
Conversation
…plexCopier UnionMapWriter returned itself from the TimeStamp*TZ getters after key() or value(), so writes went into the entries vector and writeNull() nulled the whole entry. The getters now return the key or value field writer, as decimal() and fixedSizeBinary() do. ComplexCopier creates the key or value field with the source timezone, so TZ map keys and values are copied instead of throwing. Closes apache#1530.
jbonofre
requested review from
laurentgo,
lidavidm and
wgtmac
as code owners
November 28, 2026 09:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
Follow-up to #1414.
UnionMapWriteroverridestimeStampSecTZ(),timeStampMilliTZ(),timeStampMicroTZ()andtimeStampNanoTZ(). Afterkey()orvalue(), they return the writer of thekeyorvaluefield, asdecimal()andfixedSizeBinary()do. Before, they returned the map writer itself, so a write went into the entries vector (which was then promoted to a union) andwriteNull()nulled the whole entry. As withdecimal(), the field must already exist; it is created with its timezone bytimeStamp*TZ(MapVector.KEY_NAME or MapVector.VALUE_NAME, timezone).ComplexCopiercreates 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 throwingUnsupportedOperationException. A key or value backed by a union throws anUnsupportedOperationExceptionwith a clear message, as in the struct path.Tests
TestComplexCopier#testCopyMapOfTimeStampTZVectorreplaces the test that expected the throw. It copies a map withEurope/Parismillisecond keys andAmerica/Sao_Paulonanosecond values, including a null value and a null map, into an empty map, and compares the fields and the vectors.TestMapVector#testTimeStampTZWriterwrites TZ keys and values withUnionMapWriter, and checks that the timezones are kept and that a null value doesn't null the entry.Both tests fail on
main.Closes #1530.