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 raises an error if given one. To build a tree from a blink table, first convert it to an append-only table with blink_to_append_only.

Syntax

Parameters

ParameterTypeDescription
id_colstr

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

parent_colstr

The name of the parent column. It must have the same type as the ID column.

promote_orphans optionalbool

Whether to promote node tables whose parents do not exist to be children of the root node. The default is False.

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 creates a tree table from a source table that contains orphans. The first omits orphan nodes, while the second promotes them such that they appear in the tree table.