[server] Support projection pushdown with field id in server side.#2396
Open
loserwang1024 wants to merge 1 commit intoapache:mainfrom
Open
[server] Support projection pushdown with field id in server side.#2396loserwang1024 wants to merge 1 commit intoapache:mainfrom
loserwang1024 wants to merge 1 commit intoapache:mainfrom
Conversation
5d82871 to
157d968
Compare
Contributor
There was a problem hiding this comment.
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
Contributor
Author
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.
Purpose
Linked issue: close #2311
Brief change log
Tests
org.apache.fluss.server.tablet.TabletServiceITCase#testFetchLogWithNestedRowProjectionPushdown
API and Format
Documentation