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

ParameterTypeDescription
idColumnString

The name of the ID column. Each ID must be unique. If the source table has a duplicate ID, tree throws an error.

parentColumnString

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:

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 a TreeTable.NodeOperationsRecorder, which records node-level operations when capturing snapshots.
  • rebase(newSource) - Create a new TreeTable based on newSource, inheriting this tree table's identifier column, parent column, node filter columns, and node operations. newSource must have the same table definition as the source of this tree table.
  • withFilter(filter) - Create a new TreeTable with the specified Filter applied.
  • withNodeFilterColumns(columns) - Create a new TreeTable with the specified columns, a Collection of ColumnName objects, designated for node-level filtering.
  • withNodeOperations(nodeOperations) - Create a new TreeTable that 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.

A user navigates between the source table and result tree 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.