forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-35352: [Java] Fix issues with "semi complex" types.
"semi complex" types like TimeStamp*TZ, Duration, and FixedSizeBinary were missing implementations in UnionListWriter, UnionVector, UnionReader and other associated classes. This patch adds these missing methods so that these types can now be written to things like ListVectors, whereas before it would throw an exception because the methods were just not implemented. For example, without this patch, one of the new tests added would fail: ``` TestListVector.testWriterGetTimestampMilliTZField:913 ? IllegalArgument You tried to write a TimeStampMilliTZ type when you are using a ValueWriter of type UnionListWriter. ``` There are also fixes for get and set methods for holders for the respective *Vectors classes for these types: - The get methods did not set fields like TimeStampMilliTZHolder.timezone, DurationHolder.unit, FixedSizeBinaryHolder.byteWidth. - The set methods did not all validate that those fields matched what the vector's ArrowType was set to. For example TimeStampMilliTZHolder.timezone should match ArrowType.Timestamp.timezone on the vector and should throw if it doesn't. Otherwise users would never get a signal that there is anything wrong with their code writing these holders with mismatching values. This patch additionally marks some of the existing interfaces for writing these "semi complex" types as deprecated, because they do not actually provide enough context to properly write these parameterized ArrowTypes. Instead, users should use the write methods that take *Holders that do provide enough context for the writers to properly write these types. Also note that the equivalent write methods for Decimal have already also been marked as deprecated, for the same reasoning.
- Loading branch information
Showing
19 changed files
with
911 additions
and
149 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.