Package org.apache.arrow.vector.util
Class ValueVectorUtility
java.lang.Object
org.apache.arrow.vector.util.ValueVectorUtility
Utility methods for
ValueVector
.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
ensureCapacity
(VectorSchemaRoot root, int targetCapacity) Ensure capacity for BaseFixedWidthVector.static <V extends ValueVector>
StringgetToString
(V vector, int start, int end) Get the toString() representation of vector suitable for debugging.static <V extends ValueVector>
StringgetToString
(V vector, int start, int end, BiFunction<V, Integer, Object> valueToString) Get the toString() representation of vector suitable for debugging.static void
preAllocate
(VectorSchemaRoot root, int targetSize) Pre allocate memory for BaseFixedWidthVector.static void
validate
(ValueVector vector) Utility to validate vector in O(1) time.static void
validate
(VectorSchemaRoot root) Utility to validate vector schema root in O(1) time.static void
validateFull
(ValueVector vector) Utility to validate vector in O(n) time, where n is the value count.static void
validateFull
(VectorSchemaRoot root) Utility to validate vector in O(n) time, where n is the value count.
-
Method Details
-
getToString
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
Utility to validate vector in O(1) time. -
validateFull
Utility to validate vector in O(n) time, where n is the value count. -
validate
Utility to validate vector schema root in O(1) time. -
validateFull
Utility to validate vector in O(n) time, where n is the value count. -
preAllocate
Pre allocate memory for BaseFixedWidthVector. -
ensureCapacity
Ensure capacity for BaseFixedWidthVector.
-