Package org.apache.druid.frame.field
Class ComplexFieldReader
java.lang.Object
org.apache.druid.frame.field.ComplexFieldReader
- All Implemented Interfaces:
FieldReader
Reads values written by
ComplexFieldWriter.
Format:
- 1 byte: ComplexFieldWriter.NULL_BYTE or ComplexFieldWriter.NOT_NULL_BYTE
- 4 bytes: length of serialized complex value, little-endian int
- N bytes: serialized complex value
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComplexFieldReadercreateFromType(ColumnType columnType) booleanisNull(org.apache.datasketches.memory.Memory memory, long position) Whether the provided memory position points to a null value.makeColumnValueSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer) Create aColumnValueSelectorbacked by some memory and a moveable pointer.makeDimensionSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer, ExtractionFn extractionFn) Create aDimensionSelectorbacked by some memory and a moveable pointer.makeRACColumn(Frame frame, RowSignature signature, String columnName) Create aColumnwhich provides accses to the rows in the frame, via theColumn.toAccessor().static ObjectreadFieldFromByteArray(ComplexMetricSerde serde, byte[] bytes, int position) Alternative interface to read the field from the byte array without creating a selector and field pointer.static <T> TreadFieldFromMemory(ComplexMetricSerde serde, org.apache.datasketches.memory.Memory memory, long position) Alternative interface to read the field from the memory without creating a selector and field pointer
-
Method Details
-
createFromType
-
makeColumnValueSelector
public ColumnValueSelector<?> makeColumnValueSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer) Description copied from interface:FieldReaderCreate aColumnValueSelectorbacked by some memory and a moveable pointer.- Specified by:
makeColumnValueSelectorin interfaceFieldReader
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer, @Nullable ExtractionFn extractionFn) Description copied from interface:FieldReaderCreate aDimensionSelectorbacked by some memory and a moveable pointer.- Specified by:
makeDimensionSelectorin interfaceFieldReader
-
isNull
public boolean isNull(org.apache.datasketches.memory.Memory memory, long position) Description copied from interface:FieldReaderWhether the provided memory position points to a null value.- Specified by:
isNullin interfaceFieldReader
-
readFieldFromByteArray
@Nullable public static Object readFieldFromByteArray(ComplexMetricSerde serde, byte[] bytes, int position) Alternative interface to read the field from the byte array without creating a selector and field pointer. It is much faster than wrapping the byte array in Memory for reading. -
readFieldFromMemory
@Nullable public static <T> T readFieldFromMemory(ComplexMetricSerde serde, org.apache.datasketches.memory.Memory memory, long position) Alternative interface to read the field from the memory without creating a selector and field pointer -
makeRACColumn
Description copied from interface:FieldReaderCreate aColumnwhich provides accses to the rows in the frame, via theColumn.toAccessor().- Specified by:
makeRACColumnin interfaceFieldReader
-