Skip to content

refactor(common): add multi-network support to PhysicalTable#1968

Merged
Theodus merged 3 commits intomainfrom
theodus/derived-dataset-networks
Mar 13, 2026
Merged

refactor(common): add multi-network support to PhysicalTable#1968
Theodus merged 3 commits intomainfrom
theodus/derived-dataset-networks

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Mar 12, 2026

Derived tables will soon depend on raw datasets from multiple networks. Store resolved networks as BTreeSet on PhysicalTable so downstream consumers have accurate network information.

  • Add PhysicalTable.networks: BTreeSet<NetworkId> populated at construction time; raw tables contribute a singleton, derived tables resolve from transitive dependencies
  • Extract collect_raw_datasets shared traversal in datasets_cache and rewrite resolve_dataset_networks and resolve_raw_dataset_from_dependencies on top of it
  • Resolve networks per-table at each from_revision call site, keeping Table::network() as the intrinsic single-network accessor
  • Update find_cross_network_join to compare BTreeSet<NetworkId> per table instead of a single optional network

@Theodus Theodus mentioned this pull request Mar 12, 2026
17 tasks
Derived tables will soon depend on raw datasets from multiple networks.
Store resolved networks as BTreeSet<NetworkId> on PhysicalTable
so downstream consumers have accurate network information.

- Add `PhysicalTable.networks: BTreeSet<NetworkId>` populated at
  construction time; raw tables contribute a singleton, derived
  tables resolve from transitive dependencies
- Extract `collect_raw_datasets` shared traversal in `datasets_cache`
  and rewrite `resolve_dataset_networks` and
  `resolve_raw_dataset_from_dependencies` on top of it
- Resolve networks per-table at each `from_revision` call site,
  keeping `Table::network()` as the intrinsic single-network accessor
- Update `find_cross_network_join` to compare `BTreeSet<NetworkId>`
  per table instead of a single optional network
@Theodus Theodus force-pushed the theodus/derived-dataset-networks branch from 76819ee to 2617d13 Compare March 12, 2026 20:27
Copy link
Contributor

@shiyasmohd shiyasmohd left a comment

Choose a reason for hiding this comment

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

LGTM. Added some suggestion in comments.

dataset.reference().clone(),
dataset.start_block(),
table_def.clone(),
table_def.network().into_iter().cloned().collect(),
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be an accessor method in Table trait, something like network_set() which can be used in a lot places.

Theodus and others added 2 commits March 13, 2026 09:36
Co-authored-by: Shiyas Mohammed <83513144+shiyasmohd@users.noreply.github.com>
Signed-off-by: Theo Butler <theodusbutler@gmail.com>
Co-authored-by: Shiyas Mohammed <83513144+shiyasmohd@users.noreply.github.com>
Signed-off-by: Theo Butler <theodusbutler@gmail.com>
@Theodus Theodus merged commit 2cda302 into main Mar 13, 2026
8 checks passed
@Theodus Theodus deleted the theodus/derived-dataset-networks branch March 13, 2026 13:40
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