Package org.apache.druid.segment.virtual
Class ListFilteredVirtualColumn
java.lang.Object
org.apache.druid.segment.virtual.ListFilteredVirtualColumn
- All Implemented Interfaces:
Cacheable,VirtualColumn
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.segment.VirtualColumn
VirtualColumn.EquivalenceKey -
Constructor Summary
ConstructorsConstructorDescriptionListFilteredVirtualColumn(String name, DimensionSpec delegate, Set<String> values, Boolean isAllowList) -
Method Summary
Modifier and TypeMethodDescriptioncapabilities(String columnName) This method is deprecated in favor ofVirtualColumn.capabilities(ColumnInspector, String), which should be used whenever possible and can support virtual column implementations that need to inspect other columns as inputs.capabilities(ColumnInspector inspector, String columnName) Return theColumnCapabilitieswhich best describe the optimal selector to read from this virtual column.booleanbyte[]Get a byte array used as a cache key.getIndexSupplier(String columnName, ColumnIndexSelector indexSelector) Get theColumnIndexSupplierof the specified virtual column, with the assistance of aColumnSelectorto allow reading things from segments.Output name of this column.inthashCode()booleanmakeColumnValueSelector(String columnName, ColumnSelectorFactory factory) makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory) Returns a list of columns that this virtual column will access.toString()booleanIndicates that this virtual column can be referenced with dot notation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.segment.VirtualColumn
canVectorize, getEquivalanceKey, makeColumnValueSelector, makeColumnValueSelector, makeDimensionSelector, makeDimensionSelector, makeGroupByVectorColumnSelector, makeMultiValueVectorDimensionSelector, makeMultiValueVectorDimensionSelector, makeMultiValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeVectorObjectSelector, makeVectorObjectSelector, makeVectorObjectSelector, makeVectorValueSelector, makeVectorValueSelector, makeVectorValueSelector, toSelectableColumn
-
Constructor Details
-
ListFilteredVirtualColumn
public ListFilteredVirtualColumn(String name, DimensionSpec delegate, Set<String> values, @Nullable Boolean isAllowList)
-
-
Method Details
-
getOutputName
Description copied from interface:VirtualColumnOutput name of this column.- Specified by:
getOutputNamein interfaceVirtualColumn- Returns:
- name
-
getValues
-
isAllowList
public boolean isAllowList() -
getDelegate
-
getCacheKey
public byte[] getCacheKey()Description copied from interface:CacheableGet a byte array used as a cache key.- Specified by:
getCacheKeyin interfaceCacheable- Returns:
- bytes to be used as cache key - or null if this object should not be cached.
-
makeDimensionSelector
public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory) - Specified by:
makeDimensionSelectorin interfaceVirtualColumn
-
makeColumnValueSelector
public ColumnValueSelector<?> makeColumnValueSelector(String columnName, ColumnSelectorFactory factory) - Specified by:
makeColumnValueSelectorin interfaceVirtualColumn
-
capabilities
Description copied from interface:VirtualColumnThis method is deprecated in favor ofVirtualColumn.capabilities(ColumnInspector, String), which should be used whenever possible and can support virtual column implementations that need to inspect other columns as inputs. This is a fallback implementation to return the capabilities of this virtual column, which includes a type that corresponds to the best performing base selector supertype (e. g.BaseLongColumnValueSelector) of the object, returned fromVirtualColumn.makeColumnValueSelector(String, ColumnSelectorFactory). May vary based on columnName if this column uses dot notation.- Specified by:
capabilitiesin interfaceVirtualColumn- Parameters:
columnName- the name this virtual column was referenced with- Returns:
- capabilities, must not be null
-
capabilities
Description copied from interface:VirtualColumnReturn theColumnCapabilitieswhich best describe the optimal selector to read from this virtual column.The
ColumnInspector(most likely corresponding to an underlyingColumnSelectorFactoryof a query) allows the virtual column to consider this information if necessary to compute its output type details.Examples of this include the
ExpressionVirtualColumn, which takes input from other columns and uses theColumnInspectorto infer the output type of expressions based on the types of the inputs.- Specified by:
capabilitiesin interfaceVirtualColumn- Parameters:
inspector- column inspector to provide additional information of other available columnscolumnName- the name this virtual column was referenced with- Returns:
- capabilities, or null if the column should be treated as if it doesn't exist.
-
requiredColumns
Description copied from interface:VirtualColumnReturns a list of columns that this virtual column will access. This may include the names of other virtual columns. May be empty if a virtual column doesn't access any underlying columns. Does not pass columnName because there is an assumption that the list of columns needed by a dot-notation supporting virtual column will not vary based on the columnName.- Specified by:
requiredColumnsin interfaceVirtualColumn- Returns:
- column names
-
usesDotNotation
public boolean usesDotNotation()Description copied from interface:VirtualColumnIndicates that this virtual column can be referenced with dot notation. For example, a virtual column named "foo" could be referred to as "foo.bar" with the Cursor it is registered with. In that case, init will be called with columnName "foo.bar" rather than "foo".- Specified by:
usesDotNotationin interfaceVirtualColumn- Returns:
- whether to use dot notation
-
getIndexSupplier
@Nullable public ColumnIndexSupplier getIndexSupplier(String columnName, ColumnIndexSelector indexSelector) Description copied from interface:VirtualColumnGet theColumnIndexSupplierof the specified virtual column, with the assistance of aColumnSelectorto allow reading things from segments. Returns null if the virtual column wants to act like a missing column. ReturnsNoIndexesColumnIndexSupplier.getInstance()if the virtual column does not support indexes and wants cursor-based filtering.- Specified by:
getIndexSupplierin interfaceVirtualColumn
-
equals
-
hashCode
public int hashCode() -
toString
-