3636
3737
3838/**
39- * NullableTimestampVector is an abstract interface for fixed width vector (8 bytes)
39+ * TimestampVector is an abstract interface for fixed width vector (8 bytes)
4040 * of timestamp values which could be null. A validity buffer (bit vector) is
4141 * maintained to track which elements in the vector are null.
4242 */
@@ -48,7 +48,7 @@ public class TimestampVector extends BaseFixedWidthVector {
4848 private final DateTimeZone timezone ;
4949
5050 /**
51- * Instantiate a NullableTimestampVector . This doesn't allocate any memory for
51+ * Instantiate a TimestampVector . This doesn't allocate any memory for
5252 * the data in vector.
5353 * @param name name of the vector
5454 * @param allocator allocator for memory management.
@@ -59,7 +59,7 @@ public TimestampVector(String name, BufferAllocator allocator, TimeUnit unit, St
5959 this (name , FieldType .nullable (new ArrowType .Timestamp (unit , timezone )), allocator );
6060 }
6161 /**
62- * Instantiate a NullableTimestampVector . This doesn't allocate any memory for
62+ * Instantiate a TimestampVector . This doesn't allocate any memory for
6363 * the data in vector.
6464 * @param name name of the vector
6565 * @param fieldType type of Field materialized by this vector
@@ -164,6 +164,22 @@ public void set(int index, long value) {
164164 setValue (index , value );
165165 }
166166
167+ public void set (int index , NullableTimestampHolder holder ) {
168+ if (holder .isSet < 0 ) {
169+ throw new IllegalArgumentException ();
170+ } else if (holder .isSet > 0 ) {
171+ BitVectorHelper .setValidityBitToOne (validityBuffer , index );
172+ setValue (index , holder .value );
173+ } else {
174+ BitVectorHelper .setValidityBit (validityBuffer , index , 0 );
175+ }
176+ }
177+
178+ public void set (int index , TimestampHolder holder ) {
179+ BitVectorHelper .setValidityBitToOne (validityBuffer , index );
180+ setValue (index , holder .value );
181+ }
182+
167183 /**
168184 * Same as {@link #set(int, long)} except that it handles the
169185 * case when index is greater than or equal to existing
@@ -187,22 +203,6 @@ public void setSafe(int index, TimestampHolder holder) {
187203 set (index , holder );
188204 }
189205
190- public void set (int index , NullableTimestampHolder holder ) {
191- if (holder .isSet < 0 ) {
192- throw new IllegalArgumentException ();
193- } else if (holder .isSet > 0 ) {
194- BitVectorHelper .setValidityBitToOne (validityBuffer , index );
195- setValue (index , holder .value );
196- } else {
197- BitVectorHelper .setValidityBit (validityBuffer , index , 0 );
198- }
199- }
200-
201- public void set (int index , TimestampHolder holder ) {
202- BitVectorHelper .setValidityBitToOne (validityBuffer , index );
203- setValue (index , holder .value );
204- }
205-
206206 /**
207207 * Set the element at the given index to null.
208208 *
0 commit comments