Package org.apache.druid.frame.field
Class StringFieldWriter
- java.lang.Object
-
- org.apache.druid.frame.field.StringFieldWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,FieldWriter
public class StringFieldWriter extends Object implements FieldWriter
Wraps aDimensionSelector
and writes to rframe rows. SeeStringFieldReader
for format details.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
NOT_NULL_BYTE
static byte
NULL_BYTE
Different from the values inNullHandling
, since we want to be able to sort as bytes, and we want nulls to come before non-nulls.static byte
NULL_ROW
Null rows are represented byNULL_ROW
.static byte
ROW_TERMINATOR
static byte
VALUE_TERMINATOR
-
Constructor Summary
Constructors Constructor Description StringFieldWriter(DimensionSelector selector, boolean removeNullbytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Releases resources held by this writer.long
writeTo(org.apache.datasketches.memory.WritableMemory memory, long position, long maxSize)
Writes the current selection at the given memory position.
-
-
-
Field Detail
-
VALUE_TERMINATOR
public static final byte VALUE_TERMINATOR
- See Also:
- Constant Field Values
-
ROW_TERMINATOR
public static final byte ROW_TERMINATOR
- See Also:
- Constant Field Values
-
NULL_ROW
public static final byte NULL_ROW
Null rows are represented byNULL_ROW
. Same byte value asVALUE_TERMINATOR
, but not ambiguous:NULL_ROW
can only occur as the first byte in a row, andVALUE_TERMINATOR
can never occur as the first byte in a row.- See Also:
- Constant Field Values
-
NULL_BYTE
public static final byte NULL_BYTE
Different from the values inNullHandling
, since we want to be able to sort as bytes, and we want nulls to come before non-nulls.- See Also:
- Constant Field Values
-
NOT_NULL_BYTE
public static final byte NOT_NULL_BYTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringFieldWriter
public StringFieldWriter(DimensionSelector selector, boolean removeNullbytes)
-
-
Method Detail
-
writeTo
public long writeTo(org.apache.datasketches.memory.WritableMemory memory, long position, long maxSize)
Description copied from interface:FieldWriter
Writes the current selection at the given memory position.- Specified by:
writeTo
in interfaceFieldWriter
- Parameters:
memory
- memory region in little-endian orderposition
- position to writemaxSize
- maximum number of bytes to write- Returns:
- number of bytes written, or -1 if "maxSize" was not enough memory
-
close
public void close()
Description copied from interface:FieldWriter
Releases resources held by this writer.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFieldWriter
-
-