Package org.apache.druid.frame.field
Class FloatFieldWriter
- java.lang.Object
-
- org.apache.druid.frame.field.NumericFieldWriter
-
- org.apache.druid.frame.field.FloatFieldWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,FieldWriter
public class FloatFieldWriter extends NumericFieldWriter
Wraps aBaseFloatColumnValueSelectorand writes field values.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.frame.field.NumericFieldWriter
ARRAY_ELEMENT_NOT_NULL_BYTE, ARRAY_ELEMENT_NULL_BYTE, NOT_NULL_BYTE, NULL_BYTE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases resources held by this writer.static FloatFieldWriterforArray(BaseFloatColumnValueSelector selector)static FloatFieldWriterforPrimitive(BaseFloatColumnValueSelector selector)intgetNumericSizeBytes()voidwriteNullToMemory(org.apache.datasketches.memory.WritableMemory memory, long position)Writes the default value for the type to the memory.voidwriteSelectorToMemory(org.apache.datasketches.memory.WritableMemory memory, long position)Writes the value pointed by the selector to memory.-
Methods inherited from class org.apache.druid.frame.field.NumericFieldWriter
writeTo
-
-
-
-
Method Detail
-
forPrimitive
public static FloatFieldWriter forPrimitive(BaseFloatColumnValueSelector selector)
-
forArray
public static FloatFieldWriter forArray(BaseFloatColumnValueSelector selector)
-
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- Overrides:
closein classNumericFieldWriter
-
getNumericSizeBytes
public int getNumericSizeBytes()
- Specified by:
getNumericSizeBytesin classNumericFieldWriter- Returns:
- The size in bytes of the numeric datatype that the implementation of this writer occupies
-
writeSelectorToMemory
public void writeSelectorToMemory(org.apache.datasketches.memory.WritableMemory memory, long position)Description copied from class:NumericFieldWriterWrites the value pointed by the selector to memory. The caller should ensure that the selector gives out the correct primitive type- Specified by:
writeSelectorToMemoryin classNumericFieldWriter
-
writeNullToMemory
public void writeNullToMemory(org.apache.datasketches.memory.WritableMemory memory, long position)Description copied from class:NumericFieldWriterWrites the default value for the type to the memory. For long, it is 0L, for double, it is 0.0d etc. Useful mainly when the SQL incompatible mode is turned off, and maintains the fact that the size of the numeric field written doesn't vary irrespective of whether the value is null- Specified by:
writeNullToMemoryin classNumericFieldWriter
-
-