Class SettableLongVirtualColumn

java.lang.Object
org.apache.druid.frame.util.SettableLongVirtualColumn
All Implemented Interfaces:
Cacheable, VirtualColumn

public class SettableLongVirtualColumn extends Object implements VirtualColumn
Virtual column that returns a changeable value, via setValue(long). Useful for injecting synthetic values into a cursor, such as row numbers.
  • Constructor Details

    • SettableLongVirtualColumn

      public SettableLongVirtualColumn(String columnName)
  • Method Details

    • getOutputName

      public String getOutputName()
      Description copied from interface: VirtualColumn
      Output name of this column.
      Specified by:
      getOutputName in interface VirtualColumn
      Returns:
      name
    • makeDimensionSelector

      public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory)
      Specified by:
      makeDimensionSelector in interface VirtualColumn
    • makeColumnValueSelector

      public ColumnValueSelector<?> makeColumnValueSelector(String columnName, ColumnSelectorFactory factory)
      Specified by:
      makeColumnValueSelector in interface VirtualColumn
    • capabilities

      public ColumnCapabilities capabilities(String columnName)
      Description copied from interface: VirtualColumn
      This method is deprecated in favor of VirtualColumn.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 from VirtualColumn.makeColumnValueSelector(String, ColumnSelectorFactory). May vary based on columnName if this column uses dot notation.
      Specified by:
      capabilities in interface VirtualColumn
      Parameters:
      columnName - the name this virtual column was referenced with
      Returns:
      capabilities, must not be null
    • requiredColumns

      public List<String> requiredColumns()
      Description copied from interface: VirtualColumn
      Returns 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:
      requiredColumns in interface VirtualColumn
      Returns:
      column names
    • usesDotNotation

      public boolean usesDotNotation()
      Description copied from interface: VirtualColumn
      Indicates 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:
      usesDotNotation in interface VirtualColumn
      Returns:
      whether to use dot notation
    • getCacheKey

      public byte[] getCacheKey()
      Description copied from interface: Cacheable
      Get a byte array used as a cache key.
      Specified by:
      getCacheKey in interface Cacheable
      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)