Skip to content

[ntuple] Attributes: add support for writing#21289

Open
silverweed wants to merge 8 commits intoroot-project:masterfrom
silverweed:ntuple_attr_write
Open

[ntuple] Attributes: add support for writing#21289
silverweed wants to merge 8 commits intoroot-project:masterfrom
silverweed:ntuple_attr_write

Conversation

@silverweed
Copy link
Contributor

This Pull request:

adds the RNTupleAttrSetWriter class and initial support for writing attributes. This involves touching, among other classes, the RNTupleWriter, RNTupleFillContext, RPageSink and RMiniFile.

Original reference PR (now quite outdated): #19153

Checklist:

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

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Test Results

    21 files      21 suites   3d 1h 57m 5s ⏱️
 3 808 tests  3 807 ✅ 1 💤 0 ❌
72 085 runs  72 076 ✅ 9 💤 0 ❌

Results for commit 7ae91e3.

♻️ This comment has been updated with latest results.

@silverweed silverweed added the clean build Ask CI to do non-incremental build on PR label Feb 18, 2026
@silverweed silverweed force-pushed the ntuple_attr_write branch 4 times, most recently from 16e0a45 to 9b598df Compare February 23, 2026 10:05
Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

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

A first review... I think one high-level decision to make is where to build RNTupleAttrSetDescriptor. RNTupleFileWriter feels like the wrong place to do this.

Comment on lines +58 to +59
inline const std::uint16_t kSchemaVersionMajor = 1;
inline const std::uint16_t kSchemaVersionMinor = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Should these move into the RNTuple class where we have the other constants such as kVersionEpoch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly; though these only concern attributes so it's not necessarily interesting for users of the RNTuple class. It's a matter of deciding whether we want to centralize these binary specs-related constants or not.
I have no strong opinion either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking again about this, I'd not put these in RNTuple as that's only one specific anchor, whereas these constants are anchor-agnostic.
If anything they might live in the Serializer, but I'd rather keep them close to the other related constants (rangeStartFieldName etc).
Probably in a separate header that is only included by some cxx file and not directly exposed to users.

Copy link
Member

Choose a reason for hiding this comment

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

AFAICT we are already using the constants in RNTuple to initialize the RNTupleDescriptorBuilder...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, but I'm not sure that was the best decision on our side. In retrospect, I'd probably have put them in some dedicated namespace (although I see the argument of using the RNTuple name to namespace them)...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you're ok with it I would for now keep them somewhere Internal so we can change our mind later. It's not a consequential decision anyway. They can go either in the RNTupleAttrWriting header or in the RNTupleSerializer probably.

@silverweed
Copy link
Contributor Author

Thanks for the thorough review @hahnjo! For the descriptor building I agree it feels weird to have it in the Writer; let's talk about it offline.

@silverweed silverweed force-pushed the ntuple_attr_write branch 8 times, most recently from 2d7c429 to b20c52b Compare March 4, 2026 15:03
@silverweed silverweed requested a review from hahnjo March 5, 2026 09:07
@silverweed silverweed requested a review from hahnjo March 12, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:RNTuple

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants