-
Notifications
You must be signed in to change notification settings - Fork 486
[server] Support projection pushdown with field id in server side. #2396
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
base: main
Are you sure you want to change the base?
[server] Support projection pushdown with field id in server side. #2396
Conversation
5d82871 to
157d968
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 support for projection pushdown with field IDs in the server, enabling more flexible column selection that works better with schema evolution. Instead of only supporting projection by field position, the server can now project fields by their IDs, which remain stable across schema changes.
Changes:
- Added
project_by_idsoptional boolean field to protobuf messagePbFetchLogReqForTableto indicate whether projection uses field IDs or positions - Updated
FileLogProjectionto support both field ID and field position based projection with new flattening logic for nested rows - Extended
FetchReqInfo,FetchParams, and related classes to propagate theisProjectByIdsflag through the fetch pipeline
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fluss-rpc/src/main/proto/FlussApi.proto | Added optional project_by_ids field to fetch log request |
| fluss-common/src/main/java/org/apache/fluss/record/FileLogProjection.java | Implemented field ID-based projection logic with new methods for flattening and projecting by IDs |
| fluss-common/src/main/java/org/apache/fluss/record/ProjectionPushdownCache.java | Updated cache key to include isSelectedByIds flag |
| fluss-server/src/main/java/org/apache/fluss/server/entity/FetchReqInfo.java | Added isProjectByIds field and made maxBytes final |
| fluss-server/src/main/java/org/apache/fluss/server/log/FetchParams.java | Added isSelectedByIds parameter to setCurrentFetch method |
| fluss-server/src/main/java/org/apache/fluss/server/utils/ServerRpcMessageUtils.java | Parsed project_by_ids from protobuf message and passed to FetchReqInfo |
| fluss-server/src/main/java/org/apache/fluss/server/replica/ReplicaManager.java | Removed unused field declaration (but this is a bug - field is still used) |
| fluss-server/src/main/java/org/apache/fluss/server/coordinator/SchemaUpdate.java | Removed unnecessary cast from highestFieldId parameter |
| fluss-common/src/test/java/org/apache/fluss/testutils/DataTestUtils.java | Added recursive assertion support for nested row types |
| fluss-common/src/test/java/org/apache/fluss/record/FileLogProjectionTest.java | Added comprehensive tests for projection by field IDs including nested rows |
| fluss-server/src/test/java/org/apache/fluss/server/tablet/TabletServiceITCase.java | Added integration tests for nested row projection with both projection modes |
| fluss-server/src/test/java/org/apache/fluss/server/testutils/RpcMessageTestUtils.java | Updated test utility methods to support isProjectByIds parameter |
| Multiple test files | Updated all test calls to include the new isProjectByIds parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fluss-server/src/main/java/org/apache/fluss/server/replica/ReplicaManager.java
Show resolved
Hide resolved
fluss-server/src/main/java/org/apache/fluss/server/utils/ServerRpcMessageUtils.java
Show resolved
Hide resolved
157d968 to
db6d093
Compare
Purpose
Linked issue: close #2311
Brief change log
Tests
org.apache.fluss.server.tablet.TabletServiceITCase#testFetchLogWithNestedRowProjectionPushdown
API and Format
Documentation