Repository navigation
refactor: move each TableScan subclass to its own file - #994
Merged
Merged
Conversation
Move DataTableScan, IncrementalAppendScan and IncrementalChangelogScan
into data_table_scan.{h,cc}, incremental_append_scan.{h,cc} and
incremental_changelog_scan.{h,cc}. table_scan.{h,cc} keep TableScan,
IncrementalScan, TableScanBuilder, the scan task types and
TableScanContext.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The refactor consistently relocates implementations, updates consumers and build inputs, and introduces no apparent behavioral defects.
0 open findings
What changed in this PR
Splits concrete table-scan implementations into dedicated files while retaining shared scan infrastructure in table_scan.
Changes:
- Adds separate headers and sources for data, incremental append, and changelog scans.
- Updates build configuration, public-header compatibility coverage, and includes.
- Keeps shared builder logic and explicit template instantiations in
table_scan.cc.
| File | Description |
|---|---|
src/iceberg/data_table_scan.h |
Declares DataTableScan. |
src/iceberg/data_table_scan.cc |
Implements data-scan planning and reporting. |
src/iceberg/incremental_append_scan.h |
Declares incremental append scans. |
src/iceberg/incremental_append_scan.cc |
Implements incremental append planning. |
src/iceberg/incremental_changelog_scan.h |
Declares incremental changelog scans. |
src/iceberg/incremental_changelog_scan.cc |
Implements changelog planning. |
src/iceberg/table_scan.h |
Retains shared scan APIs. |
src/iceberg/table_scan.cc |
Retains shared logic and template instantiations. |
src/iceberg/table.cc |
Includes concrete scan definitions. |
src/iceberg/CMakeLists.txt |
Builds the new sources. |
src/iceberg/cpp20_compatibility_internal.h |
Covers the new public headers. |
src/iceberg/test/table_scan_test.cc |
Includes the data-scan header. |
src/iceberg/test/scan_planning_metrics_test.cc |
Includes the data-scan header. |
src/iceberg/test/incremental_append_scan_test.cc |
Includes the append-scan header. |
src/iceberg/test/incremental_changelog_scan_test.cc |
Includes the changelog-scan header. |
example/demo_example.cc |
Includes the concrete data-scan API. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wgtmac
approved these changes
Oct 11, 2026
wgtmac
left a comment
Member
There was a problem hiding this comment.
I'm not sure if it is worth adding a new scan subdirectory for this but this is unrelated to this PR.
Member
Author
|
Agreed. The file list under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Move each
TableScansubclass into its own header and source file:DataTableScan→iceberg/data_table_scan.{h,cc}, together with the scanreport helpers that only it uses.
IncrementalAppendScan→iceberg/incremental_append_scan.{h,cc}.IncrementalChangelogScan→iceberg/incremental_changelog_scan.{h,cc}.iceberg/table_scan.{h,cc}keepTableScan,IncrementalScan,TableScanBuilder, the scan task types andTableScanContext. Theextern templatedeclaration of eachTableScanBuilderspecialization movesnext to its scan class, while the explicit instantiations stay in
table_scan.ccwith the builder's member definitions.ResolvePlanFilesstaysin
table_scan.ccwith the snapshot range helpers it calls and is explicitlyinstantiated for
FileScanTaskandChangelogScanTask.The moved code is unchanged.
cpp20_compatibility_internal.his regenerated toinclude the new public headers, and callers include the header of the scan they
use.
Why
table_scan.ccheld the planning logic of every scan type next to the builderand the task types, close to 1,000 lines, and each new planning feature grows
it further. One file per scan keeps each scan's planning logic in one place
and the shared scan machinery in
table_scan.Behavior change
iceberg/table_scan.hno longer declaresDataTableScan,IncrementalAppendScanorIncrementalChangelogScan. Code that uses thembeyond the forward declarations in
iceberg/type_fwd.h, for example to callBuild()andPlanFiles(), must includeiceberg/data_table_scan.h,iceberg/incremental_append_scan.horiceberg/incremental_changelog_scan.h.Testing
scan_testpasses, andcpp20_compatibility_testbuilds with the regeneratedpublic header list.
🤖 Generated with Claude Code