Package org.apache.arrow.algorithm.sort
Class DefaultVectorComparators.RepeatedValueComparator<T extends ValueVector>
java.lang.Object
org.apache.arrow.algorithm.sort.VectorValueComparator<RepeatedValueVector>
org.apache.arrow.algorithm.sort.DefaultVectorComparators.RepeatedValueComparator<T>
- Type Parameters:
T
- inner vector type.
- Enclosing class:
- DefaultVectorComparators
public static class DefaultVectorComparators.RepeatedValueComparator<T extends ValueVector>
extends VectorValueComparator<RepeatedValueVector>
Default comparator for
RepeatedValueVector
. It works by comparing the underlying vector
in a lexicographic order.-
Field Summary
Fields inherited from class org.apache.arrow.algorithm.sort.VectorValueComparator
valueWidth, vector1, vector2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachVectors
(RepeatedValueVector vector1, RepeatedValueVector vector2) Attach vectors to compare.int
compareNotNull
(int index1, int index2) Compare two values, given their indices.Creates a comparator of the same type.Methods inherited from class org.apache.arrow.algorithm.sort.VectorValueComparator
attachVector, checkNullsOnCompare, compare, getValueWidth
-
Constructor Details
-
RepeatedValueComparator
-
-
Method Details
-
compareNotNull
public int compareNotNull(int index1, int index2) Description copied from class:VectorValueComparator
Compare two values, given their indices. This is a fast path for comparing non-null values, so the caller must make sure that values at both indices are not null.- Specified by:
compareNotNull
in classVectorValueComparator<RepeatedValueVector>
- Parameters:
index1
- index of the first value to compare.index2
- index of the second value to compare.- Returns:
- an integer greater than 0, if the first value is greater; an integer smaller than 0, if the first value is smaller; or 0, if both values are equal.
-
createNew
Description copied from class:VectorValueComparator
Creates a comparator of the same type.- Specified by:
createNew
in classVectorValueComparator<RepeatedValueVector>
- Returns:
- the newly created comparator.
-
attachVectors
Description copied from class:VectorValueComparator
Attach vectors to compare.- Overrides:
attachVectors
in classVectorValueComparator<RepeatedValueVector>
- Parameters:
vector1
- the first vector to compare.vector2
- the second vector to compare.
-