Package org.apache.druid.segment.virtual
Class NestedFieldVirtualColumn.RawFieldVectorObjectSelector
java.lang.Object
org.apache.druid.segment.virtual.NestedFieldVirtualColumn.RawFieldVectorObjectSelector
- All Implemented Interfaces:
VectorObjectSelector,VectorSizeInspector,VectorValueSelector
- Enclosing class:
NestedFieldVirtualColumn
public static final class NestedFieldVirtualColumn.RawFieldVectorObjectSelector
extends Object
implements VectorObjectSelector, VectorValueSelector
Process the "raw" data to extract vectors of values with
NestedPathFinder.find(Object, List), returning
a value matching an expected type.-
Constructor Summary
ConstructorsConstructorDescriptionRawFieldVectorObjectSelector(VectorObjectSelector baseSelector, List<NestedPathPart> parts, ColumnType expectedType) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the current vector size for this cursor.double[]Get the current vector, casting to doubles as necessary.float[]Get the current vector, casting to floats as necessary.long[]Get the current vector, casting to longs as necessary.intReturns the maximum vector size for this cursor.boolean[]Gets a vector of booleans signifying which rows are null and which are not (true for null).Object[]Get the current vector.
-
Constructor Details
-
RawFieldVectorObjectSelector
public RawFieldVectorObjectSelector(VectorObjectSelector baseSelector, List<NestedPathPart> parts, @Nullable ColumnType expectedType)
-
-
Method Details
-
getObjectVector
Description copied from interface:VectorObjectSelectorGet the current vector. The type of objects in the array depends on the type of the selector. Callers can determine this by callingVectorColumnSelectorFactory.getColumnCapabilities(String)if creating selectors directly. Alternatively, callers usingVectorColumnProcessorFactorywill receive capabilities as part of the callback toVectorColumnProcessorFactory.makeObjectProcessor(ColumnCapabilities, VectorObjectSelector). String selectors, where type isColumnType.STRING, must use objects compatible with the spec ofDimensionSelector.rowToObject(IndexedInts, DimensionDictionarySelector). Array selectors, whereTypeSignature.isArray(), must useObject[]. The array may contain null elements, and the array itself may also be null. Complex selectors may use any type of object. No other type of selector is possible. Vector object selectors are only used for strings, arrays, and complex types.- Specified by:
getObjectVectorin interfaceVectorObjectSelector
-
getLongVector
public long[] getLongVector()Description copied from interface:VectorValueSelectorGet the current vector, casting to longs as necessary. The array will be reused, so it is not a good idea to retain a reference to it.- Specified by:
getLongVectorin interfaceVectorValueSelector
-
getFloatVector
public float[] getFloatVector()Description copied from interface:VectorValueSelectorGet the current vector, casting to floats as necessary. The array will be reused, so it is not a good idea to retain a reference to it.- Specified by:
getFloatVectorin interfaceVectorValueSelector
-
getDoubleVector
public double[] getDoubleVector()Description copied from interface:VectorValueSelectorGet the current vector, casting to doubles as necessary. The array will be reused, so it is not a good idea to retain a reference to it.- Specified by:
getDoubleVectorin interfaceVectorValueSelector
-
getNullVector
public boolean[] getNullVector()Description copied from interface:VectorValueSelectorGets a vector of booleans signifying which rows are null and which are not (true for null). Returns null if it is known that there are no nulls in the vector, possibly because the column is non-nullable.- Specified by:
getNullVectorin interfaceVectorValueSelector
-
getMaxVectorSize
public int getMaxVectorSize()Description copied from interface:VectorSizeInspectorReturns the maximum vector size for this cursor. It will not change for the lifetime of this cursor, and is generally used to allocate scratch arrays for later processing. Will always be greater than zero.- Specified by:
getMaxVectorSizein interfaceVectorSizeInspector
-
getCurrentVectorSize
public int getCurrentVectorSize()Description copied from interface:VectorSizeInspectorReturns the current vector size for this cursor. Will never be larger than the max size returned byVectorSizeInspector.getMaxVectorSize().- Specified by:
getCurrentVectorSizein interfaceVectorSizeInspector
-