emkornfield commented on a change in pull request #10177:
URL: https://github.com/apache/arrow/pull/10177#discussion_r690522199



##########
File path: 
java/vector/src/main/java/org/apache/arrow/vector/IntervalMonthDayNanoVector.java
##########
@@ -0,0 +1,440 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.arrow.vector;
+
+import static org.apache.arrow.vector.NullCheckingForGet.NULL_CHECKING_ENABLED;
+
+import java.time.Duration;
+import java.time.Period;
+
+import org.apache.arrow.memory.ArrowBuf;
+import org.apache.arrow.memory.BufferAllocator;
+import org.apache.arrow.vector.complex.impl.IntervalMonthDayNanoReaderImpl;
+import org.apache.arrow.vector.complex.reader.FieldReader;
+import org.apache.arrow.vector.holders.IntervalMonthDayNanoHolder;
+import org.apache.arrow.vector.holders.NullableIntervalMonthDayNanoHolder;
+import org.apache.arrow.vector.types.Types.MinorType;
+import org.apache.arrow.vector.types.pojo.Field;
+import org.apache.arrow.vector.types.pojo.FieldType;
+import org.apache.arrow.vector.util.TransferPair;
+
+/**
+ * IntervalMonthDayNanoVectorimplements a fixed width vector (16 bytes) of
+ * interval (month, days and nanoseconds) values which could be null.
+ * A validity buffer (bit vector) is maintained to track which elements in the
+ * vector are null.
+ */
+public final class IntervalMonthDayNanoVector extends BaseFixedWidthVector {
+  public static final byte TYPE_WIDTH = 16;
+  private static final byte DAY_OFFSET = 4;
+  private static final byte NANOSECOND_OFFSET = 8;
+  private final FieldReader reader;
+
+
+  /**
+   * Instantiate a IntervalMonthDayNanoVector. This doesn't allocate any 
memory for
+   * the data in vector.
+   *
+   * @param name name of the vector
+   * @param allocator allocator for memory management.
+   */
+  public IntervalMonthDayNanoVector(String name, BufferAllocator allocator) {
+    this(name, FieldType.nullable(MinorType.INTERVALDAY.getType()), allocator);
+  }
+
+  /**
+   * Instantiate a IntervalMonthDayNanoVector. This doesn't allocate any 
memory for
+   * the data in vector.
+   *
+   * @param name name of the vector
+   * @param fieldType type of Field materialized by this vector
+   * @param allocator allocator for memory management.
+   */
+  public IntervalMonthDayNanoVector(String name, FieldType fieldType, 
BufferAllocator allocator) {
+    this(new Field(name, fieldType, null), allocator);
+  }
+
+  /**
+   * Instantiate a IntervalMonthDayNanoVector. This doesn't allocate any 
memory for
+   * the data in vector.
+   *
+   * @param field field materialized by this vector
+   * @param allocator allocator for memory management.
+   */
+  public IntervalMonthDayNanoVector(Field field, BufferAllocator allocator) {
+    super(field, allocator, TYPE_WIDTH);
+    reader = new 
IntervalMonthDayNanoReaderImpl(IntervalMonthDayNanoVector.this);
+  }
+
+  /**
+   * Get a reader that supports reading values from this vector.
+   *
+   * @return Field Reader for this vector
+   */
+  @Override
+  public FieldReader getReader() {
+    return reader;
+  }
+
+  /**
+   * Get minor type for this vector. The vector holds values belonging
+   * to a particular type.
+   *
+   * @return {@link org.apache.arrow.vector.types.Types.MinorType}
+   */
+  @Override
+  public MinorType getMinorType() {
+    return MinorType.INTERVALMONTHDAYNANO;
+  }
+
+
+  /*----------------------------------------------------------------*
+   |                                                                |
+   |          vector value retrieval methods                        |
+   |                                                                |
+   *----------------------------------------------------------------*/
+
+  /**
+   * Given a data buffer, get the number of months stored at a particular 
position
+   * in the vector.
+   *
+   * <p>This method should not be used externally.

Review comment:
       This unfortunately is a pattern established for integration testing 
which lives in a separate package.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to