Skip to content

Conversation

@hongkunxu
Copy link
Contributor

In SegmentProcessorUtils, fields are classified and sorted when collecting all FieldSpecs.
However, there is a logical issue in the current implementation: although fields are added in the intended order, the sorting of nonMetricFieldSpecs happens after they are added to the final list, so the sort has no effect.
While this does not currently impact downstream behavior, the logic is incorrect and potentially misleading. This PR fixes the ordering to ensure the sorting is applied as intended.

Hi @Jackie-Jiang @xiangfu0 , please help review this PR when you are free.

Signed-off-by: Hongkun Xu <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.26%. Comparing base (7ca1984) to head (87cd792).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17467      +/-   ##
============================================
- Coverage     63.28%   63.26%   -0.03%     
  Complexity     1476     1476              
============================================
  Files          3162     3162              
  Lines        188701   188701              
  Branches      28877    28877              
============================================
- Hits         119425   119378      -47     
- Misses        60017    60064      +47     
  Partials       9259     9259              
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.22% <100.00%> (-0.01%) ⬇️
java-21 63.22% <100.00%> (-0.04%) ⬇️
temurin 63.26% <100.00%> (-0.03%) ⬇️
unittests 63.25% <100.00%> (-0.03%) ⬇️
unittests1 55.58% <100.00%> (-0.03%) ⬇️
unittests2 34.02% <0.00%> (-0.01%) ⬇️

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.

@xiangfu0 xiangfu0 requested review from Copilot and xiangfu0 January 9, 2026 07:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a logical bug in SegmentProcessorUtils where field specs were being sorted after being added to the final list, making the sort ineffective. The fix reorders the operations to sort each collection before adding it to the output list.

Key changes:

  • Moved the sorting of nonMetricFieldSpecs to occur before adding them to fieldSpecs
  • Moved the sorting of metricFieldSpecs to occur before adding them to fieldSpecs

@xiangfu0 xiangfu0 added the bugfix label Jan 9, 2026
@xiangfu0 xiangfu0 merged commit e4625b7 into apache:master Jan 9, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants