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 ofNestedDataComplexColumn
which uses aCompressedVariableSizedBlobColumn
for the 'raw'StructuredData
values 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 infieldInfo
which 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.IntTypeStrategy
INT_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:
getFieldTypeInfo
in interfaceNestedCommonFormatColumn
-
getLogicalType
public ColumnType getLogicalType()
- Specified by:
getLogicalType
in interfaceNestedCommonFormatColumn
-
getNestedFields
public List<List<NestedPathPart>> getNestedFields()
Description copied from class:NestedDataComplexColumn
Get list of fields represented as a sequence ofNestedPathPart
- Specified by:
getNestedFields
in classNestedDataComplexColumn
-
getUtf8BytesDictionary
public TStringDictionary getUtf8BytesDictionary()
-
getStringDictionary
public Indexed<String> getStringDictionary()
- Specified by:
getStringDictionary
in interfaceNestedCommonFormatColumn
-
getLongDictionary
public Indexed<Long> getLongDictionary()
- Specified by:
getLongDictionary
in interfaceNestedCommonFormatColumn
-
getDoubleDictionary
public Indexed<Double> getDoubleDictionary()
- Specified by:
getDoubleDictionary
in interfaceNestedCommonFormatColumn
-
getArrayDictionary
public Indexed<Object[]> getArrayDictionary()
- Specified by:
getArrayDictionary
in interfaceNestedCommonFormatColumn
-
getNullValues
public ImmutableBitmap getNullValues()
-
getRowValue
@Nullable public Object getRowValue(int rowNum)
Description copied from interface:ComplexColumn
Return rows in the column.- Specified by:
getRowValue
in 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:ComplexColumn
Optionally overridden when complex column serialization is not based on default serialization based onGenericIndexed
inComplexColumnSerializer
.- Specified by:
makeColumnValueSelector
in interfaceBaseColumn
- Specified by:
makeColumnValueSelector
in interfaceComplexColumn
- Parameters:
offset
- object to retrieve row number- Returns:
- the
ColumnValueSelector
object
-
makeVectorObjectSelector
public VectorObjectSelector makeVectorObjectSelector(ReadableVectorOffset offset)
- Specified by:
makeVectorObjectSelector
in interfaceBaseColumn
- Specified by:
makeVectorObjectSelector
in interfaceComplexColumn
-
makeVectorValueSelector
public VectorValueSelector makeVectorValueSelector(ReadableVectorOffset offset)
- Specified by:
makeVectorValueSelector
in interfaceBaseColumn
-
getLength
public int getLength()
- Specified by:
getLength
in interfaceComplexColumn
- Returns:
- serialized size (in bytes) of this column. -1 for unknown
-
close
public void close()
Description copied from interface:ComplexColumn
Close and release any resources associated with this column.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceComplexColumn
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(List<NestedPathPart> path, ReadableOffset readableOffset, ExtractionFn fn)
Description copied from class:NestedDataComplexColumn
Make aDimensionSelector
for a nested field column- Specified by:
makeDimensionSelector
in classNestedDataComplexColumn
-
makeColumnValueSelector
public ColumnValueSelector<?> makeColumnValueSelector(List<NestedPathPart> path, ReadableOffset readableOffset)
Description copied from class:NestedDataComplexColumn
Make aColumnValueSelector
for a nested field column- Specified by:
makeColumnValueSelector
in classNestedDataComplexColumn
-
makeSingleValueDimensionVectorSelector
public SingleValueDimensionVectorSelector makeSingleValueDimensionVectorSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumn
Make aSingleValueDimensionVectorSelector
for a nested field column- Specified by:
makeSingleValueDimensionVectorSelector
in classNestedDataComplexColumn
-
makeVectorObjectSelector
public VectorObjectSelector makeVectorObjectSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumn
Make aVectorObjectSelector
for a nested field column- Specified by:
makeVectorObjectSelector
in classNestedDataComplexColumn
-
makeVectorValueSelector
public VectorValueSelector makeVectorValueSelector(List<NestedPathPart> path, ReadableVectorOffset readableOffset)
Description copied from class:NestedDataComplexColumn
Make aVectorValueSelector
for a nested field column- Specified by:
makeVectorValueSelector
in classNestedDataComplexColumn
-
getColumnTypes
@Nullable public Set<ColumnType> getColumnTypes(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumn
Get allColumnType
for the nested field column- Specified by:
getColumnTypes
in classNestedDataComplexColumn
-
getColumnHolder
@Nullable public ColumnHolder getColumnHolder(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumn
Get aColumnHolder
for a nested field column to retrieve metadata, the column itself, or indexes.- Specified by:
getColumnHolder
in classNestedDataComplexColumn
-
getColumnIndexSupplier
@Nullable public ColumnIndexSupplier getColumnIndexSupplier(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumn
Make aColumnIndexSupplier
for a nested field column- Specified by:
getColumnIndexSupplier
in classNestedDataComplexColumn
-
isNumeric
public boolean isNumeric(List<NestedPathPart> path)
Description copied from class:NestedDataComplexColumn
Shortcut 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:
isNumeric
in classNestedDataComplexColumn
-
-