Interface Selectable

All Superinterfaces:
ConcurrencyControl<Selectable>
All Known Subinterfaces:
FormulaColumn, SelectColumn
All Known Implementing Classes:
AbstractFormulaColumn, ColumnName, DhFormulaColumn, FormulaColumnPython, FunctionalColumn, FunctionalColumnLong, MultiSourceFunctionalColumn, NullSelectColumn, ReinterpretedColumn, SelectColumnWithDeclaredBarriers, SelectColumnWithRespectedBarriers, SourceColumn, SwitchColumn, TableTransformationColumn

public interface Selectable extends ConcurrencyControl<Selectable>
Represents a selectable assignment for an Expression.
See Also:
  • Method Details

    • of

      static Selectable of(ColumnName newColumn, Expression expression)
    • parse

      static Selectable parse(String x)
    • from

      static List<Selectable> from(String... values)
    • from

      static List<Selectable> from(Collection<String> values)
    • newColumn

      ColumnName newColumn()
      The new column name, to be added to the new table.
      Returns:
      the new column name
    • expression

      Expression expression()
      The expression.
      Returns:
      the expression
    • respectedBarriers

      default Object[] respectedBarriers()
      Returns:
      the barriers this selectable respects
    • declaredBarriers

      default Object[] declaredBarriers()
      Returns:
      the barriers this selectable declares
    • isSerial

      default Boolean isSerial()
      Returns:
      null if this Selectable has no opinion on whether it is serial (so the system default should be used), false if this Selectable can be reordered within a column, or true if this Selectable must be evaluated in order
    • withSerial

      default Selectable withSerial()
      Description copied from interface: ConcurrencyControl
      Applies serial concurrency control to the expression.

      The serial wrapped filter/selectable is guaranteed to process exactly the set of rows as if any prior filters/selectables were applied, but it will do so in a serial manner. If this is a filter, then the expression will not evaluate additional rows or skip rows that future filters may eliminate. Take care when selecting marking filters/selectables as serial, as the operation will not be able to take advantage of powerful optimizations.

      • Concurrency impact: The expression will never be invoked concurrently with itself.
      • Intra-expression ordering impact: Rows are evaluated sequentially in row set order.
      • Inter-expression ordering impact: For a filter, serial acts as an absolute reordering barrier, ensuring that no parts of a filter are executed out of order relative to this serial wrapper.

        For selectables, additional ordering constraints are controlled by the value of the QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS. This is set by the property QueryTable.serialSelectImplicitBarriers (defaulting to the value of QueryTable.statelessSelectByDefault).

        If QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS is false, then no additional ordering between selectable expressions is imposed. As with every select or update call, if column B references column A, then the necessary inputs from column A are evaluated before column B is evaluated. To impose further ordering constraints, use barriers.

        If QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS is true, then a serial selectable is an absolute barrier with respect to all other serial selectables. This prohibits serial selectables from being evaluated concurrently, permitting them to access global state. Selectables that are not serial may be reordered with respect to a serial selectable.

      Specified by:
      withSerial in interface ConcurrencyControl<Selectable>
      Returns:
      a new instance of T with serial concurrency control applied.
    • withDeclaredBarriers

      default Selectable withDeclaredBarriers(Object... declaredBarriers)
      Description copied from interface: ConcurrencyControl
      Designates the filter/selectable as declaring the specified barrier object(s).

      A barrier does not affect concurrency but imposes an ordering constraint for the filters or selectables that respect the same barrier. When a filter/selectable is marked as respecting a barrier object, it indicates that the respecting filter/selectable will be executed entirely after the filter/selectable declaring the barrier.

      Each barrier must be unique and declared by at most one filter. Object equals and Object.hashCode() hashCode will be used to determine uniqueness and identification of barrier objects.

      Specified by:
      withDeclaredBarriers in interface ConcurrencyControl<Selectable>
      Parameters:
      declaredBarriers - the unique barrier object identifiers
      Returns:
      a new instance of T with the declaredBarriers applied
    • withRespectedBarriers

      default Selectable withRespectedBarriers(Object... respectedBarriers)
      Description copied from interface: ConcurrencyControl
      Specifies that the filter/selectable should respect the ordering constraints of the given barriers.

      Filters that define a barrier (using ConcurrencyControl.withDeclaredBarriers(Object...)) will be executed entirely before filters/selectables that respect that barrier.

      It is an error to respect a barrier that has not already been defined per the natural left to right ordering of filters/selectables at the operation level. This is to minimize the risk of user error as the API is loosely typed.

      Object equals and Object.hashCode() hashCode will be used to identify which barriers are respected.

      Specified by:
      withRespectedBarriers in interface ConcurrencyControl<Selectable>
      Parameters:
      respectedBarriers - the unique barrier object identifiers to respect
      Returns:
      a new instance of T with the respects barrier rule applied