Class AbstractConditionFilter

java.lang.Object
io.deephaven.engine.table.impl.select.WhereFilterImpl
io.deephaven.engine.table.impl.select.AbstractConditionFilter
All Implemented Interfaces:
Expression, Filter, WhereFilter, Serializable
Direct Known Subclasses:
ConditionFilter

public abstract class AbstractConditionFilter extends WhereFilterImpl
See Also:
  • Field Details

    • formula

      @NotNull protected final @NotNull String formula
    • params

      protected QueryScopeParam<?>[] params
    • initialized

      protected boolean initialized
  • Constructor Details

    • AbstractConditionFilter

      protected AbstractConditionFilter(@NotNull @NotNull String formula, boolean unboxArguments)
    • AbstractConditionFilter

      protected AbstractConditionFilter(@NotNull @NotNull String formula, Map<String,String> renames, boolean unboxArguments)
  • Method Details

    • getColumns

      public List<String> getColumns()
      Description copied from interface: WhereFilter
      Get the columns required by this select filter.

      This filter must already be initialized before calling this method.

      Returns:
      the columns used as input by this select filter.
    • getColumnArrays

      public List<String> getColumnArrays()
      Description copied from interface: WhereFilter
      Get the array columns required by this select filter.

      This filter must already be initialized before calling this method.

      Returns:
      the columns used as array input by this select filter.
    • init

      public void init(@NotNull @NotNull TableDefinition tableDefinition)
      Description copied from interface: WhereFilter
      Initialize this filter given the table definition. If this filter has already been initialized, this should be a no-op, or optionally validate that the table definition is compatible with previous initialization.
      Parameters:
      tableDefinition - the definition of the table that will be filtered
    • init

      public void init(@NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull QueryCompilerRequestProcessor compilationProcessor)
      Description copied from interface: WhereFilter
      Initialize this select filter given the table definition
      Parameters:
      tableDefinition - the definition of the table that will be filtered
      compilationProcessor - the processor to use for compilation
    • validateSafeForRefresh

      public void validateSafeForRefresh(BaseTable<?> sourceTable)
      Description copied from interface: WhereFilter
      Validate that this WhereFilter is safe to use in the context of the provided sourceTable.
      Parameters:
      sourceTable - the source table
    • generateFilterCode

      protected abstract void generateFilterCode(@NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull TimeLiteralReplacedExpression timeConversionResult, @NotNull QueryLanguageParser.Result result, @NotNull @NotNull QueryCompilerRequestProcessor compilationProcessor) throws MalformedURLException, ClassNotFoundException
      Throws:
      MalformedURLException
      ClassNotFoundException
    • filter

      @NotNull public @NotNull WritableRowSet filter(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet fullSet, @NotNull @NotNull Table table, boolean usePrev)
      Description copied from interface: WhereFilter
      Filter selection to only matching rows.
      Parameters:
      selection - the indices that should be filtered. The selection must be a subset of fullSet, and may include rows that the engine determines need not be evaluated to produce the result. Implementations may not mutate or close selection.
      fullSet - the complete RowSet of the table to filter. The fullSet is used for calculating variables like "i" or "ii". Implementations may not mutate or close fullSet.
      table - the table to filter
      usePrev - true if previous values should be used. Implementing previous value filtering is optional, and a WhereFilter.PreviousFilteringNotSupported exception may be thrown. If a PreviousFiltering exception is thrown, then the caller must acquire the PeriodicUpdateGraph lock.
      Returns:
      The subset of selection accepted by this filter; ownership passes to the caller
    • getFilter

      Throws:
      InstantiationException
      IllegalAccessException
      NoSuchMethodException
      InvocationTargetException
    • setFilter

      protected abstract void setFilter(AbstractConditionFilter.Filter filter)
      When numba vectorized functions are used to evaluate query filters, we need to create a special ChunkFilter that can handle packing and unpacking arrays required/returned by the vectorized function, essentially bypassing the regular code generation process which isn't able to support such use cases without needing some major rework.
      Parameters:
      filter - the filter to set
    • setRecomputeListener

      public void setRecomputeListener(WhereFilter.RecomputeListener listener)
      Description copied from interface: WhereFilter
      Set the WhereFilter.RecomputeListener that should be notified if results based on this WhereFilter must be recomputed.
      Parameters:
      listener - The WhereFilter.RecomputeListener to notify
    • copy

      public abstract AbstractConditionFilter copy()
      Description copied from interface: WhereFilter
      Create a copy of this WhereFilter.
      Returns:
      an independent copy of this WhereFilter.
    • onCopy

      protected void onCopy(AbstractConditionFilter copy)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSimpleFilter

      public boolean isSimpleFilter()
      Returns:
      true if this is a filter that does not require any code execution, but rather is handled entirely within the database engine.
    • hasConstantArrayAccess

      public boolean hasConstantArrayAccess()
      Returns:
      true if the formula expression of the filter has Array Access that conforms to "i +/- <constant>" or "ii +/- <constant>".
    • hasVirtualRowVariables

      public boolean hasVirtualRowVariables()
      Description copied from interface: WhereFilter
      Returns true if this filter uses row virtual offset columns of i, ii or k.
    • getFormulaShiftColPair

      public Pair<String,Map<Long,List<MatchPair>>> getFormulaShiftColPair()
      Returns:
      a Pair object, consisting of formula string and shift to column MatchPairs, if the filter formula or expression has Array Access that conforms to "i +/- <constant>" or "ii +/- <constant>". If there is a parsing error for the expression null is returned.
    • renameFilter

      public abstract AbstractConditionFilter renameFilter(Map<String,String> renames)