Skip to content

refactor: replace includeColumnIndexes list lookup with ColumnIndexResolver - #1015

Merged
delei merged 10 commits into
apache:mainfrom
bengbengbalabalabeng:refactor-columns-filter-read
Aug 24, 2026
Merged

refactor: replace includeColumnIndexes list lookup with ColumnIndexResolver#1015
delei merged 10 commits into
apache:mainfrom
bengbengbalabalabeng:refactor-columns-filter-read

Conversation

@bengbengbalabalabeng

@bengbengbalabalabeng bengbengbalabalabeng commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Related: #950

Replace duplicate List<Integer> includeColumnIndexes logic across read handlers with a strategy-based ColumnIndexResolver.

What's changed?

  • Removed ReadSheet#columnIndexes and added ReadSheet#columnIndexResolver.
  • Added ReadSheetHolder#determineTargetColumnIndex(columnIndex) method.
  • Added ColumnIndexResolver.PASS_THROUGH: Keep original column indices.
  • Added DefaultIncludedColumnIndexResolver: Rewrite target columns’ internal indexes to consecutive (0-based).
    • Replace the original List.indexOf() lookup with Map.get() to improve lookup efficiency and semantic clarity.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@delei delei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@delei
delei merged commit cf602d6 into apache:main Aug 24, 2026
9 checks passed
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.

4 participants