Skip to content

[Java] IllegalArgumentException when unsetting TimeStamp*TZVector values #125

@rachel88888

Description

@rachel88888

Describe the bug, including details regarding any error messages, version, and platform.

In apache/arrow#35352, there was a timezone check added to the TimeStamp*TZVector.set methods that verified that the *TimeStamp*TZHolder had the same timezone as the vector that was being set.

Before this change was committed, this snippet to unset the value at an index worked:

TimeStampMicroTZVector vector = new TimeStampMicroTZVector("vector", allocator, "UTC");
NullableTimeStampMicroTZHolder holder = new NullableTimeStampMicroTZHolder();
vector.setSafe(0, holder);

However, after the change, it now throws IllegalArgumentException: holder.timezone: null not equal to vector timezone: UTC when trying to unset the value in the vector.

We currently have a workaround for this issue by explicitly setting holder.timezone = vector.getTimeZone(); before calling the setSafe method. I'm wondering if it is expected behavior to require that holder.timezone match the vector's timezone when unsetting the value. It also differs from the get behavior which does not set the timezone on the holder when the vector's value is unset. I'm happy to help submit a patch if the existing behavior is indeed unintended.

Component(s)

Java

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions