Interface TableOperations<TOPS extends TableOperations<TOPS,​TABLE>,​TABLE>

Type Parameters:
TOPS - the table operations type
TABLE - the table type
All Known Subinterfaces:
InputTable, Join, LazySnapshotTable, PartitionedTable.Proxy, SelectableTable, SingleParentTable, Table, TableAdapter, TableDefaults, TableOperationsDefaults<TOPS,​TABLE>, TableSpec
All Known Implementing Classes:
AggregateAllTable, AggregateTable, AppendOnlyArrayBackedMutableTable, AsOfJoinTable, BarrageRedirectedTable, BarrageStreamTable, BarrageTable, BaseTable, ByTableBase, DeferredViewTable, EmptyTable, ExactJoinTable, HeadTable, InitialSnapshotTable, InMemoryAppendOnlyInputTable, InMemoryKeyBackedInputTable, InMemoryTable, InputTableBase, JoinBase, JoinTable, KeyedArrayBackedMutableTable, LazyUpdateTable, MergeTable, NaturalJoinTable, NewTable, PartitionAwareSourceTable, QueryReplayGroupedTable, QueryTable, QueryTable.FilteredTable, RedefinableTable, ReplayGroupedFullTable, ReplayLastByGroupedTable, ReplayTable, ReverseAsOfJoinTable, ReverseTable, SelectDistinctTable, SelectTable, SimpleSourceTable, SnapshotTable, SnapshotWhenTable, SortTable, SourceTable, StackTraceMixIn, TableBase, TableHandle, TableOperationsAdapter, TableSpecAdapter, TailTable, TicketTable, TimeTable, TimeTable, UncoalescedTable, UngroupTable, UpdatableTable, UpdateByTable, UpdateSourceQueryTable, UpdateTable, UpdateViewTable, ViewTable, WhereInTable, WhereTable

