Skip to content

Conversation

Weijun-H
Copy link
Contributor

@Weijun-H Weijun-H commented Oct 2, 2025

Related

Closes #10356

What

Introduce dds convenience methods to ChunkBuilder for creating static chunks (chunks with no timeline data). Previously, users had to manually pass TimePoint::default() to create static/timeless data.

Changes Made

New Methods Added to ChunkBuilder:

  • with_static_row()
  • with_static_sparse_row()
  • with_static_archetype()
  • with_static_component()
  • with_static_component_batch()
  • with_static_component_batches()
  • with_static_sparse_component_batches()
  • with_static_serialized_batch()
  • with_static_serialized_batches()
  • with_static_sparse_serialized_batches()

@grtlr
Copy link
Member

grtlr commented Oct 6, 2025

It's not possible to build a chunk that mixes static and non-static data. I think adding these methods could lead someone to expect that this were possible (even more than the current API).

I think the root cause for this is the Debug-derive on TimePoint. I think we should rather deprecate that in favor of the already existing TimePoint::STATIC constant.

@Weijun-H
Copy link
Contributor Author

Weijun-H commented Oct 6, 2025

It's not possible to build a chunk that mixes static and non-static data. I think adding these methods could lead someone to expect that this were possible (even more than the current API).

I think the root cause for this is the Debug-derive on TimePoint. I think we should rather deprecate that in favor of the already existing TimePoint::STATIC constant.

Hi @grtlr, thanks for reviewing. I agree. However, TimePoint::default() is too widely used to remove without causing breaking changes. As an alternative, we could add a check guard in with_sparse_row to prevent mixing static and temporal data in the same chunk. This would catch mixed chunks earlier while keeping the new static method available.

Comment on lines +273 to +280
#[inline]
pub fn with_static_row(
self,
row_id: RowId,
components: impl IntoIterator<Item = (ComponentDescriptor, ArrayRef)>,
) -> Self {
self.with_row(row_id, TimePoint::default(), components)
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of duplicating all of this API, the user can just call .with_row(row_id, TimePoint::STATIC, …). Obviously that wasn't discoverable enough. Not sure how we fix that, but maybe adding it as part of the docstring for .with_row and friends?

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.

Utility for creating static chunks using ChunkBuilder
3 participants