Skip to content

fix(spec): reject aggregation on a sequence field for every merge engine - #638

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/agg-on-sequence-field
Open

fix(spec): reject aggregation on a sequence field for every merge engine#638
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/agg-on-sequence-field

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Java SchemaValidation#validateSequenceField checks fieldAggFunc(field) == null
for every field in sequence.field, and that validator runs for every merge
engine. The Rust equivalent lived inside
AggregationConfig::validate_field_scoped_options, which is only reached when
merge-engine=aggregation — so on the default deduplicate engine a schema
combining sequence.field = 'ts' with fields.ts.aggregate-function = 'sum' was
silently accepted and persisted.

Fix: hoist the check into a free validate_no_aggregation_on_sequence_field
keyed only on the option map, and call it from Schema::new and
TableSchema::apply_changes alongside the other sequence-field validations, so it
no longer depends on the merge engine. The existing aggregation-engine test is
widened to cover all five engines, plus create/alter tests on the default engine.

Java `SchemaValidation#validateSequenceField` checks
`options.fieldAggFunc(field) == null` for every field listed in
`sequence.field`, and that validator runs regardless of the configured merge
engine. The Rust equivalent lived inside
`AggregationConfig::validate_field_scoped_options`, which is only reached when
`merge-engine=aggregation`, so on the default deduplicate engine a schema
combining `sequence.field = 'ts'` with `fields.ts.aggregate-function = 'sum'`
was silently accepted and persisted.

Hoist the check into a free `validate_no_aggregation_on_sequence_field` keyed
only on the option map, and call it from `Schema::new` and
`TableSchema::apply_changes` next to the other sequence-field validations, so
it no longer depends on the merge engine.
@jackylee-ch
jackylee-ch force-pushed the fix/agg-on-sequence-field branch from ce21f0b to 9a1683b Compare July 31, 2026 12:23
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