[client][server] Support adding aggregation columns#3459
Open
wzx140 wants to merge 2 commits into
Open
Conversation
Support carrying aggregation functions through alter table add column requests. Validate aggregation functions during schema alter and reject them on non-aggregation tables.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds end-to-end support for specifying aggregation functions when adding columns via ALTER TABLE ADD COLUMN, including RPC transport and server-side validation for aggregation vs non-aggregation merge engine tables.
Changes:
- Extend
TableChange.addColumnto optionally carry anAggFunction. - Add RPC support to serialize/deserialize aggregation functions for
ADD COLUMN. - Enforce validation rules for aggregation functions on schema alter and table creation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fluss-server/src/main/java/org/apache/fluss/server/utils/TableDescriptorValidation.java | Adds validation to reject aggregation functions for non-aggregation merge engines; exposes validation helpers for reuse. |
| fluss-server/src/main/java/org/apache/fluss/server/utils/ServerRpcMessageUtils.java | Deserializes aggregation function from PbAddColumn to TableChange.AddColumn. |
| fluss-server/src/main/java/org/apache/fluss/server/coordinator/SchemaUpdate.java | Applies AggFunction when building the updated schema for added columns. |
| fluss-server/src/main/java/org/apache/fluss/server/coordinator/MetadataManager.java | Validates aggregation function usage during ALTER TABLE schema updates based on merge engine. |
| fluss-rpc/src/main/proto/FlussApi.proto | Adds serialized_agg_function field to PbAddColumn. |
| fluss-common/src/main/java/org/apache/fluss/metadata/TableChange.java | Adds new addColumn overload carrying AggFunction and stores it on AddColumn. |
| fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java | Adds integration tests for altering aggregation and non-aggregation tables with aggregation functions. |
| fluss-client/src/main/java/org/apache/fluss/client/utils/ClientRpcMessageUtils.java | Serializes aggregation function into PbAddColumn. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d58da3 to
b9e72bc
Compare
Contributor
Author
|
@luoyuxia Could you please help review this one? |
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.
Summary
TableChange.addColumninterfaces to pass aggregation functions when altering table schema.