public class StringFieldReader extends Object implements FieldReader
StringFieldWriter or StringArrayFieldWriter.
Strings are written in UTF8 and terminated by StringFieldWriter.VALUE_TERMINATOR. Note that this byte
appears in valid UTF8 encodings if and only if the string contains a NUL (char 0). Therefore, this field writer
cannot write out strings containing NUL characters.
Rows are terminated by StringFieldWriter.ROW_TERMINATOR.
Nulls are stored as StringFieldWriter.NULL_BYTE. All other strings are prepended by
StringFieldWriter.NOT_NULL_BYTE byte to differentiate them from nulls.
This encoding allows the encoded data to be compared as bytes in a way that matches the behavior of
StringDimensionHandler.DIMENSION_SELECTOR_COMPARATOR, except null and
empty list are not considered equal.| Modifier and Type | Method and Description |
|---|---|
boolean |
isComparable()
Whether this field is comparable.
|
boolean |
isNull(org.apache.datasketches.memory.Memory memory,
long position)
Whether the provided memory position points to a null value.
|
ColumnValueSelector<?> |
makeColumnValueSelector(org.apache.datasketches.memory.Memory memory,
ReadableFieldPointer fieldPointer)
Create a
ColumnValueSelector backed by some memory and a moveable pointer. |
DimensionSelector |
makeDimensionSelector(org.apache.datasketches.memory.Memory memory,
ReadableFieldPointer fieldPointer,
ExtractionFn extractionFn)
Create a
DimensionSelector backed by some memory and a moveable pointer. |
public ColumnValueSelector<?> makeColumnValueSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer)
FieldReaderColumnValueSelector backed by some memory and a moveable pointer.makeColumnValueSelector in interface FieldReaderpublic DimensionSelector makeDimensionSelector(org.apache.datasketches.memory.Memory memory, ReadableFieldPointer fieldPointer, @Nullable ExtractionFn extractionFn)
FieldReaderDimensionSelector backed by some memory and a moveable pointer.makeDimensionSelector in interface FieldReaderpublic boolean isNull(org.apache.datasketches.memory.Memory memory,
long position)
FieldReaderisNull in interface FieldReaderpublic boolean isComparable()
FieldReaderisComparable in interface FieldReaderCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.