Package org.apache.druid.segment.nested
Class CompressedNestedDataComplexColumn<TStringDictionary extends Indexed<ByteBuffer>>
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedDataComplexColumn
-
- org.apache.druid.segment.nested.CompressedNestedDataComplexColumn<TStringDictionary>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BaseColumn,ComplexColumn,NestedCommonFormatColumn
- Direct Known Subclasses:
NestedDataColumnV3,NestedDataColumnV4,NestedDataColumnV5
public abstract class CompressedNestedDataComplexColumn<TStringDictionary extends Indexed<ByteBuffer>> extends NestedDataComplexColumn implements NestedCommonFormatColumn
Implementation ofNestedDataComplexColumnwhich uses aCompressedVariableSizedBlobColumnfor the 'raw'StructuredDatavalues and provides selectors for nested field columns specified by ordered lists ofNestedPathPart.The list of available nested paths is stored in
fields, and their associated types stored infieldInfowhich can be accessed by the index of the field infields.In the case that the nested column has only a single field, and that field is the 'root' path, specified by
rootFieldPath, the selectors created for the complex column itself will use the 'root' path selectors instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.segment.nested.NestedCommonFormatColumn
NestedCommonFormatColumn.Format
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.druid.segment.nested.CompressedNestedDataComplexColumn.IntTypeStrategyINT_TYPE_STRATEGY
-
Constructor Summary
Constructors Constructor Description CompressedNestedDataComplexColumn(String columnName, ColumnType logicalType, ColumnConfig columnConfig, CompressedVariableSizedBlobColumnSupplier compressedRawColumnSupplier, ImmutableBitmap nullValues, GenericIndexed<String> fields, FieldTypeInfo fieldInfo, com.google.common.base.Supplier<TStringDictionary> stringDictionary, com.google.common.base.Supplier<FixedIndexed<Long>> longDictionarySupplier, com.google.common.base.Supplier<FixedIndexed<Double>> doubleDictionarySupplier, com.google.common.base.Supplier<FrontCodedIntArrayIndexed> arrayDictionarySupplier, SmooshedFileMapper fileMapper, BitmapSerdeFactory bitmapSerdeFactory, ByteOrder byteOrder, String rootFieldPath)
-
Method Summary
-
Methods inherited from class org.apache.druid.segment.nested.NestedDataComplexColumn
getClazz, getTypeName
-
-
-
-
Constructor Detail
-
CompressedNestedDataComplexColumn
public CompressedNestedDataComplexColumn(String columnName, ColumnType logicalType, ColumnConfig columnConfig, CompressedVariableSizedBlobColumnSupplier compressedRawColumnSupplier, ImmutableBitmap nullValues, GenericIndexed<String> fields, FieldTypeInfo fieldInfo, com.google.common.base.Supplier<TStringDictionary> stringDictionary, com.google.common.base.Supplier<FixedIndexed<Long>> longDictionarySupplier, com.google.common.base.Supplier<FixedIndexed<Double>> doubleDictionarySupplier, @Nullable com.google.common.base.Supplier<FrontCodedIntArrayIndexed> arrayDictionarySupplier, SmooshedFileMapper fileMapper, BitmapSerdeFactory bitmapSerdeFactory, ByteOrder byteOrder, String rootFieldPath)
-
-
Method Detail
-
parsePath
public abstract List<NestedPathPart> parsePath(String path)
-
getField
public abstract String getField(List<NestedPathPart> path)
-
getFieldFileName
public abstract String getFieldFileName(String fileNameBase, String field, int fieldIndex)
-
getFieldTypeInfo
public SortedMap<String,FieldTypeInfo.MutableTypeSet> getFieldTypeInfo()
- Specified by:
getFieldTypeInfoin interfaceNestedCommonFormatColumn
-
getLogicalType
public ColumnType getLogicalType()
- Specified by:
getLogicalTypein interfaceNestedCommonFormatColumn
-
getNestedFields
public List<List<NestedPathPart>> getNestedFields()
Description copied from class:NestedDataComplexColumnGet list of fields represented as a sequence ofNestedPathPart- Specified by:
getNestedFieldsin classNestedDataComplexColumn
-
getUtf8BytesDictionary
public TStringDictionary getUtf8BytesDictionary()
-
getStringDictionary
public Indexed<String> getStringDictionary()
- Specified by:
getStringDictionaryin interfaceNestedCommonFormatColumn
-
getLongDictionary
public Indexed<Long> getLongDictionary()
- Specified by:
getLongDictionaryin interfaceNestedCommonFormatColumn
-
getDoubleDictionary
public Indexed<Double> getDoubleDictionary()
- Specified by:
getDoubleDictionaryin interfaceNestedCommonFormatColumn
-
getArrayDictionary
public Indexed<Object[]> getArrayDictionary()
- Specified by:
getArrayDictionaryin interfaceNestedCommonFormatColumn
-
getNullValues
public ImmutableBitmap getNullValues()
-
getRowValue
@Nullable public Object getRowValue(int rowNum)
Description copied from interface:ComplexColumnReturn rows in the column.- Specified by:
getRowValuein interfaceComplexColumn- Parameters:
rowNum- the row number- Returns:
- row object of type same as
ComplexColumn.getClazz()} at row number "rowNum" .
-
makeColumnValueSelector
public ColumnValueSelector<?> makeColumnValueSelector(ReadableOffset offset)
Description copied from interface:ComplexColumnOptionally overridden when complex column serialization is not based on default serialization based onGenericIndexedinComplexColumnSerializer.- Specified by:
makeColumnValueSelectorin interfaceBaseColumn- Specified by:
makeColumnValueSelectorin interfaceComplexColumn- Parameters:
offset- object to retrieve row number- Returns:
- the
ColumnValueSelectorobject
-
makeVectorObjectSelector
public VectorObjectSelector makeVectorObjectSelector(ReadableVectorOffset offset)
- Specified by:
makeVectorObjectSelectorin interfaceBaseColumn- Specified by:
makeVectorObjectSelectorin interfaceComplexColumn
-
makeVectorValueSelector
public VectorValueSelector makeVectorValueSelector(ReadableVectorOffset offset)
- Specified by:
makeVectorValueSelectorin interfaceBaseColumn
-
getLength
public int getLength()
- Specified by:
getLengthin interfaceComplexColumn- Returns:
- serialized size (in bytes) of this column. -1 for unknown
-
close
public void close()
Description copied from interface:ComplexColumnClose and release any resources associated with this column.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceComplexColumn
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(List<NestedPathPart> path, ReadableOffset readableOffset, ExtractionFn fn)
Description copied from class:NestedDataComplexColumnMake aDimensionSelectorfor a nested field column- Specified by:
makeDimensionSelectorin classNestedDataComplexColumn
-
makeColumnValueSelector
public ColumnValueSelector<?> makeColumnValueSelector(List<NestedPathPart> path, ReadableOffset readableOffset)
Description copied from class:NestedDataComplexColumnMake aColumnValueSelectorfor a nested field column- Specified by:
makeColumnValueSelectorin classNestedDataComplexColumn
-
makeSingleValueDimensionVectorSelector
public SingleValueDimensionVectorSelector makeSingleValueDimensionVectorSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumnMake aSingleValueDimensionVectorSelectorfor a nested field column- Specified by:
makeSingleValueDimensionVectorSelectorin classNestedDataComplexColumn
-
makeVectorObjectSelector
public VectorObjectSelector makeVectorObjectSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumnMake aVectorObjectSelectorfor a nested field column- Specified by:
makeVectorObjectSelectorin classNestedDataComplexColumn
-
makeVectorValueSelector
public VectorValueSelector makeVectorValueSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumnMake aVectorValueSelectorfor a nested field column- Specified by:
makeVectorValueSelectorin classNestedDataComplexColumn
-
getColumnTypes
@Nullable public Set<ColumnType> getColumnTypes(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumnGet allColumnTypefor the nested field column- Specified by:
getColumnTypesin classNestedDataComplexColumn
-
getColumnHolder
@Nullable public ColumnHolder getColumnHolder(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumnGet aColumnHolderfor a nested field column to retrieve metadata, the column itself, or indexes.- Specified by:
getColumnHolderin classNestedDataComplexColumn
-
getColumnIndexSupplier
@Nullable public ColumnIndexSupplier getColumnIndexSupplier(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumnMake aColumnIndexSupplierfor a nested field column- Specified by:
getColumnIndexSupplierin classNestedDataComplexColumn
-
isNumeric
public boolean isNumeric(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumnShortcut to check if a nested field column isTypeSignature.isNumeric(), useful when broadly choosing the type of vector selector to be used when dealing with the path- Specified by:
isNumericin classNestedDataComplexColumn
-
as
@Nullable public <T> T as(Class<? extends T> clazz)
- Specified by:
asin interfaceBaseColumn
-
-