Skip to content

tp: assign dense tree node numbers - #7213

Open
LalitMaganti wants to merge 1 commit into
mainfrom
dev/lalitm/exec-tree-number-nodes
Open

tp: assign dense tree node numbers#7213
LalitMaganti wants to merge 1 commit into
mainfrom
dev/lalitm/exec-tree-number-nodes

Conversation

@LalitMaganti

@LalitMaganti LalitMaganti commented Aug 25, 2026

Copy link
Copy Markdown
Member

Tree IDs can be sparse, strings, or row IDs from a table much larger than the
query result. Arrays indexed by those IDs would scale with the ID range rather
than the tree being processed.

TreeNumberNodes assigns stable dense numbers as rows arrive and appends the
numbered node and parent columns to each batch. A parent is numbered when first
referenced, so child-first input works even when the parent row appears later.

The original columns stay in the batch. Later tree operators get compact
indices without losing the values needed in the result.

@LalitMaganti LalitMaganti changed the title tp: number tree nodes densely tp: assign dense tree node numbers Aug 25, 2026
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from a8cbdaa to 90f2c16 Compare August 25, 2026 14:59
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from 90f2c16 to 1287f35 Compare August 25, 2026 16:50
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from 1287f35 to 502083b Compare August 26, 2026 16:44
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from 502083b to 3c03736 Compare August 26, 2026 17:05
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from 3c03736 to bef6e17 Compare August 26, 2026 17:13
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from bef6e17 to ba601d3 Compare August 26, 2026 17:39
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch 2 times, most recently from ce1a1d6 to 63f9459 Compare September 2, 2026 23:56
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch 2 times, most recently from 456ac69 to e602268 Compare September 3, 2026 10:10
@LalitMaganti
LalitMaganti marked this pull request as ready for review September 3, 2026 10:17
@LalitMaganti
LalitMaganti requested a review from a team as a code owner September 3, 2026 10:17
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from e602268 to 1fc64d1 Compare September 3, 2026 10:22
Base automatically changed from dev/lalitm/exec-assert-column-type to main September 3, 2026 11:03
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch from 1fc64d1 to 8802921 Compare September 3, 2026 11:03
Tree IDs can be sparse, strings, or row IDs from a table much larger than the
query result. Arrays indexed by those IDs would scale with the ID range rather
than the tree being processed.

TreeNumberNodes assigns stable dense numbers as rows arrive and appends the
numbered node and parent columns to each batch. A parent is numbered when first
referenced, so child-first input works even when the parent row appears later.

The original columns stay in the batch. Later tree operators get compact
indices without losing the values needed in the result.
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/exec-tree-number-nodes branch 2 times, most recently from 8802921 to ffad8df Compare September 3, 2026 11:04
private:
struct Key {
int64_t value;
bool string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants