Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ntuple] remove kNTupleUnknownCompression #17389

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jblomer
Copy link
Contributor

@jblomer jblomer commented Jan 9, 2025

Instead represent undefined/unknown compression settings by std::optional<>. Also allows for representing compression settings as unsigned integer.

@jblomer jblomer self-assigned this Jan 9, 2025
@@ -166,8 +166,8 @@ ROOT::Experimental::RNTupleInspector::Create(std::string_view ntupleName, std::s

std::string ROOT::Experimental::RNTupleInspector::GetCompressionSettingsAsString() const
{
int algorithm = fCompressionSettings / 100;
int level = fCompressionSettings - (algorithm * 100);
int algorithm = fCompressionSettings.value() / 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this properly handle the case where compression is unknown, rather than throwing?

@@ -162,7 +162,7 @@ RNTupleExporter::RPagesResult RNTupleExporter::ExportPages(RPageSource &source,
const std::uint64_t pageBufSize = pageInfo.fLocator.GetNBytesOnStorage() + maybeChecksumSize;
std::ostringstream ss{options.fOutputPath, std::ios_base::ate};
ss << "/cluster_" << clusterDesc.GetId() << "_" << colInfo.fQualifiedName << "_page_" << pageIdx
<< "_elems_" << pageInfo.fNElements << "_comp_" << colRange.fCompressionSettings << ".page";
<< "_elems_" << pageInfo.fNElements << "_comp_" << colRange.fCompressionSettings.value() << ".page";
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this properly handle the case where compression is unknown, rather than throwing?

@@ -212,7 +213,7 @@ public:
///
/// \note Here, we assume that the compression settings are consistent across all clusters and columns. If this is
/// not the case, an exception will be thrown when RNTupleInspector::Create is called.
int GetCompressionSettings() const { return fCompressionSettings; }
int GetCompressionSettings() const { return fCompressionSettings.value(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why this shouldn't return an optional?
The comment states that "we assume that the compression settings are consistent across all clusters and columns" - do we also assume the compression settings are not unknown? Perhaps we should add a brief explanation on why fCompressionSettings is an optional, it might not be obvious to a future reader.

@jblomer jblomer force-pushed the ntuple-cleanup-utils-v2 branch from b275935 to 9f88206 Compare January 9, 2025 14:38
Copy link

github-actions bot commented Jan 9, 2025

Test Results

    16 files      16 suites   3d 17h 50m 20s ⏱️
 2 694 tests  2 691 ✅ 0 💤  3 ❌
41 725 runs  41 677 ✅ 0 💤 48 ❌

For more details on these failures, see this check.

Results for commit 9f88206.

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