Skip to content

Conversation

@silverweed
Copy link
Contributor

@silverweed silverweed commented Jan 29, 2026

Last part of #19904.

Adds a writing analogue to RPageSourceFile::OpenWithDifferentAnchor, which allows to derive a new Sink from an existing one using the same underlying directory but writing to a different RNTuple.
Was previously called DeriveFor but I found the name too obscure and I think this is clearer.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit fa2b7b6.

♻️ This comment has been updated with latest results.

@silverweed silverweed marked this pull request as draft January 29, 2026 12:10
@silverweed silverweed marked this pull request as ready for review January 29, 2026 12:23
@pcanal
Copy link
Member

pcanal commented Jan 29, 2026

which allows to derive a new Sink from an existing one using the same underlying directory but writing to a different RNTuple.

Do we also need to support the case where the user would like to clone in a different directory (and/or is it mostly for internal use)?

@silverweed
Copy link
Contributor Author

which allows to derive a new Sink from an existing one using the same underlying directory but writing to a different RNTuple.

Do we also need to support the case where the user would like to clone in a different directory (and/or is it mostly for internal use)?

It's for internal use only (for the Attributes) and we always want to write to the same directory

~RNTupleFileWriter();

/// Creates a new RNTupleFileWriter with the same underlying TDirectory as this but writing to a different
/// RNTuple named `ntupleName`. This class is not thread safe, so one of the two writers may be writing to the file
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the point is not so much that the class is not thread-safe (because we create to separate objects). It's more that both classes operate on the same underlying file resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But writing to the same file simultaneously is only a problem is you do it in parallel, no?

Copy link
Contributor

@jblomer jblomer Feb 4, 2026

Choose a reason for hiding this comment

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

Yes, that's right. It's a nit anyway, feel free to resolve this.

Writing analogue to RPageSourceFile::OpenWithDifferentAnchor, it allows
to derive a new Sink from an existing one using the same underlying
directory but writing to a different RNTuple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants