Skip to content

Conversation

enirolf
Copy link
Contributor

@enirolf enirolf commented Sep 25, 2025

For snapshotting to RNTuple, users can now pass an RNTupleWriteOptions to RSnapshotOptions to configure the output RNTuple. Compression settings that have been set directly through RSnapshotOptions::fCompressionAlgorithm and RSnapshotOptions::fCompressionLevel are propagated to RSnapshotOptions::fNTupleWriteOpts, provided that they haven't been set there already as well.

In addition, a check has been added to warn users when they set options that are specific to one output format, but RSnapshotOptions.fOutputFormat has been set to use the other.

Closes #19784.

N.B., compression settings that have been set directly through the
snapshot options are propagated to the RNTuple write options, provided
that they haven't been set there as well.
... and warn users when an option has been set that has no effect on the
chosen output format.
Copy link

Test Results

    21 files      21 suites   3d 13h 43m 27s ⏱️
 3 678 tests  3 677 ✅  0 💤 1 ❌
75 420 runs  75 408 ✅ 10 💤 2 ❌

For more details on these failures, see this check.

Results for commit b94a6b8.

Comment on lines +954 to +958
if (opts.fAutoFlush != defaultSnapshotOpts.fAutoFlush) {
Warning("Snapshot", "The TTree-specific fAutoFlush option in RSnapshotOptions has been set, but the output "
"format is set to RNTuple, so this option won't have any effect. Use the "
"fNTupleWriteOptions option available in RSnapshotOptions to configure the output "
"RNTuple. Alternatively, change fOutputFormat to snapshot to TTree instead.");
Copy link
Member

Choose a reason for hiding this comment

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

Consider:

Suggested change
if (opts.fAutoFlush != defaultSnapshotOpts.fAutoFlush) {
Warning("Snapshot", "The TTree-specific fAutoFlush option in RSnapshotOptions has been set, but the output "
"format is set to RNTuple, so this option won't have any effect. Use the "
"fNTupleWriteOptions option available in RSnapshotOptions to configure the output "
"RNTuple. Alternatively, change fOutputFormat to snapshot to TTree instead.");
const char *issueWith = nullptr;
if (opts.fAutoFlush != defaultSnapshotOpts.fAutoFlush) {
issueWith = "fAutoFlush";
} else if ....
...
}
Warning("Snapshot", "The TTree-specific %s option in RSnapshotOptions has been set, but the output "
"format is set to RNTuple, so this option won't have any effect. Use the "
"fNTupleWriteOptions option available in RSnapshotOptions to configure the output "
"RNTuple. Alternatively, change fOutputFormat to snapshot to TTree instead.", issueWith);

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

LGTM.

// compression settings in fNTupleWriteOpts have not been changed, and the compression algorithm or level in fOptions
// have.
if (fOptions.fNTupleWriteOpts.GetCompression() == RCompressionSetting::EDefaults::kUseGeneralPurpose &&
(fOptions.fCompressionAlgorithm != RCompressionSetting::EAlgorithm::kZLIB ||
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 that leaves the possibility that a user explicitly sets fCompression... to what happens to be the current default, but then is surprised because RNTuple doesn't pick it up but continue to use its zstd default. I don't have a good solution though, maybe that's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, good point. Perhaps to avoid situations like these it might be better to also warn users for fCompression..., and require them to be set through fNTupleWriteOpts only.

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.

[df] RNTuple snapshot + TTree-specific options
3 participants