Class PrefixFilteredVirtualColumn

java.lang.Object
org.apache.druid.segment.virtual.PrefixFilteredVirtualColumn
All Implemented Interfaces:
Cacheable, VirtualColumn

public class PrefixFilteredVirtualColumn extends Object implements VirtualColumn
Virtual column form of PrefixFilteredDimensionSpec
  • Constructor Details

  • Method Details

    • getOutputName

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

      public String getPrefix()
    • getDelegate

      public DimensionSpec getDelegate()
    • 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.
    • 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
    • capabilities

      @Nullable public ColumnCapabilities capabilities(ColumnInspector inspector, String columnName)
      Description copied from interface: VirtualColumn
      Return the ColumnCapabilities which best describe the optimal selector to read from this virtual column.

      The ColumnInspector (most likely corresponding to an underlying ColumnSelectorFactory of 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 the ColumnInspector to infer the output type of expressions based on the types of the inputs.

      Specified by:
      capabilities in interface VirtualColumn
      Parameters:
      inspector - column inspector to provide additional information of other available columns
      columnName - 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

      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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object