[TASK-248] Builder pattern for CPP#249
Conversation
|
@luoyuxia @zhaohaidao Appreciate you review here. PTAL 🙏 |
There was a problem hiding this comment.
Pull request overview
This PR refactors the C++ bindings to use a builder pattern for creating log scanners, aligning with the Rust and Java APIs. The refactoring replaces four separate methods (NewLogScanner, NewLogScannerWithProjection, NewRecordBatchLogScanner, NewRecordBatchLogScannerWithProjection) on the Table class with a fluent TableScan builder pattern.
Changes:
- Introduced
TableScanbuilder class withProject()method for column projection - Replaced four scanner creation methods with
NewScan()returning aTableScanbuilder TableScanprovidesCreateLogScanner()andCreateRecordBatchScanner()terminal methods- Updated all example code to use the new fluent API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bindings/cpp/include/fluss.hpp | Added TableScan builder class; removed four scanner methods from Table class; added NewScan() method |
| bindings/cpp/src/table.cpp | Implemented TableScan builder with projection support; consolidated scanner creation logic into two terminal methods |
| bindings/cpp/examples/example.cpp | Updated all scanner creation calls to use the new builder pattern API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
luoyuxia
left a comment
There was a problem hiding this comment.
@fresh-borzoni Thanks for the pr. Only one minor comment. PTAL
|
@luoyuxia Ty for the review. Addressed, PTAL 🙏 |
luoyuxia
left a comment
There was a problem hiding this comment.
@fresh-borzoni Thanks. LGTM.. Merge it. @zhaohaidao Please note the api changes for creating log scanner and feel free to left comment.
Summary
closes #248
C++ Builder Pattern for Log Scanners
Replaced four separate scanner methods on
Tablewith a fluentTableScanbuilder.Before
After