@deephaven/jsapi-types
    Preparing search index...

    Interface ResolvedTable

    The table an awaited PendingTable resolves to: a retained table whose data can be read, plus the chainable TableOperations, each of which again yields a PendingTable. Each instance points at a single server-side table, unlike a Table which can have its filters, sorts, and custom columns changed and releases every server-side table it made when closed.

    Each instance has one owner which closes it when done so the server can free its resources. For multiple owners with independent lifetimes, ResolvedTable.copy() produces a distinct ResolvedTable instance referencing the same server-side table.

    To instead use a Table, invoke ResolvedTable.createMutableTable(), which will return a new Table based on this table, which can then have its filters, sorts, and custom columns changed without affecting this table.

    interface ResolvedTable {
        get columns(): readonly Column[];
        get size(): number;
        absSumBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        aggAllBy(
            aggUnion: AggAllByUnion,
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        aggBy(options: AggByOptions): PendingTable<ResolvedTable>;
        aj(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
            columnsToAdd?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        avgBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        close(): void;
        copy(): ResolvedTable;
        countBy(
            columnName: string,
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        createMutableTable(): Table;
        createRollup(configObject: RollupConfig): Promise<TreeTable>;
        createSnapshot(options: SnapshotOptions): Promise<TableData>;
        createSubscription(options: SubscriptionOptions): TableSubscription;
        createTreeTable(configObject: TreeTableConfig): Promise<TreeTable>;
        createViewportSubscription(
            options: ViewportSubscriptionOptions,
        ): TableViewportSubscription;
        downsample(options: DownsampleTableOptions): PendingTable<ResolvedTable>;
        dropColumns(
            columnsToDrop: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        exactJoin(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
            columnsToAdd?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        findColumn(columnName: string): Column;
        firstBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        flatten(): PendingTable<ResolvedTable>;
        getAttribute(attributeName: string): unknown;
        getAttributes(): readonly string[];
        getColumnStatistics(column: string | Column): Promise<ColumnStatistics>;
        groupBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        head(size: number | LongWrapper): PendingTable<ResolvedTable>;
        join(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
            columnsToAdd?: readonly (string | Column)[],
            reserveBits?: number,
        ): PendingTable<ResolvedTable>;
        lastBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        maxBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        medianBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        minBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        naturalJoin(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
            columnsToAdd?: readonly (string | Column)[],
            joinType?: NaturalJoinType,
        ): PendingTable<ResolvedTable>;
        raj(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
            columnsToAdd?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        rangeJoin(
            rightTable: TableReference,
            exactMatches: readonly string[],
            rangeMatch: RangeJoinMatch,
            aggregations: readonly AggregationUnion[],
        ): PendingTable<ResolvedTable>;
        reverse(): PendingTable<ResolvedTable>;
        seekRow(options: SeekRowOptions): Promise<number>;
        select(
            columns: readonly (string | CustomColumn)[],
        ): PendingTable<ResolvedTable>;
        selectDistinct(
            columnNames?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        slice(
            firstPositionInclusive: number | LongWrapper,
            lastPositionExclusive: number | LongWrapper,
        ): PendingTable<ResolvedTable>;
        snapshot(): PendingTable<ResolvedTable>;
        snapshotWhen(
            trigger: TableReference,
            options?: SnapshotWhenOptions,
        ): PendingTable<ResolvedTable>;
        sort(
            sorts: readonly (string | Column | Sort | SimpleSort)[],
        ): PendingTable<ResolvedTable>;
        stdBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        sumBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        tail(size: number | LongWrapper): PendingTable<ResolvedTable>;
        ungroup(options?: UngroupOptions): PendingTable<ResolvedTable>;
        update(
            columns: readonly (string | CustomColumn)[],
        ): PendingTable<ResolvedTable>;
        updateBy(options: UpdateByOptions): PendingTable<ResolvedTable>;
        updateView(
            columns: readonly (string | CustomColumn)[],
        ): PendingTable<ResolvedTable>;
        varBy(
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        view(
            columns: readonly (string | CustomColumn)[],
        ): PendingTable<ResolvedTable>;
        wavgBy(
            weightColumn: string | Column,
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        where(conditions: readonly FilterCondition[]): PendingTable<ResolvedTable>;
        whereIn(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        whereNotIn(
            rightTable: TableReference,
            columnsToMatch: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
        wsumBy(
            weightColumn: string | Column,
            groupByColumns?: readonly (string | Column)[],
        ): PendingTable<ResolvedTable>;
    }

    Hierarchy (View Summary)

    Index
    • get columns(): readonly Column[]

      The columns that are present on this table.

      Returns readonly Column[]

      the columns present in this table

    • get size(): number

      The total count of rows in the table. If a viewport subscription is active, this size updates when the subscription updates. If not, and the table is uncoalesced, the size is Table.SIZE_UNCOALESCED. Otherwise, the size updates when the server's update graph processes changes.

      Returns number

      the size of the table

    • Aggregates the contents of this table into a new table. Each aggregation adds columns computed over each group, and can be made with a dh.agg.Aggregation factory or written as an object literal:

      const summary = await table.aggBy({
          aggregations: [
              dh.agg.Aggregation.AggWAvg("W", ["WAvgX = X"]),
              dh.agg.Aggregation.AggAvg(["AvgX = X"]),
              { type: "Count", col: "N" },
          ],
          groupByColumns: ["Key"],
      });
      

      Parameters

      • options: AggByOptions

        the aggregations, and optionally the columns to group by and the groups to start with

      Returns PendingTable<ResolvedTable>

      a table with one row per group, and a column for each aggregation

    • Performs an as-of join of this table with the right table: each row takes the right table's row with the closest as-of value at or before its own.

      Parameters

      • rightTable: TableReference

        the table to join with

      • columnsToMatch: readonly (string | Column)[]

        the columns to match on. All but the last are exact matches ("LeftCol=RightCol" or a name in both tables). The last is the as-of match: "LeftCol>=RightCol", "LeftCol>RightCol", or a name in both tables, which means >=.

      • OptionalcolumnsToAdd: readonly (string | Column)[]

        the columns to add from the right table. If omitted, adds all non-match columns

      Returns PendingTable<ResolvedTable>

      a new table with the joined columns

    • Signals that the table is no longer used, so the server can release its resources. Logs a warning if called more than once.

      Returns void

    • A new instance over the same server-side table with its own lifetime, available immediately. The caller owns it, and either instance can be closed without affecting the other.

      Returns ResolvedTable

      a new instance of this table, sharing resources on the server

      IllegalStateException if this table is closed

    • Counts the number of rows in each group, storing the result in a new column.

      Parameters

      • columnName: string

        the name of the new column to hold the row counts

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, counts all rows into a single result

      Returns PendingTable<ResolvedTable>

      a new table with a count column and optional group-by columns

    • A new Table over the same server-side table, the inverse of Table.operations(). The Table can be changed with applyFilter, applySort and its other mutating methods without affecting this table, and the two are closed independently. Like other tables made by operations, it is not revived if a reconnect needs a new session.

      Returns Table

      a new mutable table, which the caller must close

    • Returns a promise of a TableData instance containing a snapshot of the current state of the table, within the bounds of the specified rows and columns.

      Parameters

      • options: SnapshotOptions

        the snapshot options, described in dh.DataOptions.SnapshotOptions

      Returns Promise<TableData>

      a promise of TableData

    • Creates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a snapshot of the table atomically. The initial snapshot arrives in a single event, and later changes arrive as updates. However, this may still be very expensive to run from a browser for very large tables. Each call creates a new subscription, which must have io.deephaven.web.client.api.subscription.AbstractTableSubscription.close called on it to stop it and release its resources, and all events are fired from the TableSubscription instance.

      Parameters

      • options: SubscriptionOptions

        the subscription options, described in dh.DataOptions.SubscriptionOptions

      Returns TableSubscription

      a new TableSubscription

    • Performs an exact join of this table with the right table. Each row in this table must have exactly one matching row in the right table based on the match columns. If a row has no match, the operation fails.

      Parameters

      • rightTable: TableReference

        the table to join with

      • columnsToMatch: readonly (string | Column)[]

        the columns to match on, in "LeftCol=RightCol" format

      • OptionalcolumnsToAdd: readonly (string | Column)[]

        the columns to add from the right table. If omitted, adds all non-match columns

      Returns PendingTable<ResolvedTable>

      a new table with the joined columns

    • Finds a column by name.

      Parameters

      • columnName: string

        the name of the column

      Returns Column

      the column

    • Reads an attribute's value as a string. Only primitive and string values are sent to the client. An attribute listed by io.deephaven.web.client.api.JsITable.getAttributes with any other value cannot be read here.

      Parameters

      • attributeName: string

        the name of the attribute to read

      Returns unknown

      the value of the attribute or null if none with that name exists

    • The names of all attributes defined on this table.

      Returns readonly string[]

      an array of attributes defined on this table

    • Computes statistics for one column of this table, such as its count, sum and average for a numeric column, or its most common values for other types.

      Parameters

      • column: string | Column

        the column, or the name of the column, to compute statistics for

      Returns Promise<ColumnStatistics>

      a promise of the ColumnStatistics for that column

    • Groups the table by the specified columns, accumulating the other columns into arrays. If no columns are provided, the resulting table has a single row.

      Parameters

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group

      Returns PendingTable<ResolvedTable>

      a table with one row per group

    • Performs a cross join (Cartesian product) of this table with the right table, filtered to matching rows. Each row in this table is paired with every matching row in the right table.

      Parameters

      • rightTable: TableReference

        the table to join with

      • columnsToMatch: readonly (string | Column)[]

        the columns to match on, in "LeftCol=RightCol" format

      • OptionalcolumnsToAdd: readonly (string | Column)[]

        the columns to add from the right table. If omitted, adds all non-match columns

      • OptionalreserveBits: number

        the number of bits of key-space to initially reserve per group. The default is 10

      Returns PendingTable<ResolvedTable>

      a new table with the joined columns

    • Computes the median of each column within each group. When the group size is even, averages the two middle values of int, long, float and double columns, and uses the larger value for other types.

      Parameters

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, computes the median across all rows

      Returns PendingTable<ResolvedTable>

      a new table with the medians

    • Performs a reverse as-of join of this table with the right table: each row takes the right table's row with the closest as-of value at or after its own.

      Parameters

      • rightTable: TableReference

        the table to join with

      • columnsToMatch: readonly (string | Column)[]

        the columns to match on. All but the last are exact matches ("LeftCol=RightCol" or a name in both tables). The last is the as-of match: "LeftCol<=RightCol", "LeftCol<RightCol", or a name in both tables, which means <=.

      • OptionalcolumnsToAdd: readonly (string | Column)[]

        the columns to add from the right table. If omitted, adds all non-match columns

      Returns PendingTable<ResolvedTable>

      a new table with the joined columns

    • Joins each row of this table to the rows of rightTable that match it exactly on exactMatches and fall in its range, and aggregates those right rows into columns of the result. The result has one row per row of this table.

      At this time, the server supports only static (not refreshing) tables and Group aggregations. This operation remains under active development.

      Parameters

      • rightTable: TableReference

        the table to join to

      • exactMatches: readonly string[]

        columns that must be equal in both tables, as "Col" or "LeftCol=RightCol"

      • rangeMatch: RangeJoinMatch

        the columns and rules of the range match

      • aggregations: readonly AggregationUnion[]

        the aggregations to apply to each row's matching right rows

      Returns PendingTable<ResolvedTable>

      a table with one row per row of this table, and a column for each aggregation

    • Finds the next row, after startingRow and wrapping around, whose value in column matches seekValue.

      Parameters

      • options: SeekRowOptions

        the value to find, and where and how to search for it

      Returns Promise<number>

      a promise of the position of the matching row, or -1 if no row matches

    • Creates a new table with only the distinct values of the specified columns. If no columns are specified, uses all columns.

      Parameters

      • OptionalcolumnNames: readonly (string | Column)[]

        the column names to distinct on. If empty/null, uses all columns

      Returns PendingTable<ResolvedTable>

      a new table with only the distinct values of the specified columns

    • Extracts a subset of a table by row position.

      If both firstPositionInclusive and lastPositionExclusive are positive, both count from the beginning of the table. The firstPositionInclusive is inclusive, and the lastPositionExclusive is exclusive. The head(N) call is equivalent to slice(0, N). The firstPositionInclusive must be less than or equal to the lastPositionExclusive.

      If firstPositionInclusive is positive and lastPositionExclusive is negative, the firstPositionInclusive counts from the beginning of the table, inclusively. The lastPositionExclusive counts from the end of the table. For example, slice(1, -1) includes all rows but the first and last. If the lastPositionExclusive would be before the firstPositionInclusive, the result is an empty table.

      If firstPositionInclusive is negative and lastPositionExclusive is zero, the firstPositionInclusive counts from the end of the table, and the slice ends at the end of the table. Calling slice(-N, 0) is equivalent to tail(N).

      If the firstPositionInclusive is negative and the lastPositionExclusive is negative, both count from the end of the table. For example, slice(-2, -1) returns the second to last row of the table.

      If firstPositionInclusive is negative and lastPositionExclusive is positive, the firstPositionInclusive counts from the end of the table, inclusively. The lastPositionExclusive counts from the beginning of the table, exclusively. For example, slice(-3, 5) returns all rows starting from the third-last row to the fifth row of the table. If there are no rows between these positions, the result is an empty table.

      Parameters

      • firstPositionInclusive: number | LongWrapper

        the first position to include in the result

      • lastPositionExclusive: number | LongWrapper

        the position after the last one to include in the result

      Returns PendingTable<ResolvedTable>

      a new table with the subset of rows from the original table

    • Computes the sample standard deviation of each column within each group, using Bessel's correction.

      Parameters

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, computes the standard deviation across all rows

      Returns PendingTable<ResolvedTable>

      a new table with the standard deviations

    • 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 being ungrouped. Each output row repeats the values of the other columns from its input row.

      Parameters

      • Optionaloptions: UngroupOptions

        options to specify the behavior of the ungroup operation

      Returns PendingTable<ResolvedTable>

      an ungrouped table

    • Adds or replaces columns whose value in each row depends on the rows around it in its group: cumulative operations, rolling windows, exponential moving statistics, fills and deltas. Without UpdateByOptions.groupByColumns, the whole table is one group. For example, a weighted average over each row and the two before it in its group:

      const rolling = await table.updateBy({
          operations: [{
              spec: {
                  type: "UpdateByRollingWAvg",
                  weightColumn: "W",
                  reverseWindowScale: { type: "ticks", ticks: 3 },
              },
              matchPairs: ["RollWAvgX = X"],
          }],
          groupByColumns: ["Key"],
      });
      

      Parameters

      • options: UpdateByOptions

        the operations to apply, and optionally the columns to group by and control settings

      Returns PendingTable<ResolvedTable>

      a table with the same rows as this table, and each operation's output columns added or replacing the columns of the same name

    • Computes the sample variance of each column within each group, using Bessel's correction.

      Parameters

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, computes the variance across all rows

      Returns PendingTable<ResolvedTable>

      a new table with the variances

    • Computes the weighted average of each column within each group: the sum of each value multiplied by its weight, divided by the sum of the weights. It averages every column other than the weight and the group-by columns, so each must be numeric. To choose and rename columns, or to combine with other aggregations, use TableOperations.aggBy() with dh.agg.Aggregation.AggWAvg.

      const byKey = await table.wavgBy("W", ["Key"]);
      

      Parameters

      • weightColumn: string | Column

        the column containing the weights

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, computes the weighted average across all rows

      Returns PendingTable<ResolvedTable>

      a new table with the weighted averages

    • Computes the weighted sum of each column within each group: the sum of each value multiplied by its weight.

      Parameters

      • weightColumn: string | Column

        the column containing the weights

      • OptionalgroupByColumns: readonly (string | Column)[]

        columns to group by. If omitted, computes the weighted sum across all rows

      Returns PendingTable<ResolvedTable>

      a new table with the weighted sums