Skip to content

[BugFix] Fix ORC file metric construction in AddFilesProcedure#71220

Open
Guosmilesmile wants to merge 1 commit intoStarRocks:mainfrom
Guosmilesmile:fix_orc_metric
Open

[BugFix] Fix ORC file metric construction in AddFilesProcedure#71220
Guosmilesmile wants to merge 1 commit intoStarRocks:mainfrom
Guosmilesmile:fix_orc_metric

Conversation

@Guosmilesmile
Copy link
Copy Markdown
Contributor

@Guosmilesmile Guosmilesmile commented Apr 2, 2026

Why I'm doing:

In AddFilesProcedure extractOrcMetrics, ORC's Reader.getStatistics() returns file-level stats at index 0, with actual column stats starting from index 1. The current code iterates from index 0, causing all column metrics to be shifted by one position.

What I'm doing:

Fix the off-by-one bug by starting the loop from colId = 1 and passing colId - 1 to getColumnNameFromOrcSchem to create correct metric in orc

Fixes #71222
Issue: #71222

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

@Guosmilesmile
Copy link
Copy Markdown
Contributor Author

Hi @Youngwb , please help to
review if you have time. thx

Signed-off-by: chrisyguo <511955993@qq.com>
@CelerData-Reviewer
Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

[FE Incremental Coverage Report]

pass : 2 / 2 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/connector/iceberg/procedure/AddFilesProcedure.java 2 2 100.00% []

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

AddFilesProcedure incorrectly retrieves metrics for ORC files

3 participants