public interface TableOperations<TOPS extends TableOperations<TOPS,​TABLE>,​TABLE>
Table operations is a user-accessible api for modifying tables or building up table operations.
  • Field Details

    • AGG_BY_PRESERVE_EMPTY_DEFAULT

      static final boolean AGG_BY_PRESERVE_EMPTY_DEFAULT
      See Also:
      Constant Field Values
  • Method Details

    • head

      @ConcurrentMethod TOPS head​(long size)
    • tail

      @ConcurrentMethod TOPS tail​(long size)
    • reverse

    • snapshot

      TOPS snapshot()
      Creates a table with a single static snapshot of this.
      Returns:
      the snapshot
    • snapshotWhen

      TOPS snapshotWhen​(TABLE trigger, SnapshotWhenOptions.Flag... features)
      Creates a table that captures a snapshot of this whenever trigger updates.

      Equivalent to snapshotWhen(trigger, SnapshotWhenControl.of(features)).

      Parameters:
      trigger - the trigger table
      features - the snapshot features
      Returns:
      the snapshotting table
      See Also:
      snapshotWhen(Object, SnapshotWhenOptions), SnapshotWhenOptions.of(Flag...)
    • snapshotWhen

      TOPS snapshotWhen​(TABLE trigger, Collection<SnapshotWhenOptions.Flag> features, String... stampColumns)
      Creates a table that captures a snapshot of this whenever trigger updates.

      Equivalent to snapshotWhen(trigger, SnapshotWhenControl.of(features, stampColumns)).

      See SnapshotWhenOptions for details on the stampColumns.

      Parameters:
      trigger - the trigger table
      features - the snapshot features
      stampColumns - the stamp columns
      Returns:
      the snapshotting table
      See Also:
      snapshotWhen(Object, SnapshotWhenOptions), SnapshotWhenOptions.of(Iterable, String...)
    • snapshotWhen

      TOPS snapshotWhen​(TABLE trigger, SnapshotWhenOptions options)
      Creates a table that captures a snapshot of this whenever trigger updates.
      Parameters:
      trigger - the trigger table
      options - the snapshot options
      Returns:
      the snapshotting table
      See Also:
      SnapshotWhenOptions
    • sort

      @ConcurrentMethod TOPS sort​(String... columnsToSortBy)
    • sortDescending

      @ConcurrentMethod TOPS sortDescending​(String... columnsToSortBy)
    • sort

      @ConcurrentMethod TOPS sort​(Collection<SortColumn> columnsToSortBy)
    • where

      @ConcurrentMethod TOPS where​(String... filters)
    • where

      @ConcurrentMethod TOPS where​(Collection<? extends Filter> filters)
    • whereIn

      TOPS whereIn​(TABLE rightTable, String... columnsToMatch)
      Filters this table based on the set of values in the rightTable.

      Delegates to whereIn(Object, Collection).

      Parameters:
      rightTable - the filtering table.
      columnsToMatch - the columns to match between the two tables
      Returns:
      a new table filtered on right table
    • whereIn

      TOPS whereIn​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch)
      Filters this table based on the set of values in the rightTable.

      Note that when the rightTable ticks, all of the rows in this table are going to be re-evaluated, thus the intention is that the rightTable is fairly slow moving compared with this table.

      Parameters:
      rightTable - the filtering table.
      columnsToMatch - the columns to match between the two tables
      Returns:
      a new table filtered on right table
    • whereNotIn

      TOPS whereNotIn​(TABLE rightTable, String... columnsToMatch)
      Filters this table based on the set of values not in the rightTable.

      Delegates to whereNotIn(Object, Collection).

      Parameters:
      rightTable - the filtering table.
      columnsToMatch - the columns to match between the two tables
      Returns:
      a new table filtered on right table
    • whereNotIn

      TOPS whereNotIn​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch)
      Filters this table based on the set of values not in the rightTable.

      Note that when the rightTable ticks, all of the rows in this table are going to be re-evaluated, thus the intention is that the rightTable is fairly slow moving compared with this table.

      Parameters:
      rightTable - the filtering table.
      columnsToMatch - the columns to match between the two tables
      Returns:
      a new table filtered on right table
    • view

      @ConcurrentMethod TOPS view​(String... columns)
    • view

      @ConcurrentMethod TOPS view​(Collection<? extends Selectable> columns)
    • updateView

      @ConcurrentMethod TOPS updateView​(String... columns)
    • updateView

      @ConcurrentMethod TOPS updateView​(Collection<? extends Selectable> columns)
    • update

      TOPS update​(String... columns)
    • update

      TOPS update​(Collection<? extends Selectable> columns)
    • lazyUpdate

      TOPS lazyUpdate​(String... columns)
      Compute column formulas on demand.

      Delegates to lazyUpdate(Collection).

      Parameters:
      columns - the columns to add
      Returns:
      a new Table with the columns added; to be computed on demand
    • lazyUpdate

      TOPS lazyUpdate​(Collection<? extends Selectable> columns)
      Compute column formulas on demand.

      Lazy update defers computation until required for a set of values, and caches the results for a set of input values. This uses less RAM than an update statement when you have a smaller set of unique values. Less computation than an updateView is needed, because the results are saved in a cache.

      If you have many unique values, you should instead use an update statement, which will have more memory efficient structures. Values are never removed from the lazyUpdate cache, so it should be used judiciously on a ticking table.

      Parameters:
      columns - the columns to add
      Returns:
      a new Table with the columns added; to be computed on demand
    • select

      TOPS select​(String... columns)
    • select

      TOPS select​(Collection<? extends Selectable> columns)
    • naturalJoin

      TOPS naturalJoin​(TABLE rightTable, String columnsToMatch)
      Perform an natural-join with the rightTable.

      Delegates to naturalJoin(Object, Collection, Collection).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      Returns:
      the natural-joined table
    • naturalJoin

      TOPS naturalJoin​(TABLE rightTable, String columnsToMatch, String columnsToAdd)
      Perform a natural-join with the rightTable.

      Delegates to naturalJoin(Object, Collection, Collection).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      columnsToAdd - A comma separated list with the columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      the natural-joined table
    • naturalJoin

      TOPS naturalJoin​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Perform an exact-join with the rightTable.

      Requires zero or one match from the rightTable.

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      the natural-joined table
    • exactJoin

      TOPS exactJoin​(TABLE rightTable, String columnsToMatch)
      Perform an exact-join with the rightTable.

      Delegates to exactJoin(Object, Collection, Collection).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      Returns:
      the exact-joined table
    • exactJoin

      TOPS exactJoin​(TABLE rightTable, String columnsToMatch, String columnsToAdd)
      Perform an exact-join with the rightTable.

      Delegates to exactJoin(Object, Collection, Collection).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      columnsToAdd - A comma separated list with the columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      the exact-joined table
    • exactJoin

      TOPS exactJoin​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Perform an exact-join with the rightTable.

      Similar to naturalJoin(Object, Collection, Collection), but requires that exactly one match from the rightTable.

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      the exact-joined table
    • join

      TOPS join​(TABLE rightTable, String columnsToMatch)
      Perform a cross join with the rightTable.

      Delegates to join(Object, Collection, Collection, int).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      Returns:
      a new table joined according to the specification in columnsToMatch and includes all non-key-columns from the right table
      See Also:
      join(Object, Collection, Collection, int)
    • join

      TOPS join​(TABLE rightTable, String columnsToMatch, String columnsToAdd)
      Perform a cross join with the rightTable.

      Delegates to join(Object, Collection, Collection, int).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth")
      columnsToAdd - A comma separated list with the columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
      See Also:
      join(Object, Collection, Collection, int)
    • join

      TOPS join​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Perform a cross join with the rightTable.

      Delegates to join(Object, Collection, Collection, int).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • join

      TOPS join​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd, int reserveBits)
      Perform a cross join with the rightTable.

      Returns a table that is the cartesian product of left rows X right rows, with one column for each of this table's columns, and one column corresponding to each of the rightTable's columns that are included in the columnsToAdd argument. The rows are ordered first by the this table then by the rightTable. If columnsToMatch is non-empty then the product is filtered by the supplied match conditions.

      To efficiently produce updates, the bits that represent a key for a given row are split into two. Unless specified, join reserves 16 bits to represent a right row. When there are too few bits to represent all of the right rows for a given aggregation group the table will shift a bit from the left side to the right side. The default of 16 bits was carefully chosen because it results in an efficient implementation to process live updates.

      An io.deephaven.engine.table.impl.util.OutOfKeySpaceException is thrown when the total number of bits needed to express the result table exceeds that needed to represent Long.MAX_VALUE. There are a few work arounds:

      - If the left table is sparse, consider flattening the left table.

      - If there are no key-columns and the right table is sparse, consider flattening the right table.

      - If the maximum size of a right table's group is small, you can reserve fewer bits by setting reserveBits on initialization.

      Note: If you know that a given group has at most one right-row then you should prefer using naturalJoin(Object, Collection, Collection).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      reserveBits - The number of bits to reserve for rightTable groups.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • aj

      TOPS aj​(TABLE rightTable, String columnsToMatch)
      Perform an as-of join with the rightTable.

      Delegates to aj(Object, Collection, Collection, AsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth").
      Returns:
      a new table joined according to the specification in columnsToMatch
    • aj

      TOPS aj​(TABLE rightTable, String columnsToMatch, String columnsToAdd)
      Perform an as-of join with the rightTable.

      Delegates to aj(Object, Collection, Collection, AsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth").
      columnsToAdd - A comma separated list with the columns from the left side that need to be added to the right side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • aj

      TOPS aj​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Perform an as-of join with the rightTable.

      Delegates to aj(Object, Collection, Collection, AsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • aj

      TOPS aj​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd, AsOfJoinRule asOfJoinRule)
      Perform an as-of join with the rightTable.

      Looks up the columns in the rightTable that meet the match conditions in columnsToMatch. Matching is done exactly for the first n-1 columns and via a binary search for the last match pair. The columns of the this table are returned intact, together with the columns from rightTable defined in the columnsToAdd.

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      asOfJoinRule - The binary search operator for the last match pair.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • raj

      TOPS raj​(TABLE rightTable, String columnsToMatch)
      Perform an reverse-as-of join with the rightTable.

      Delegates to raj(Object, Collection, Collection, ReverseAsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth").
      Returns:
      a new table joined according to the specification in columnsToMatch
    • raj

      TOPS raj​(TABLE rightTable, String columnsToMatch, String columnsToAdd)
      Perform a reverse-as-of join with the rightTable.

      Delegates to raj(Object, Collection, Collection, ReverseAsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - A comma separated list of match conditions ("leftColumn=rightColumn" or "columnFoundInBoth").
      columnsToAdd - A comma separated list with the columns from the left side that need to be added to the right side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • raj

      TOPS raj​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Perform a reverse-as-of join with the rightTable.

      Delegates to raj(Object, Collection, Collection, ReverseAsOfJoinRule).

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • raj

      TOPS raj​(TABLE rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd, ReverseAsOfJoinRule reverseAsOfJoinRule)
      Perform a reverse-as-of join with the rightTable.

      Just like aj(Object, Collection, Collection, AsOfJoinRule), but the matching on the last column is in reverse order, so that you find the row after the given timestamp instead of the row before.

      Looks up the columns in the rightTable that meet the match conditions in columnsToMatch. Matching is done exactly for the first n-1 columns and via a binary search for the last match pair. The columns of this table are returned intact, together with the columns from rightTable defined in columnsToAdd.

      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      reverseAsOfJoinRule - The binary search operator for the last match pair.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • groupBy

    • groupBy

      @ConcurrentMethod TOPS groupBy​(String... groupByColumns)
    • groupBy

      @ConcurrentMethod TOPS groupBy​(Collection<? extends ColumnName> groupByColumns)
    • aggAllBy

      @ConcurrentMethod TOPS aggAllBy​(AggSpec spec)
    • aggAllBy

      @ConcurrentMethod TOPS aggAllBy​(AggSpec spec, String... groupByColumns)
    • aggAllBy

      @ConcurrentMethod TOPS aggAllBy​(AggSpec spec, ColumnName... groupByColumns)
    • aggAllBy

      @ConcurrentMethod TOPS aggAllBy​(AggSpec spec, Collection<String> groupByColumns)
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Aggregation aggregation)
      Produce an aggregated result by grouping all rows from this into a single group of rows and applying aggregation to the result. The result table will have one row if this has one or more rows, or else zero rows.
      Parameters:
      aggregation - The aggregation to apply
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Collection<? extends Aggregation> aggregations)
      Produce an aggregated result by grouping all rows from this into a single group of rows and applying aggregations to the result. The result table will have one row if this has one or more rows, or else zero rows.
      Parameters:
      aggregations - The aggregations to apply
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Collection<? extends Aggregation> aggregations, boolean preserveEmpty)
      Produce an aggregated result by grouping all rows from this into a single group of rows and applying aggregations to the result.
      Parameters:
      aggregations - The aggregations to apply
      preserveEmpty - If preserveEmpty == true, the result table will always have one row. Otherwise, the result table will have one row if this has one or more rows, or else zero rows.
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Aggregation aggregation, String... groupByColumns)
      Produce an aggregated result by grouping this according to the groupByColumns and applying aggregation to each resulting group of rows. The result table will have one row per group, ordered by the encounter order within this, thereby ensuring that the row key for a given group never changes. Groups that become empty will be removed from the result.
      Parameters:
      aggregation - The aggregation to apply
      groupByColumns - The columns to group by
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Aggregation aggregation, Collection<? extends ColumnName> groupByColumns)
      Produce an aggregated result by grouping this according to the groupByColumns and applying aggregation to each resulting group of rows. The result table will have one row per group, ordered by the encounter order within this, thereby ensuring that the row key for a given group never changes. Groups that become empty will be removed from the result.
      Parameters:
      aggregation - The aggregation to apply
      groupByColumns - The columns to group by
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Collection<? extends Aggregation> aggregations, String... groupByColumns)
      Produce an aggregated result by grouping this according to the groupByColumns and applying aggregations to each resulting group of rows. The result table will have one row per group, ordered by the encounter order within this, thereby ensuring that the row key for a given group never changes. Groups that become empty will be removed from the result.
      Parameters:
      aggregations - The aggregations to apply
      groupByColumns - The columns to group by
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Collection<? extends Aggregation> aggregations, Collection<? extends ColumnName> groupByColumns)
      Produce an aggregated result by grouping this according to the groupByColumns and applying aggregations to each resulting group of rows. The result table will have one row per group, ordered by the encounter order within this, thereby ensuring that the row key for a given group never changes. Groups that become empty will be removed from the result.
      Parameters:
      aggregations - The aggregations to apply
      groupByColumns - The columns to group by
      Returns:
      A new table aggregating the rows of this
    • aggBy

      @ConcurrentMethod TOPS aggBy​(Collection<? extends Aggregation> aggregations, boolean preserveEmpty, TABLE initialGroups, Collection<? extends ColumnName> groupByColumns)
      Produce an aggregated result by grouping this according to the groupByColumns and applying aggregations to each resulting group of rows. The result table will have one row per group, ordered by the encounter order within this, thereby ensuring that the row key for a given group never changes.
      Parameters:
      aggregations - The aggregations to apply
      preserveEmpty - Whether to keep result rows for groups that are initially empty or become empty as a result of updates. Each aggregation operator defines its own value for empty groups.
      initialGroups - A table whose distinct combinations of values for the groupByColumns should be used to create an initial set of aggregation groups. All other columns are ignored. This is useful in combination with preserveEmpty == true to ensure that particular groups appear in the result table, or with preserveEmpty == false to control the encounter order for a collection of groups and thus their relative order in the result. Changes to initialGroups are not expected or handled; if initialGroups is a refreshing table, only its contents at instantiation time will be used. If initialGroups == null, the result will be the same as if a table with no rows was supplied.
      groupByColumns - The columns to group by
      Returns:
      A new table aggregating the rows of this
    • updateBy

      @ConcurrentMethod TOPS updateBy​(UpdateByOperation operation)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results over the entire table.
      Parameters:
      operation - the operation to apply to the table.
      Returns:
      a table with the same rowset, with the specified operation applied to the entire table
    • updateBy

      @ConcurrentMethod TOPS updateBy​(Collection<? extends UpdateByOperation> operations)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results over the entire table.
      Parameters:
      operations - the operations to apply to the table.
      Returns:
      a table with the same rowset, with the specified operations applied to the entire table.
    • updateBy

      @ConcurrentMethod TOPS updateBy​(UpdateByControl control, Collection<? extends UpdateByOperation> operations)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results over the entire table.
      Parameters:
      control - the control to use when updating the table.
      operations - the operations to apply to the table.
      Returns:
      a table with the same rowset, with the specified operations applied to the entire table
    • updateBy

      @ConcurrentMethod TOPS updateBy​(UpdateByOperation operation, String... byColumns)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results for the row group (as determined by the byColumns).
      Parameters:
      operation - the operation to apply to the table.
      byColumns - the columns to group by before applying.
      Returns:
      a table with the same rowSet, with the specified operation applied to each group defined by the byColumns
    • updateBy

      @ConcurrentMethod TOPS updateBy​(Collection<? extends UpdateByOperation> operations, String... byColumns)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results for the row group (as determined by the byColumns).
      Parameters:
      operations - the operations to apply to the table.
      byColumns - the columns to group by before applying.
      Returns:
      a table with the same rowSet, with the specified operations applied to each group defined by the byColumns
    • updateBy

      @ConcurrentMethod TOPS updateBy​(Collection<? extends UpdateByOperation> operations, Collection<? extends ColumnName> byColumns)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results for the row group (as determined by the byColumns).
      Parameters:
      operations - the operations to apply to the table.
      byColumns - the columns to group by before applying.
      Returns:
      a table with the same rowSet, with the specified operations applied to each group defined by the byColumns
    • updateBy

      @ConcurrentMethod TOPS updateBy​(UpdateByControl control, Collection<? extends UpdateByOperation> operations, Collection<? extends ColumnName> byColumns)
      Creates a table with additional columns calculated from window-based aggregations of columns in its parent. The aggregations are defined by the operations, which support incremental aggregation over the corresponding rows in the parent table. The aggregations will apply position or time-based windowing and compute the results for the row group (as determined by the byColumns).
      Parameters:
      control - the control to use when updating the table.
      operations - the operations to apply to the table.
      byColumns - the columns to group by before applying.
      Returns:
      a table with the same rowSet, with the specified operations applied to each group defined by the byColumns
    • selectDistinct

      @ConcurrentMethod TOPS selectDistinct()
    • selectDistinct

      @ConcurrentMethod TOPS selectDistinct​(String... columns)
    • selectDistinct

      @ConcurrentMethod TOPS selectDistinct​(Selectable... columns)
    • selectDistinct

      @ConcurrentMethod TOPS selectDistinct​(Collection<? extends Selectable> columns)
    • countBy

      @ConcurrentMethod TOPS countBy​(String countColumnName)
    • countBy

      @ConcurrentMethod TOPS countBy​(String countColumnName, String... groupByColumns)
    • countBy

      @ConcurrentMethod TOPS countBy​(String countColumnName, ColumnName... groupByColumns)
    • countBy

      @ConcurrentMethod TOPS countBy​(String countColumnName, Collection<String> groupByColumns)
    • firstBy

      Returns the first row of the given table.
    • firstBy

      @ConcurrentMethod TOPS firstBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and retrieves the first for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • firstBy

      @ConcurrentMethod TOPS firstBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and retrieves the first for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • firstBy

      @ConcurrentMethod TOPS firstBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and retrieves the first for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • lastBy

      Returns the last row of the given table.
    • lastBy

      @ConcurrentMethod TOPS lastBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and retrieves the last for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • lastBy

      @ConcurrentMethod TOPS lastBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and retrieves the last for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • lastBy

      @ConcurrentMethod TOPS lastBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and retrieves the last for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • minBy

      Produces a single row table with the minimum of each column.

      When the input table is empty, zero output rows are produced.

    • minBy

      @ConcurrentMethod TOPS minBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the min for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • minBy

      @ConcurrentMethod TOPS minBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the min for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • minBy

      @ConcurrentMethod TOPS minBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the min for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • maxBy

      Produces a single row table with the maximum of each column.

      When the input table is empty, zero output rows are produced.

    • maxBy

      @ConcurrentMethod TOPS maxBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the max for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • maxBy

      @ConcurrentMethod TOPS maxBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the max for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • maxBy

      @ConcurrentMethod TOPS maxBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the max for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • sumBy

      Produces a single row table with the sum of each column.

      When the input table is empty, zero output rows are produced.

    • sumBy

      @ConcurrentMethod TOPS sumBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the sum for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • sumBy

      @ConcurrentMethod TOPS sumBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the sum for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • sumBy

      @ConcurrentMethod TOPS sumBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the sum for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • avgBy

      Produces a single row table with the average of each column.

      When the input table is empty, zero output rows are produced.

    • avgBy

      @ConcurrentMethod TOPS avgBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the average for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • avgBy

      @ConcurrentMethod TOPS avgBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the average for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • avgBy

      @ConcurrentMethod TOPS avgBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the average for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • medianBy

      Produces a single row table with the median of each column.

      When the input table is empty, zero output rows are produced.

    • medianBy

      @ConcurrentMethod TOPS medianBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the median for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • medianBy

      @ConcurrentMethod TOPS medianBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the median for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • medianBy

      @ConcurrentMethod TOPS medianBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the median for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy() }
    • stdBy

      Produces a single row table with the standard deviation of each column.

      When the input table is empty, zero output rows are produced.

    • stdBy

      @ConcurrentMethod TOPS stdBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the standard deviation for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • stdBy

      @ConcurrentMethod TOPS stdBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the standard deviation for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • stdBy

      @ConcurrentMethod TOPS stdBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the standard deviation for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • varBy

      Produces a single row table with the variance of each column.

      When the input table is empty, zero output rows are produced.

    • varBy

      @ConcurrentMethod TOPS varBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the variance for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • varBy

      @ConcurrentMethod TOPS varBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the variance for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • varBy

      @ConcurrentMethod TOPS varBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the variance for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • absSumBy

      Produces a single row table with the absolute sum of each column.

      When the input table is empty, zero output rows are produced.

    • absSumBy

      @ConcurrentMethod TOPS absSumBy​(String... groupByColumns)
      Groups the data column according to groupByColumns and computes the sum of the absolute values for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • absSumBy

      @ConcurrentMethod TOPS absSumBy​(ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the sum of the absolute values for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • absSumBy

      @ConcurrentMethod TOPS absSumBy​(Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the sum of the absolute values for the rest of the fields
      Parameters:
      groupByColumns - The grouping columns as in groupBy()
    • wsumBy

      @ConcurrentMethod TOPS wsumBy​(String weightColumn)
      Computes the weighted sum for all rows in the table using weightColumn for the rest of the fields

      If the weight column is a floating point type, all result columns will be doubles. If the weight column is an integral type, all integral input columns will have long results and all floating point input columns will have double results.

      Parameters:
      weightColumn - the column to use for the weight
    • wsumBy

      @ConcurrentMethod TOPS wsumBy​(String weightColumn, String... groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted sum using weightColumn for the rest of the fields

      If the weight column is a floating point type, all result columns will be doubles. If the weight column is an integral type, all integral input columns will have long results and all floating point input columns will have double results.

      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • wsumBy

      @ConcurrentMethod TOPS wsumBy​(String weightColumn, ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted sum using weightColumn for the rest of the fields

      If the weight column is a floating point type, all result columns will be doubles. If the weight column is an integral type, all integral input columns will have long results and all floating point input columns will have double results.

      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • wsumBy

      @ConcurrentMethod TOPS wsumBy​(String weightColumn, Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted sum using weightColumn for the rest of the fields

      If the weight column is a floating point type, all result columns will be doubles. If the weight column is an integral type, all integral input columns will have long results and all floating point input columns will have double results.

      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • wavgBy

      @ConcurrentMethod TOPS wavgBy​(String weightColumn)
      Produces a single row table with the weighted average using weightColumn for the rest of the fields

      When the input table is empty, zero output rows are produced.

      Parameters:
      weightColumn - the column to use for the weight
    • wavgBy

      @ConcurrentMethod TOPS wavgBy​(String weightColumn, String... groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted average using weightColumn for the rest of the fields
      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • wavgBy

      @ConcurrentMethod TOPS wavgBy​(String weightColumn, ColumnName... groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted average using weightColumn for the rest of the fields
      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • wavgBy

      @ConcurrentMethod TOPS wavgBy​(String weightColumn, Collection<String> groupByColumns)
      Groups the data column according to groupByColumns and computes the weighted average using weightColumn for the rest of the fields
      Parameters:
      weightColumn - the column to use for the weight
      groupByColumns - The grouping columns as in groupBy()
    • ungroup

      TOPS ungroup()
      Ungroups a table by expanding all columns of arrays or vectors into columns of singular values, creating one row in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values duplicated in each output row corresponding to a given input row. All arrays and vectors must be the same size.
      Returns:
      the ungrouped table
    • ungroup

      TOPS ungroup​(boolean nullFill)
      Ungroups a table by expanding all columns of arrays or vectors into columns of singular values, creating one row in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values duplicated in each output row corresponding to a given input row.
      Parameters:
      nullFill - indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with null values. If set to false, then all arrays should be the same length.
      Returns:
      the ungrouped table
    • ungroup

      TOPS ungroup​(String... columnsToUngroup)
      Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values duplicated in each output row corresponding to a given input row. The arrays and vectors must be the same size.
      Parameters:
      columnsToUngroup - the columns to ungroup
      Returns:
      the ungrouped table
    • ungroup

      TOPS ungroup​(boolean nullFill, String... columnsToUngroup)
      Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values duplicated in each output row corresponding to a given input row.
      Parameters:
      nullFill - indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with null values. If set to false, then all arrays should be the same length.
      columnsToUngroup - the columns to ungroup
      Returns:
      the ungrouped table
    • ungroup

      TOPS ungroup​(boolean nullFill, Collection<? extends ColumnName> columnsToUngroup)
      Ungroups a table by expanding columns of arrays or vectors into columns of singular values, creating one row in the output table for each value in the columns to be ungrouped. Columns that are not ungrouped have their values duplicated in each output row corresponding to a given input row.
      Parameters:
      nullFill - indicates if the ungrouped table should allow disparate sized arrays filling shorter columns with null values. If set to false, then all arrays should be the same length.
      columnsToUngroup - the columns to ungroup
      Returns:
      the ungrouped table