Package org.apache.druid.frame.util
Class SettableLongVirtualColumn
java.lang.Object
org.apache.druid.frame.util.SettableLongVirtualColumn
- All Implemented Interfaces:
Cacheable,VirtualColumn
Virtual column that returns a changeable value, via
setValue(long). Useful for injecting synthetic values
into a cursor, such as row numbers.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.segment.VirtualColumn
VirtualColumn.EquivalenceKey -
Constructor Summary
Constructors -
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.byte[]Get a byte array used as a cache key.Output name of this column.longgetValue()makeColumnValueSelector(String columnName, ColumnSelectorFactory factory) makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory) Returns a list of columns that this virtual column will access.voidsetValue(long theValue) booleanIndicates that this virtual column can be referenced with dot notation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.VirtualColumn
canVectorize, capabilities, getEquivalanceKey, getIndexSupplier, makeColumnValueSelector, makeColumnValueSelector, makeDimensionSelector, makeDimensionSelector, makeGroupByVectorColumnSelector, makeMultiValueVectorDimensionSelector, makeMultiValueVectorDimensionSelector, makeMultiValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeSingleValueVectorDimensionSelector, makeVectorObjectSelector, makeVectorObjectSelector, makeVectorObjectSelector, makeVectorValueSelector, makeVectorValueSelector, makeVectorValueSelector, toSelectableColumn
-
Constructor Details
-
SettableLongVirtualColumn
-
-
Method Details
-
getOutputName
Description copied from interface:VirtualColumnOutput name of this column.- Specified by:
getOutputNamein interfaceVirtualColumn- Returns:
- name
-
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
-
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
-
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.
-
getValue
public long getValue() -
setValue
public void setValue(long theValue)
-