-
Notifications
You must be signed in to change notification settings - Fork 23
[TASK-179] Add more info for RecordBatches #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK-179] Add more info for RecordBatches #211
Conversation
4f3dc10 to
2e3b018
Compare
|
@luoyuxia PTAL 🙏 |
2e3b018 to
85c7b97
Compare
85c7b97 to
6ed18c4
Compare
There was a problem hiding this 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 adds batch-level metadata support to the log scanning API by introducing a ScanBatch struct that wraps Arrow RecordBatch with bucket and offset information. This enables downstream consumers (like the DuckDB plugin mentioned in issue #179) to track per-bucket progress and determine stopping conditions when using the batch API.
Changes:
- Added
ScanBatchstruct to wrapRecordBatchwith bucket and base offset metadata - Updated
RecordBatchLogScanner::poll()to returnVec<ScanBatch>instead ofVec<RecordBatch> - Modified
CompletedFetch::fetch_batches()to return offset information alongside batches
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/fluss/src/record/mod.rs | Introduces ScanBatch struct with bucket, batch, and base_offset fields, plus helper methods like last_offset() and comprehensive unit tests |
| crates/fluss/src/client/table/scanner.rs | Updates poll_batches() and related methods to return Vec<ScanBatch>, constructing batches with bucket metadata in fetch_batches_from_fetch() |
| crates/fluss/src/client/table/log_fetch_buffer.rs | Modifies CompletedFetch::fetch_batches() trait method and next_fetched_batch() to return tuples of (RecordBatch, base_offset) with correct offset tracking for sliced batches |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fresh-borzoni Thanks for the pr. LGTM! But ci fails
bf1155b to
7951287
Compare
|
@luoyuxia Thanks for the review. Fixed CI/CD |
close #179
Purpose
Add ScanBatch struct - batch-level equivalent of ScanRecord that wraps Arrow RecordBatch with bucket and offset metadata.
This enables downstream consumers to track per-bucket progress and determine stopping conditions when using the batch API.
API and Format
No breaking changes. poll_batches() return type changes from Vec to Vec (internal API).