Repository navigation
[INTERNAL,TEST] deduplicate XIC/XIM parquet reader helpers - #9691
Conversation
Extract shared Arrow/Parquet reader plumbing into an internal helper used by XICParquetFile and XIMParquetFile. Keep the public reader and row-struct APIs unchanged, and add regression coverage for LARGE_STRING plus FLOAT/DOUBLE parquet column handling.
|
@singjc The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-30 15:06:49.202193458 +0000
+++ AUTHORS.new 2026-06-30 15:06:54.662685687 +0000
@@ -113,6 +113,7 @@
- Sandro Andreotti
- Santhil
- Simon Gene Gottlieb
+ - singjc
- Steffen Sass
- Stephan Aiche
- Sven Nahnsen |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA shared ChangesShared Parquet helper extraction
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (6)
src/tests/class_tests/openms/source/XICParquetFile_test.cpp (2)
29-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
TEST_TRUEfor boolean assertions.These assertions use
TEST_EQUAL(..., true), but this test tree prefersTEST_TRUE(...)for clearer and more idiomatic failures. As per coding guidelines, "PreferTEST_TRUE(expr)andTEST_FALSE(expr)overTEST_EQUAL(expr, true)andTEST_EQUAL(expr, false)."Also applies to: 36-36, 48-48, 188-188
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/class_tests/openms/source/XICParquetFile_test.cpp` at line 29, Replace the boolean assertions in XICParquetFile_test so they use TEST_TRUE instead of TEST_EQUAL(..., true). Update the checks around builder.Append(value).ok() and the other matching assertions in the same test file to follow the preferred boolean assertion style, using the existing test helper names and keeping the test logic unchanged.Source: Coding guidelines
24-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a couple of
//comments in the new helper/test blocks.The added code is currently all uncommented, which misses the repository’s C++ comment-coverage rule. A short
// Build a one-row parquet table.../// Validate decoded chromatogram fields...style note before each phase would satisfy it without adding noise. As per coding guidelines, "Add comments covering at least ~5% of code using//style, describing the next few lines in plain English."Also applies to: 145-201
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/class_tests/openms/source/XICParquetFile_test.cpp` around lines 24 - 68, The new helper block in XICParquetFile_test.cpp lacks the required `//` comment coverage, so add a couple of short plain-English `//` comments around the helper/test phases in the anonymous-namespace utilities and the related test sections. Place them near the symbols like `appendOk_`, `finishArray_`, `writeParquetTable_`, and the chromatogram validation steps so the added helpers and test flow are clearly documented without changing behavior.Source: Coding guidelines
src/tests/class_tests/openms/source/XIMParquetFile_test.cpp (2)
29-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
TEST_TRUEfor boolean assertions.The new checks still use
TEST_EQUAL(..., true). Please switch them toTEST_TRUE(...)to match the class-test convention. As per coding guidelines, "PreferTEST_TRUE(expr)andTEST_FALSE(expr)overTEST_EQUAL(expr, true)andTEST_EQUAL(expr, false)."Also applies to: 36-36, 48-48, 202-202, 258-258, 265-265
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/class_tests/openms/source/XIMParquetFile_test.cpp` at line 29, The boolean assertions in the XIMParquetFile class tests still use TEST_EQUAL(..., true); update the affected checks in the test cases around builder.Append(value).ok() and the other listed assertions to use TEST_TRUE(...) instead, following the existing class-test convention and keeping the surrounding test logic unchanged.Source: Coding guidelines
24-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd brief
//comments to the new setup/assertion phases.These added helper and test blocks do not include any
//comments, so they currently miss the repository’s C++ comment-coverage requirement. A few short phase comments would be enough. As per coding guidelines, "Add comments covering at least ~5% of code using//style, describing the next few lines in plain English."Also applies to: 145-214, 217-267
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/class_tests/openms/source/XIMParquetFile_test.cpp` around lines 24 - 68, The new helper/setup and assertion sections in the XIMParquetFile tests lack the required brief // coverage comments. Add short plain-English // comments in the relevant helper functions and test-phase blocks, using the nearby symbols like appendOk_, finishArray_, appendBinaryOk_, encodeDoubles_, writeParquetTable_, and the affected test cases to guide placement. Keep the comments focused on the next few lines and ensure the added test code meets the repository’s C++ comment-coverage guideline.Source: Coding guidelines
src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.cpp (1)
1097-1103: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy liftAvoid creating one
RecordBatchper matching row.The manual fallback pushes
batch->Slice(row, 1)for every hit, which can create millions of tiny batches. Build a per-batch boolean mask or index vector and filter/slice once per input batch instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.cpp` around lines 1097 - 1103, The manual fallback in ParquetReaderHelpers::evaluate should not push batch->Slice(row, 1) for every matching row, since that creates one tiny RecordBatch per hit. Update the per-batch filtering logic to collect matches into a boolean mask or row-index vector while iterating the batch, then apply a single filter/slice operation once per input batch and push only the resulting batch.src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.h (1)
14-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winForward-declare Arrow types in this header.
These declarations only use
std::shared_ptr<arrow::Table>,arrow::Schema, andarrow::Array, so the heavyweight Arrow includes can move to the.cpp.Proposed cleanup
-#include <arrow/api.h> -#include <arrow/compute/api.h> +namespace arrow +{ + class Array; + class Schema; + class Table; +}As per coding guidelines, “Use forward declarations in headers where possible and include only base class headers, non-pointer members, and templates.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.h` around lines 14 - 15, The header is pulling in heavy Arrow dependencies unnecessarily; move the Arrow includes out of ParquetReaderHelpers.h and replace them with forward declarations for the Arrow types used there, since this header only needs std::shared_ptr<arrow::Table>, arrow::Schema, and arrow::Array. Update any declarations in ParquetReaderHelpers.h to rely on those forward-declared symbols, and keep the full Arrow includes in the corresponding .cpp or other implementation file where the types are actually used.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.cpp`:
- Around line 277-282: The filter handling in
ParquetReaderHelpers::applyArrowFilter is dropping both unsupported columns and
schema-missing columns, which can silently turn a bad predicate into no filter
at all. Update the column-pruning logic so only explicitly unsupported columns
are removed, and if a referenced column is not found in the schema, reject the
filter as invalid instead of continuing. Use the existing identifiers
unsupported_columns, name_map, and dropped_columns in the applyArrowFilter path
to keep the behavior localized and make unknown filter columns fail fast.
- Around line 489-491: Guard the `arrow::Type::UINT64` path in
`ParquetReaderHelpers::getValue`/the surrounding `switch` so it does not blindly
assign into `Int64`; check the `arrow::UInt64Array::Value(row)` against
`std::numeric_limits<Int64>::max()` before conversion, and return failure or
handle overflow explicitly when the value cannot fit. Use the existing `value`
assignment in the `UINT64` case as the place to add the range check, and keep
the behavior consistent with the other type-conversion branches.
In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.h`:
- Around line 29-69: The helper API in ParquetReaderHelpers is missing the
required Doxygen documentation, including `@brief` tags, grouping, and parameter
notes. Add Doxygen blocks for the public declarations such as
FilterPruningOptions,
readParquetTable/readParquetSchema/readParquetTableColumns/getColumn/getOptionalInt/getOptionalDouble/getOptionalString/getBinaryView/parseFilter/applyArrowFilter/readParquetTableDataset,
and include `@param` descriptions with any relevant ranges or units; keep the docs
aligned with the existing helper names so they remain easy to locate.
---
Nitpick comments:
In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.cpp`:
- Around line 1097-1103: The manual fallback in ParquetReaderHelpers::evaluate
should not push batch->Slice(row, 1) for every matching row, since that creates
one tiny RecordBatch per hit. Update the per-batch filtering logic to collect
matches into a boolean mask or row-index vector while iterating the batch, then
apply a single filter/slice operation once per input batch and push only the
resulting batch.
In `@src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.h`:
- Around line 14-15: The header is pulling in heavy Arrow dependencies
unnecessarily; move the Arrow includes out of ParquetReaderHelpers.h and replace
them with forward declarations for the Arrow types used there, since this header
only needs std::shared_ptr<arrow::Table>, arrow::Schema, and arrow::Array.
Update any declarations in ParquetReaderHelpers.h to rely on those
forward-declared symbols, and keep the full Arrow includes in the corresponding
.cpp or other implementation file where the types are actually used.
In `@src/tests/class_tests/openms/source/XICParquetFile_test.cpp`:
- Line 29: Replace the boolean assertions in XICParquetFile_test so they use
TEST_TRUE instead of TEST_EQUAL(..., true). Update the checks around
builder.Append(value).ok() and the other matching assertions in the same test
file to follow the preferred boolean assertion style, using the existing test
helper names and keeping the test logic unchanged.
- Around line 24-68: The new helper block in XICParquetFile_test.cpp lacks the
required `//` comment coverage, so add a couple of short plain-English `//`
comments around the helper/test phases in the anonymous-namespace utilities and
the related test sections. Place them near the symbols like `appendOk_`,
`finishArray_`, `writeParquetTable_`, and the chromatogram validation steps so
the added helpers and test flow are clearly documented without changing
behavior.
In `@src/tests/class_tests/openms/source/XIMParquetFile_test.cpp`:
- Line 29: The boolean assertions in the XIMParquetFile class tests still use
TEST_EQUAL(..., true); update the affected checks in the test cases around
builder.Append(value).ok() and the other listed assertions to use TEST_TRUE(...)
instead, following the existing class-test convention and keeping the
surrounding test logic unchanged.
- Around line 24-68: The new helper/setup and assertion sections in the
XIMParquetFile tests lack the required brief // coverage comments. Add short
plain-English // comments in the relevant helper functions and test-phase
blocks, using the nearby symbols like appendOk_, finishArray_, appendBinaryOk_,
encodeDoubles_, writeParquetTable_, and the affected test cases to guide
placement. Keep the comments focused on the next few lines and ensure the added
test code meets the repository’s C++ comment-coverage guideline.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 63857e3b-fd80-4aef-ac92-f49ea5e3be6c
📒 Files selected for processing (7)
src/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.cppsrc/openms/source/FORMAT/DATAACCESS/ParquetReaderHelpers.hsrc/openms/source/FORMAT/DATAACCESS/sources.cmakesrc/openms/source/FORMAT/XICParquetFile.cppsrc/openms/source/FORMAT/XIMParquetFile.cppsrc/tests/class_tests/openms/source/XICParquetFile_test.cppsrc/tests/class_tests/openms/source/XIMParquetFile_test.cpp
|
Thanks! |
Description
Address #9688, extract shared Arrow/Parquet reader plumbing into an internal helper used by XICParquetFile and XIMParquetFile.
Keep the public reader and row-struct APIs unchanged, and add regression coverage for LARGE_STRING plus FLOAT/DOUBLE parquet column handling.
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
uint64overflow).FEATURE_RTasfloatvsdouble).FEATURE_RTfloat/double scenarios.uint64overflow handling.