Package io.deephaven.web.client.api
Class JsTable
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.lifecycle.HasLifecycle
io.deephaven.web.client.api.JsTable
- All Implemented Interfaces:
JoinableTable
,ServerObject
,HasTableBinding
@TsName(namespace="dh",
name="Table")
public class JsTable
extends HasLifecycle
implements HasTableBinding, JoinableTable, ServerObject
Provides access to data in a table. Note that several methods present their response through Promises. This allows
the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
inform the UI right away that they have taken place.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T>
Nested classes/interfaces inherited from interface io.deephaven.web.client.api.ServerObject
ServerObject.Union
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
The table size has updated, so live scrollbars and the like can be updated accordingly.static final String
static final String
static final int
static final double
The size the table will have if it is uncoalesced.Fields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED
-
Constructor Summary
ConstructorsConstructorDescriptionJsTable
(WorkerConnection workerConnection, ClientTableState state) Creates a new Table directly from an existing ClientTableState. -
Method Summary
Modifier and TypeMethodDescriptionelemental2.core.JsArray<CustomColumn>
applyCustomColumns
(elemental2.core.JsArray<JsTable.CustomColumnArgUnionType> customColumns) used when adding new filter and sort operations to the table, as long as they are present.elemental2.core.JsArray<FilterCondition>
applyFilter
(FilterCondition[] filter) Replace the currently set filters on the table.elemental2.core.JsArray<Sort>
Replace the currently set sort on this table.elemental2.promise.Promise<JsTable>
asOfJoin
(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsNullable String asOfMatchRule) Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching row from the right table.elemental2.promise.Promise<JsTable>
batch
(JsConsumer<RequestBatcher> userCode) elemental2.promise.Promise<JsPartitionedTable>
byExternal
(Object keys, Boolean dropKeys) void
close()
Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.elemental2.promise.Promise<JsTable>
copy()
Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.elemental2.promise.Promise<JsTable>
copy
(boolean resolved) elemental2.promise.Promise<JsTable>
crossJoin
(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsNullable Double reserveBits) a promise that will be resolved with the newly created table holding the results of the specified cross join operation.elemental2.promise.Promise<JsTable>
downsample
(LongWrapper[] zoomRange, int pixelCount, String xCol, String[] yCols) Get a downsampled version of the table.elemental2.promise.Promise<JsTable>
exactJoin
(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, elemental2.core.JsArray<String> columnsToAdd) a promise that will be resolved with the newly created table holding the results of the specified exact join operation.findColumn
(String key) Retrieve a column by the given name.Column[]
findColumns
(String[] keys) Retrieve multiple columns specified by the given names.elemental2.promise.Promise<JsTable>
freeze()
a "frozen" version of this table (a server-side snapshot of the entire source table).@JsNullable Object
getAttribute
(String attributeName) null if no property exists, a string if it is an easily serializable property, or aPromise <Table>
that will either resolve with a table or error out if the object can't be passed to JS.String[]
getCache()
elemental2.core.JsArray<Column>
The columns that are present on this table.elemental2.promise.Promise<JsColumnStatistics>
getColumnStatistics
(Column column) a promise that will resolve to ColumnStatistics for the column of this table.elemental2.core.JsArray<CustomColumn>
An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones.@JsNullable String
elemental2.core.JsArray<FilterCondition>
An ordered list of Filters to apply to the table.elemental2.promise.Promise<JsTotalsTable>
getGrandTotalsTable
(@JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) a promise that will resolve to a Totals Table of this table, ignoring any filters.@JsNullable JsLayoutHints
@JsNullable String
double
getSize()
The total count of rows in the table.elemental2.core.JsArray<Sort>
getSort()
An ordered list of Sorts to apply to the table.int
double
The total count of the rows in the table, excluding any filters.elemental2.promise.Promise<JsTotalsTable>
getTotalsTable
(@JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) a promise that will resolve to a Totals Table of this table.The default configuration to be used when building a TotalsTable for this table.elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData>
Gets the currently visible viewport.boolean
hasHandle
(TableTicket tableHandle) boolean
True if this table represents a user Input Table (created by InputTable.newInputTable).boolean
hasRollbackHandle
(TableTicket tableHandle) elemental2.promise.Promise<JsInputTable>
If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to mutate the data within the table.boolean
isActive
(ClientTableState state) boolean
isAlive()
boolean
boolean
isClosed()
True if this table has been closed.boolean
True if this table may receive updates from the server, including size changed events, updated events after initial snapshot.boolean
Read-only.elemental2.promise.Promise<JsTable>
join
(String joinType, JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsNullable String asOfMatchRule) Deprecated.Returns the current state if active, or the last state which was active which represents the state we will return to if an error occurs with the state we're presently waiting on.void
maybeRevive
(ClientTableState state) void
elemental2.promise.Promise<JsTable>
naturalJoin
(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, elemental2.core.JsArray<String> columnsToAdd) a promise that will be resolved with the newly created table holding the results of the specified natural join operation.elemental2.promise.Promise<JsPartitionedTable>
partitionBy
(Object keys, Boolean dropKeys) Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified keys.elemental2.promise.Promise<JsTable>
refetch()
Indicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible.static Sort
reverse()
a Sort than can be used to reverse a table.void
revive
(ClientTableState state) void
rollback()
elemental2.promise.Promise<JsTreeTable>
rollup
(@TsTypeRef(JsRollupConfig.class) Object configObject) a promise that will resolve to a new roll-up TreeTable of this table.elemental2.promise.Promise<Double>
seekRow
(double startingRow, Column column, @TsTypeRef(ValueType.class) String valueType, jsinterop.base.Any seekValue, @JsNullable Boolean insensitive, @JsNullable Boolean contains, @JsNullable Boolean isBackwards) Seek the row matching the data providedelemental2.promise.Promise<JsTable>
selectDistinct
(Column[] columns) a new table containing the distinct tuples of values from the given columns that are present in the original table.void
setRollback
(ActiveTableBinding rollbackTo) void
setSize
(double s) void
setState
(ClientTableState state) setViewport
(double firstRow, double lastRow) Overload for Java (since JS just omits the optional params)setViewport
(double firstRow, double lastRow, @JsNullable elemental2.core.JsArray<Column> columns, @JsNullable Double updateIntervalMs, @JsNullable Boolean isReverseViewport) If the columns parameter is not provided, all columns will be used.setViewport
(double firstRow, double lastRow, elemental2.core.JsArray<Column> columns) Overload for Java (since JS just omits the optional param)elemental2.promise.Promise<JsTable>
state()
Overload for java (since js just omits the optional var)Creates a subscription to the specified columns, across all rows in the table.toString()
elemental2.promise.Promise<JsTreeTable>
treeTable
(@TsTypeRef(JsTreeTableConfig.class) Object configObject) a promise that will resolve to a new `TreeTable` of this table.Methods inherited from class io.deephaven.web.client.api.lifecycle.HasLifecycle
die, disconnected, nextReconnect, reconnect
Methods inherited from class io.deephaven.web.client.api.event.HasEventHandling
addEventListener, addEventListenerOneShot, addEventListenerOneShot, failureHandled, fireCriticalEvent, fireCriticalEvent, fireEvent, fireEvent, fireEvent, hasListener, hasListeners, isSuppress, logPrefix, nextEvent, removeEventListener, suppressEvents, unsuppressEvents
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.web.client.state.HasTableBinding
fireEvent, fireEvent
-
Field Details
-
EVENT_SIZECHANGED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_UPDATED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_ROWADDED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_ROWREMOVED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_ROWUPDATED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_SORTCHANGED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_FILTERCHANGED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_CUSTOMCOLUMNSCHANGED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_DISCONNECT
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_RECONNECT
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_RECONNECTFAILED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_REQUEST_FAILED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_REQUEST_SUCCEEDED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
SIZE_UNCOALESCED
@JsProperty(namespace="dh.Table") public static final double SIZE_UNCOALESCEDThe size the table will have if it is uncoalesced.- See Also:
-
INTERNAL_EVENT_STATECHANGED
- See Also:
-
INTERNAL_EVENT_SIZELISTENER
- See Also:
-
MAX_BATCH_TIME
public static final int MAX_BATCH_TIME- See Also:
-
-
Constructor Details
-
JsTable
Creates a new Table directly from an existing ClientTableState. The CTS manages all fetch operations, so this is just a simple constructor to get a table that points to the given state.
-
-
Method Details
-
reverse
a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables do not support reverse.- Returns:
Sort
-
refetch
Description copied from class:HasLifecycle
Indicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible. Override this to implement custom behavior, being sure to call reconnect() when finished.- Overrides:
refetch
in classHasLifecycle
- Returns:
- a promise that will resolve when this object is reconnected
-
typedTicket
- Specified by:
typedTicket
in interfaceServerObject
-
findColumn
Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a returned value.- Parameters:
key
-- Returns:
Column
-
findColumns
Retrieve multiple columns specified by the given names.- Parameters:
keys
-- Returns:
Column
array
-
lastVisibleState
Returns the current state if active, or the last state which was active which represents the state we will return to if an error occurs with the state we're presently waiting on. This lets user code access the last known table size and columns. -
isAlive
public boolean isAlive()- Specified by:
isAlive
in interfaceHasTableBinding
-
state
- Specified by:
state
in interfaceHasTableBinding
- Specified by:
state
in interfaceJoinableTable
-
hasInputTable
@JsProperty(name="hasInputTable") public boolean hasInputTable()True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call .inputTable() to add or remove data from the underlying table.- Returns:
- boolean
-
isBlinkTable
@JsMethod public boolean isBlinkTable() -
inputTable
If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.- Returns:
- Promise of dh.InputTable
-
close
@JsMethod public void close()Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up. -
getAttributes
-
getAttribute
null if no property exists, a string if it is an easily serializable property, or aPromise <Table>
that will either resolve with a table or error out if the object can't be passed to JS.- Parameters:
attributeName
-- Returns:
- Object
-
getColumns
The columns that are present on this table. This is always all possible columns. If you specify fewer columns in .setViewport(), you will get only those columns in your ViewportData. Number size The total count of rows in the table. The size can and will change; see the sizechanged event for details. Size will be negative in exceptional cases (eg. the table is uncoalesced, see the isUncoalesced property for details).- Returns:
Column
array
-
getLayoutHints
-
getSize
@JsProperty public double getSize()The total count of rows in the table. If there is a viewport subscription active, this size will be updated when the subscription updates. If not, andisUncoalesced()
is true, the size will beSIZE_UNCOALESCED
. Otherwise, the size will be updated when the server's update graph processes changes.When the size changes, the
EVENT_SIZECHANGED
event will be fired.- Returns:
- the size of the table, or
SIZE_UNCOALESCED
if there is no subscription and the table is uncoalesced.
-
getDescription
-
getTotalSize
@JsProperty public double getTotalSize()The total count of the rows in the table, excluding any filters. UnlikegetSize()
, changes to this value will not result in any event. If the table is unfiltered, this will return the same size asgetSize()
. If this table was uncoalesced before it was filtered, this will returnSIZE_UNCOALESCED
.- Returns:
- the size of the table before filters, or
SIZE_UNCOALESCED
-
getSort
An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the sortchanged event to know when to update the UI.- Returns:
Sort
array
-
getFilter
An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the filterchanged event to know when to update the UI.- Returns:
FilterCondition
array
-
applySort
Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will immediately return the new value, but you may receive update events using the old sort before the new sort is applied, and the sortchanged event fires. Reusing existing, applied sorts may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.- Parameters:
sort
-- Returns:
Sort
array
-
applyFilter
Replace the currently set filters on the table. Returns the previously set value. Note that the filter property will immediately return the new value, but you may receive update events using the old filter before the new one is applied, and the filterchanged event fires. Reusing existing, applied filters may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.- Parameters:
filter
-- Returns:
FilterCondition
array
-
applyCustomColumns
@JsMethod public elemental2.core.JsArray<CustomColumn> applyCustomColumns(elemental2.core.JsArray<JsTable.CustomColumnArgUnionType> customColumns) used when adding new filter and sort operations to the table, as long as they are present.- Parameters:
customColumns
-- Returns:
CustomColumn
array
-
getCustomColumns
An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones. To update, call applyCustomColumns().- Returns:
CustomColumn
array
-
setViewport
Overload for Java (since JS just omits the optional params) -
setViewport
public TableViewportSubscription setViewport(double firstRow, double lastRow, elemental2.core.JsArray<Column> columns) Overload for Java (since JS just omits the optional param) -
setViewport
@JsMethod public TableViewportSubscription setViewport(double firstRow, double lastRow, @JsOptional @JsNullable elemental2.core.JsArray<Column> columns, @JsOptional @JsNullable Double updateIntervalMs, @JsOptional @JsNullable Boolean isReverseViewport) If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not provided, a default of one second will be used. Until this is called, no data will be available. Invoking this will result in events to be fired once data becomes available, starting with an `updated` event and a rowadded event per row in that range. The returned object allows the viewport to be closed when no longer needed.- Parameters:
firstRow
-lastRow
-columns
-updateIntervalMs
-- Returns:
TableViewportSubscription
-
getViewportData
@JsMethod public elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData> getViewportData()Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to separate the lifespan of this promise from the table itself, callTableViewportSubscription.getViewportData()
on the result fromsetViewport(double, double)
.- Returns:
- Promise of
TableData
-
subscribe
Overload for java (since js just omits the optional var) -
subscribe
@JsMethod public TableSubscription subscribe(elemental2.core.JsArray<Column> columns, @JsOptional Double updateIntervalMs) Creates a subscription to the specified columns, across all rows in the table. The optional parameter updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call to subscribe creates a new subscription, which must have close() called on it to stop it, and all events are fired from the TableSubscription instance.- Parameters:
columns
-updateIntervalMs
-- Returns:
TableSubscription
-
selectDistinct
a new table containing the distinct tuples of values from the given columns that are present in the original table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the order of appearance of values from the original table.- Parameters:
columns
-- Returns:
- Promise of dh.Table
-
copy
Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.- Returns:
- Promise of dh.Table
-
copy
-
getTotalsTable
@JsMethod public elemental2.promise.Promise<JsTotalsTable> getTotalsTable(@JsOptional @TsTypeRef(JsTotalsTableConfig.class) @JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as a parameter, or will use the table's default if no parameter is provided, and be updated once per second as necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close() called on it when not in use.- Parameters:
config
-- Returns:
- Promise of dh.TotalsTable
-
getTotalsTableConfig
The default configuration to be used when building a TotalsTable for this table.- Returns:
- dh.TotalsTableConfig
-
getGrandTotalsTable
@JsMethod public elemental2.promise.Promise<JsTotalsTable> getGrandTotalsTable(@JsOptional @TsTypeRef(JsTotalsTableConfig.class) @JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) a promise that will resolve to a Totals Table of this table, ignoring any filters. See getTotalsTable() above for more specifics.- Parameters:
config
-- Returns:
- promise of dh.TotalsTable
-
rollup
@JsMethod public elemental2.promise.Promise<JsTreeTable> rollup(@TsTypeRef(JsRollupConfig.class) @TsTypeRef(JsRollupConfig.class) Object configObject) a promise that will resolve to a new roll-up TreeTable of this table. Multiple calls to this method will each produce a new TreeTable which must have close() called on it when not in use.- Parameters:
configObject
-- Returns:
- Promise of dh.TreeTable
-
treeTable
@JsMethod public elemental2.promise.Promise<JsTreeTable> treeTable(@TsTypeRef(JsTreeTableConfig.class) @TsTypeRef(JsTreeTableConfig.class) Object configObject) a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a new `TreeTable` which must have close() called on it when not in use.- Parameters:
configObject
-- Returns:
- Promise dh.TreeTable
-
freeze
a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen table will not update. This does not change the original table, and the new table will not have any of the client side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.- Specified by:
freeze
in interfaceJoinableTable
- Returns:
- Promise of dh.Table
-
snapshot
@JsMethod public elemental2.promise.Promise<JsTable> snapshot(JsTable baseTable, @JsOptional Boolean doInitialSnapshot, @JsOptional String[] stampColumns) - Specified by:
snapshot
in interfaceJoinableTable
-
join
@JsMethod @Deprecated public elemental2.promise.Promise<JsTable> join(String joinType, JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsOptional @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsOptional @JsNullable String asOfMatchRule) Deprecated.Description copied from interface:JoinableTable
Joins this table to the provided table, using one of the specified join types:AJ
,ReverseAJ
(orRAJ
) - inexact timeseries joins, based on the provided matching rule.CROSS_JOIN
(orJoin
) - cross join of all rows that have matching values in both tables.EXACT_JOIN
(orExactJoin
- matches values in exactly one row in the right table, with errors if there is not exactly one.NATURAL_JOIN
(orNatural
- matches values in at most one row in the right table, with nulls if there is no match or errors if there are multiple matches.
Left
join is not supported here, unlike DHE.See the Choose a join method document for more guidance on picking a join operation.
- Specified by:
join
in interfaceJoinableTable
- Parameters:
joinType
- The type of join to perform, see the list above.rightTable
- The table to match to values in this tablecolumnsToMatch
- Columns that should matchcolumnsToAdd
- Columns from the right table to add to the result - empty/null/absent to add all columnsasOfMatchRule
- If joinType is AJ/RAJ/ReverseAJ, the match rule to use- Returns:
- a promise that will resolve to the joined table
-
asOfJoin
@JsMethod public elemental2.promise.Promise<JsTable> asOfJoin(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsOptional @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsOptional @JsNullable String asOfMatchRule) Description copied from interface:JoinableTable
Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching row from the right table.The
asOfMatchRule
value can be one of:- LESS_THAN_EQUAL
- LESS_THAN
- GREATER_THAN_EQUAL
- GREATER_THAN
- Specified by:
asOfJoin
in interfaceJoinableTable
- Parameters:
rightTable
- the table to match to values in this tablecolumnsToMatch
- the columns that should match, according to the asOfMatchRolecolumnsToAdd
- columns from the right table to add to the resulting table, empty/null/absent to add all columnsasOfMatchRule
- the match rule to use, see above- Returns:
- a promise that will resolve to the joined table
-
crossJoin
@JsMethod public elemental2.promise.Promise<JsTable> crossJoin(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsOptional @JsNullable elemental2.core.JsArray<String> columnsToAdd, @JsOptional @JsNullable Double reserveBits) Description copied from interface:JoinableTable
a promise that will be resolved with the newly created table holding the results of the specified cross join operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the right table being added to the output. The reserveBits optional parameter lets the client control how the key space is distributed between the rows in the two tables, see the Java Table class for details.- Specified by:
crossJoin
in interfaceJoinableTable
- Parameters:
rightTable
- the table to match to values in this tablecolumnsToMatch
- the columns that should match exactlycolumnsToAdd
- columns from the right table to add to the resulting table, empty/null/absent to add all columnsreserveBits
- the number of bits of key-space to initially reserve per group, null/absent will let the server select a value- Returns:
- a promise that will resolve to the joined table
-
exactJoin
@JsMethod public elemental2.promise.Promise<JsTable> exactJoin(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsOptional elemental2.core.JsArray<String> columnsToAdd) Description copied from interface:JoinableTable
a promise that will be resolved with the newly created table holding the results of the specified exact join operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right table being added to the output.- Specified by:
exactJoin
in interfaceJoinableTable
- Parameters:
rightTable
- the table to match to values in this tablecolumnsToMatch
- the columns that should match exactlycolumnsToAdd
- columns from the right table to add to the resulting table, empty/null/absent to add all columns- Returns:
- a promise that will resolve to the joined table
-
naturalJoin
@JsMethod public elemental2.promise.Promise<JsTable> naturalJoin(JoinableTable rightTable, elemental2.core.JsArray<String> columnsToMatch, @JsOptional elemental2.core.JsArray<String> columnsToAdd) Description copied from interface:JoinableTable
a promise that will be resolved with the newly created table holding the results of the specified natural join operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the right table being added to the output.- Specified by:
naturalJoin
in interfaceJoinableTable
- Parameters:
rightTable
- the table to match to values in this tablecolumnsToMatch
- the columns that should match exactlycolumnsToAdd
- columns from the right table to add to the resulting table, empty/null/absent to add all columns- Returns:
- a promise that will resolve to the joined table
-
byExternal
@JsMethod public elemental2.promise.Promise<JsPartitionedTable> byExternal(Object keys, @JsOptional Boolean dropKeys) -
partitionBy
@JsMethod public elemental2.promise.Promise<JsPartitionedTable> partitionBy(Object keys, @JsOptional Boolean dropKeys) Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified keys.- Parameters:
keys
-dropKeys
-- Returns:
- Promise dh.PartitionedTable
-
getColumnStatistics
a promise that will resolve to ColumnStatistics for the column of this table.- Parameters:
column
-- Returns:
- Promise of dh.ColumnStatistics
-
seekRow
@JsMethod public elemental2.promise.Promise<Double> seekRow(double startingRow, Column column, @TsTypeRef(ValueType.class) @TsTypeRef(ValueType.class) String valueType, jsinterop.base.Any seekValue, @JsOptional @JsNullable Boolean insensitive, @JsOptional @JsNullable Boolean contains, @JsOptional @JsNullable Boolean isBackwards) Seek the row matching the data provided- Parameters:
startingRow
- Row to start the seek fromcolumn
- Column to seek for value onvalueType
- Type of value providedseekValue
- Value to seekinsensitive
- Optional value to flag a search as case-insensitive. Defaults to `false`.contains
- Optional value to have the seek value do a contains search instead of exact equality. Defaults to `false`.isBackwards
- Optional value to seek backwards through the table instead of forwards. Defaults to `false`.- Returns:
- A promise that resolves to the row value found.
-
maybeRevive
-
revive
-
downsample
public elemental2.promise.Promise<JsTable> downsample(LongWrapper[] zoomRange, int pixelCount, String xCol, String[] yCols) Get a downsampled version of the table. Currently only supports downsampling with an Instant or long `xCol`.- Parameters:
zoomRange
- The visible range as `[start, end]` or null to always use all data.pixelCount
- The width of the visible area in pixels.xCol
- The name of the X column to downsample. Must be an Instant or long.yCols
- The names of the Y columns to downsample.- Returns:
- A promise that resolves to the downsampled table.
-
isClosed
@JsProperty(name="isClosed") public boolean isClosed()True if this table has been closed.- Returns:
- boolean
-
isRefreshing
@JsProperty(name="isRefreshing") public boolean isRefreshing()True if this table may receive updates from the server, including size changed events, updated events after initial snapshot.- Returns:
- boolean
-
isUncoalesced
@JsProperty(name="isUncoalesced") public boolean isUncoalesced()Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but this can be very expensive. To see which partitions are available, check each column on the table to see which have
Column.getIsPartitionColumn()
astrue
, and filter those columns. To read the possible values for those columns, useselectDistinct(Column[])
.- Returns:
- True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
-
getPluginName
-
getHandle
- Specified by:
getHandle
in interfaceHasTableBinding
-
getHeadHandle
-
toString
-
getConnection
- Specified by:
getConnection
in interfaceServerObject
-
isActive
-
setState
- Specified by:
setState
in interfaceHasTableBinding
-
getBinding
-
getCache
-
hasHandle
- Specified by:
hasHandle
in interfaceHasTableBinding
-
hasRollbackHandle
-
setRollback
- Specified by:
setRollback
in interfaceHasTableBinding
-
rollback
public void rollback()- Specified by:
rollback
in interfaceHasTableBinding
-
setSize
public void setSize(double s) -
getSubscriptionId
public int getSubscriptionId() -
maybeReviveSubscription
public void maybeReviveSubscription()- Specified by:
maybeReviveSubscription
in interfaceHasTableBinding
-