Skip to content

fix: reject aggregation on sequence fields#409

Open
QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:agg-seq-field
Open

fix: reject aggregation on sequence fields#409
QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:agg-seq-field

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

Linked issue: #257

Rust aggregation schema validation allowed fields.<sequence-field>.aggregate-function, but the runtime ignores that option because sequence fields are forced to last_value. Java rejects this metadata during schema validation, so Rust could create table options that are not accepted by Java validation.

Brief change log

  • Reject per-field aggregate functions on sequence.field columns during aggregation schema validation.
  • Keep runtime sequence-field merging unchanged: sequence fields still use last_value for existing or external metadata.
  • Add unit and DataFusion SQL coverage for create/alter validation and ignored primary-key functions.
  • Document the sequence-field aggregation restriction.

Tests

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --workspace --features fulltext,vortex,mosaic -- -D warnings
  • cargo test -p paimon --lib aggregation
  • cargo test -p paimon --lib schema
  • cargo test -p paimon-datafusion --test pk_tables aggregation

API and Format

No storage format change. This tightens validation for invalid aggregation table options.

Documentation

Updated SQL docs for sequence-field aggregation behavior.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
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.

1 participant