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 aDimensionSelectorand writes to rframe rows. SeeStringFieldReaderfor format details.
-
-
Field Summary
Fields Modifier and Type Field Description static byteNOT_NULL_BYTEstatic byteNULL_BYTEDifferent from the values inNullHandling, since we want to be able to sort as bytes, and we want nulls to come before non-nulls.static byteNULL_ROWNull rows are represented byNULL_ROW.static byteROW_TERMINATORstatic byteVALUE_TERMINATOR
-
Constructor Summary
Constructors Constructor Description StringFieldWriter(DimensionSelector selector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases resources held by this writer.longwriteTo(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_ROWcan only occur as the first byte in a row, andVALUE_TERMINATORcan 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)
-
-
Method Detail
-
writeTo
public long writeTo(org.apache.datasketches.memory.WritableMemory memory, long position, long maxSize)Description copied from interface:FieldWriterWrites the current selection at the given memory position.- Specified by:
writeToin 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:FieldWriterReleases resources held by this writer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceFieldWriter
-
-