Skip to content

Conversation

@Akanksha-kedia
Copy link
Contributor

File Modified: FixedByteSingleValueMultiColumnReaderWriter.java

Location: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/readerwriter/impl/FixedByteSingleValueMultiColumnReaderWriter.java

Improvement: Enhanced the close() method with defensive null checks to prevent NullPointerException during resource cleanup.

Before:

@Override
public void close() throws IOException {
  for (FixedByteSingleValueMultiColWriter writer : _writers) {
    writer.close();
  }
  for (FixedByteSingleValueMultiColReader reader : _readers) {
    reader.close();
  }
}

After:

@Override
public void close() throws IOException {
  if (_writers != null) {
    for (FixedByteSingleValueMultiColWriter writer : _writers) {
      if (writer != null) {
        writer.close();
      }
    }
  }
  if (_readers != null) {
    for (FixedByteSingleValueMultiColReader reader : _readers) {
      if (reader != null) {
        reader.close();
      }
    }
  }
}

Impact

Prevents NullPointerException during resource cleanup
Improves robustness of the close() method
Follows defensive programming best practices
No functional changes to normal operation
Low risk - purely defensive improvement

@Akanksha-kedia
Copy link
Contributor Author

@xiangfu0 please review

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.21%. Comparing base (eb4c342) to head (c016bbf).

Files with missing lines Patch % Lines
...l/FixedByteSingleValueMultiColumnReaderWriter.java 60.00% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17110      +/-   ##
============================================
- Coverage     63.24%   63.21%   -0.03%     
  Complexity     1428     1428              
============================================
  Files          3104     3104              
  Lines        183423   183427       +4     
  Branches      28112    28116       +4     
============================================
- Hits         116010   115961      -49     
- Misses        58442    58501      +59     
+ Partials       8971     8965       -6     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.18% <60.00%> (-0.01%) ⬇️
java-21 63.18% <60.00%> (-0.01%) ⬇️
temurin 63.21% <60.00%> (-0.03%) ⬇️
unittests 63.21% <60.00%> (-0.03%) ⬇️
unittests1 56.24% <0.00%> (+0.01%) ⬆️
unittests2 33.60% <60.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@yashmayya yashmayya left a comment

Choose a reason for hiding this comment

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

Why is this change needed? When can the readers or writers be null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants