The columns that are present on this table.
the columns present in this table
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.
the size of the table
Computes the sum of absolute values of each column within each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the absolute sum across all rows
a new table with the absolute sums
Applies a single aggregation to all columns.
the aggregation to apply
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by
a new table with these aggregations applied to the data in this 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"],
});
the aggregations, and optionally the columns to group by and the groups to start with
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.
the table to join with
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
a new table with the joined columns
Computes the arithmetic mean of each column within each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the average across all rows
a new table with the averages
Signals that the table is no longer used, so the server can release its resources. Logs a warning if called more than once.
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.
a new instance of this table, sharing resources on the server
Counts the number of rows in each group, storing the result in a new column.
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
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.
a new mutable table, which the caller must close
A promise of a new roll-up dh.TreeTable of this table. Each call to this method produces a new dh.TreeTable, which must have close() called on it when not in use.
specifies which columns to aggregate and which to group by, and other rollup behavior
a promise of dh.TreeTable
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.
the snapshot options, described in dh.DataOptions.SnapshotOptions
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.
the subscription options, described in dh.DataOptions.SubscriptionOptions
a new TableSubscription
A promise of a new dh.TreeTable of this table. Each call to this method produces a new dh.TreeTable, which must have close() called on it when not in use.
specifies which column to use as the row ID, and which for parent ID, and how to handle rows with no parent
a promise of dh.TreeTable
Creates a viewport subscription to the specified columns, across the specified rows in the table. The returned TableViewportSubscription instance allows the viewport to be changed over time, and events are fired from it when the data changes or when a viewport change is applied. Each call creates a new subscription, which must have TableViewportSubscription.close() called on it to stop it and release its resources.
the viewport subscription options, described in dh.DataOptions.ViewportSubscriptionOptions
Creates a table with fewer rows than this one that draws the same as a line plot at the given width, for plotting large time series. Each pixel of the width keeps the rows that set its first, last, minimum and maximum values. If the table has fewer rows than that, the result is the table unchanged.
the columns to plot, the plot width, and optionally the visible X range
the downsampled table
Creates a new table without the specified columns.
the columns to drop. Should not be empty.
a new table without those columns
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.
the table to join with
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
a new table with the joined columns
Finds a column by name.
the name of the column
the column
Returns the first row of each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, returns the first row of the table
a new table with the first row from each group
Creates a version of this table with a flat rowset.
a new table with a flat rowset
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.
the name of the attribute to read
the value of the attribute or null if none with that name exists
The names of all attributes defined on this table.
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.
the column, or the name of the column, to compute statistics for
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.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group
a table with one row per group
Creates a table with the given number of rows from the beginning of this table.
the number of rows to keep from the beginning of this table
a new table with at most that many rows
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.
the table to join with
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
a new table with the joined columns
Returns the last row of each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, returns the last row of the table
a new table with the last row from each group
Returns the maximum value of each column within each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the maximum across all rows
a new table with the maximum values
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.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the median across all rows
a new table with the medians
Returns the minimum value of each column within each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the minimum across all rows
a new table with the minimum values
Perform a natural-join with the rightTable.
the right side table on the join
the match pair conditions
OptionalcolumnsToAdd: readonly (string | Column)[]
the columns from the right table to add to the result. If omitted, adds all non-match columns
OptionaljoinType: NaturalJoinType
the type of join to perform
the natural-joined table
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.
the table to join with
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
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.
the table to join to
columns that must be equal in both tables, as "Col" or "LeftCol=RightCol"
the columns and rules of the range match
the aggregations to apply to each row's matching right rows
a table with one row per row of this table, and a column for each aggregation
Creates a table with all the rows of this table in reverse order.
a new table with the rows in reverse order
Finds the next row, after startingRow and wrapping around, whose value in column matches
seekValue.
the value to find, and where and how to search for it
a promise of the position of the matching row, or -1 if no row matches
Creates a new table with only the specified columns. Computes all formulas eagerly and stores their values in memory.
the columns or expressions to have in the new table
a new table with only those columns.
Creates a new table with only the distinct values of the specified columns. If no columns are specified, uses all columns.
OptionalcolumnNames: readonly (string | Column)[]
the column names to distinct on. If empty/null, uses all columns
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.
the first position to include in the result
the position after the last one to include in the result
a new table with the subset of rows from the original table
A server-side snapshot of the entire table as of the time the request is processed. The result does not update. This is what Table.freeze() does. The name here follows the other Deephaven clients.
a new, non-ticking table with the same contents as this table at that moment
Creates a table that captures a snapshot of this table whenever the trigger table updates.
the table to use as a trigger for when to take a snapshot of this table
Optionaloptions: SnapshotWhenOptions
options controlling when and how the result table updates. If omitted, every option takes its default.
the snapshot table
Sorts the table by the given columns.
the sorts to apply, in order of precedence
a sorted table
Computes the sample standard deviation of each column within each group, using Bessel's correction.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the standard deviation across all rows
a new table with the standard deviations
Computes the sum of each column within each group.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the sum across all rows
a new table with the sums
Creates a table with the given number of rows from the end of this table.
the number of rows to keep from the end of this table
a new table with at most that many rows
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.
Optionaloptions: UngroupOptions
options to specify the behavior of the ungroup operation
an ungrouped table
Creates a new table, appending or replacing the specified columns. Computes all formulas eagerly and stores their values in memory.
the columns or expressions to have in the new table
a new table with those columns appended
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"],
});
the operations to apply, and optionally the columns to group by and control settings
a table with the same rows as this table, and each operation's output columns added or replacing the columns of the same name
Creates a new table, appending or replacing the specified columns. Computes each formula every time a value is read, and stores nothing.
the columns or expressions to have in the new table
a new table with those columns appended
Computes the sample variance of each column within each group, using Bessel's correction.
OptionalgroupByColumns: readonly (string | Column)[]
columns to group by. If omitted, computes the variance across all rows
a new table with the variances
Creates a new table with only the specified columns. Computes each formula every time a value is read, and stores nothing.
the columns or expressions to have in the new table
a new table with only those columns.
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"]);
a new table with the weighted averages
Creates a table that filters the contents of this table based on the provided conditions.
the conditions to filter on. FilterValue.ofColumn() names a column without a resolved table
a filtered table
Filters the contents of this table based on the set of values that match the provided right table.
When the right table ticks, all the rows in this table are re-evaluated.
the table with the filter criteria
the column matches between the two tables
a new filtered table
Filters the contents of this table based on the set of values that do not match the provided right table.
When the right table ticks, all the rows in this table are re-evaluated.
the table with the filter criteria
the column matches between the two tables
a new filtered table
Computes the weighted sum of each column within each group: the sum of each value multiplied by its weight.
a new table with the weighted sums
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
ResolvedTableinstance 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.