Class ValueVectorUtility

java.lang.Object
org.apache.arrow.vector.util.ValueVectorUtility

public class ValueVectorUtility extends Object
Utility methods for ValueVector.
  • Method Details

    • getToString

      public static <V extends ValueVector> String getToString(V vector, int start, int end)
      Get the toString() representation of vector suitable for debugging. Note since vectors may have millions of values, this method only shows max 20 values. Examples as below (v represents value):
    • vector with 0 value: []
    • vector with 5 values (no more than 20 values): [v0, v1, v2, v3, v4]
    • vector with 100 values (more than 20 values): [v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, ..., v90, v91, v92, v93, v94, v95, v96, v97, v98, v99]
    • getToString

      public static <V extends ValueVector> String getToString(V vector, int start, int end, BiFunction<V,Integer,Object> valueToString)
      Get the toString() representation of vector suitable for debugging. Note since vectors may have millions of values, this method only shows at most 20 values.
      Parameters:
      vector - the vector for which to get toString representation.
      start - the starting index, inclusive.
      end - the end index, exclusive.
      valueToString - the function to transform individual elements to strings.
    • validate

      public static void validate(ValueVector vector)
      Utility to validate vector in O(1) time.
    • validateFull

      public static void validateFull(ValueVector vector)
      Utility to validate vector in O(n) time, where n is the value count.
    • validate

      public static void validate(VectorSchemaRoot root)
      Utility to validate vector schema root in O(1) time.
    • validateFull

      public static void validateFull(VectorSchemaRoot root)
      Utility to validate vector in O(n) time, where n is the value count.
    • preAllocate

      public static void preAllocate(VectorSchemaRoot root, int targetSize)
      Pre allocate memory for BaseFixedWidthVector.
    • ensureCapacity

      public static void ensureCapacity(VectorSchemaRoot root, int targetCapacity)
      Ensure capacity for BaseFixedWidthVector.