tree
The Deephaven tree method creates a tree table from a source table given an ID column name and parent column name.
tree does not support a blink table source and throws an error if given one. To build a tree from a blink table, first convert it to an append-only table with blinkToAppendOnly.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| idColumn | String | The name of the ID column. Each ID must be unique. If the source table has a duplicate ID, |
| parentColumn | String | The name of the parent column. It must have the same type as the ID column. |
Methods
Static
The TreeTable interface has the following static methods:
promoteOrphans(Table, String, String)- Adapt a source table to be used for a tree to ensure that the result will have no orphaned nodes.
Instance
The following methods can be called on an instance of TreeTable:
getIdentifierColumn- Get the name of the identifier column used to create the tree table.getNodeDefinition- Get the TableDefinition that should be exposed to node table consumers.getParentIdentifierColumn- Get the name of the parent identifier column used to create the tree table.makeNodeOperationsRecorder- Create aTreeTable.NodeOperationsRecorder, which records node-level operations when capturing snapshots.rebase(newSource)- Create a newTreeTablebased onnewSource, inheriting this tree table's identifier column, parent column, node filter columns, and node operations.newSourcemust have the same table definition as the source of this tree table.withFilter(filter)- Create a newTreeTablewith the specifiedFilterapplied.withNodeFilterColumns(columns)- Create a newTreeTablewith the specified columns, aCollectionofColumnNameobjects, designated for node-level filtering.withNodeOperations(nodeOperations)- Create a newTreeTablethat will apply the recorded operations to nodes when gathering snapshots.
Returns
A tree table.
Examples
The following example creates a tree table from a static table.
The following example creates a tree table from a real-time table.

The following example contains orphan nodes. Two tree tables are created. The first omits orphan nodes, while the second promotes them such that they appear in the tree table.