Skip to content

[client][server] Support adding aggregation columns#3459

Open
wzx140 wants to merge 2 commits into
apache:mainfrom
wzx140:codex/aggregation-add-column-agg-function
Open

[client][server] Support adding aggregation columns#3459
wzx140 wants to merge 2 commits into
apache:mainfrom
wzx140:codex/aggregation-add-column-agg-function

Conversation

@wzx140

@wzx140 wzx140 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Support Java API TableChange.addColumn interfaces to pass aggregation functions when altering table schema.
  • Carry the aggregation function through ALTER TABLE ADD COLUMN RPC so the server preserves it in the new schema.
  • Validate aggregation functions on schema alter for aggregation merge engine tables and reject them on non-aggregation tables.

Support carrying aggregation functions through alter table add column requests.

Validate aggregation functions during schema alter and reject them on non-aggregation tables.
@luoyuxia luoyuxia requested a review from Copilot June 12, 2026 04:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.addColumn to optionally carry an AggFunction.
  • 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.

@wzx140 wzx140 force-pushed the codex/aggregation-add-column-agg-function branch 2 times, most recently from 9d58da3 to b9e72bc Compare June 12, 2026 06:18
@wzx140

wzx140 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@luoyuxia Could you please help review this one?

@wzx140 wzx140 closed this Jun 12, 2026
@wzx140 wzx140 reopened this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants