Package org.apache.druid.segment.nested
Class NestedDataColumnSerializer
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
-
- org.apache.druid.segment.nested.NestedDataColumnSerializer
-
- All Implemented Interfaces:
GenericColumnSerializer<StructuredData>
,Serializer
public class NestedDataColumnSerializer extends NestedCommonFormatColumnSerializer
Serializer forNestedCommonFormatColumn
which can store nested data. The serializer stores several components including: - a field list and associated type info - value dictionaries for string, long, double, and array values (where the arrays are stored as int[] that point to the string, long, and double values) - raw data is stored with aCompressedVariableSizedBlobColumnSerializer
as blobs of SMILE encoded data - a null value bitmap to track which 'raw' rows are null For each nested field, aGlobalDictionaryEncodedFieldColumnWriter
will write a sub-column to specialize fast reading and filtering of that path.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
ARRAY_DICTIONARY_FILE_NAME, ARRAY_ELEMENT_BITMAP_INDEX_FILE_NAME, ARRAY_ELEMENT_DICTIONARY_FILE_NAME, BITMAP_INDEX_FILE_NAME, DOUBLE_DICTIONARY_FILE_NAME, DOUBLE_VALUE_COLUMN_FILE_NAME, ENCODED_VALUE_COLUMN_FILE_NAME, LONG_DICTIONARY_FILE_NAME, LONG_VALUE_COLUMN_FILE_NAME, NESTED_FIELD_PREFIX, NULL_BITMAP_FILE_NAME, RAW_FILE_NAME, STRING_DICTIONARY_FILE_NAME, V0
-
-
Constructor Summary
Constructors Constructor Description NestedDataColumnSerializer(String name, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getColumnName()
DictionaryIdLookup
getGlobalLookup()
long
getSerializedSize()
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher)
call.boolean
hasNulls()
void
open()
void
openDictionaryWriter()
void
serialize(ColumnValueSelector<? extends StructuredData> selector)
void
serializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays)
void
serializeFields(SortedMap<String,FieldTypeInfo.MutableTypeSet> fields)
void
writeTo(WritableByteChannel channel, FileSmoosher smoosher)
Writes serialized form of this object to the given channel.-
Methods inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
computeFilenameBytes, getInternalFileName, writeInternal, writeInternal, writeV0Header
-
-
-
-
Constructor Detail
-
NestedDataColumnSerializer
public NestedDataColumnSerializer(String name, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
-
Method Detail
-
getColumnName
public String getColumnName()
- Specified by:
getColumnName
in classNestedCommonFormatColumnSerializer
-
getGlobalLookup
public DictionaryIdLookup getGlobalLookup()
- Specified by:
getGlobalLookup
in classNestedCommonFormatColumnSerializer
-
hasNulls
public boolean hasNulls()
- Specified by:
hasNulls
in classNestedCommonFormatColumnSerializer
-
openDictionaryWriter
public void openDictionaryWriter() throws IOException
- Specified by:
openDictionaryWriter
in classNestedCommonFormatColumnSerializer
- Throws:
IOException
-
open
public void open() throws IOException
- Throws:
IOException
-
serializeFields
public void serializeFields(SortedMap<String,FieldTypeInfo.MutableTypeSet> fields) throws IOException
- Overrides:
serializeFields
in classNestedCommonFormatColumnSerializer
- Throws:
IOException
-
serializeDictionaries
public void serializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays) throws IOException
- Specified by:
serializeDictionaries
in classNestedCommonFormatColumnSerializer
- Throws:
IOException
-
serialize
public void serialize(ColumnValueSelector<? extends StructuredData> selector) throws IOException
- Throws:
IOException
-
getSerializedSize
public long getSerializedSize() throws IOException
Description copied from interface:Serializer
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher)
call.- Throws:
IOException
-
writeTo
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
Description copied from interface:Serializer
Writes serialized form of this object to the given channel. If parallel data streams are needed, they could be created with the provided smoosher.- Throws:
IOException
-
-