Skip to content

RenameColumn should rewrite field-scoped fields.<col>.* options #383

@TheR1sing3un

Description

@TheR1sing3un

Background

#370 implements column-level ALTER TABLE. Its RenameColumn path (TableSchema::apply_changes) rewrites column references in primary_keys, bucket-key, and sequence.field — case 1 of Java SchemaManager.applyRenameColumnsToOptions.

It does not yet rewrite field-scoped options whose key embeds the column name. Java handles two more cases:

  • case 2 — key = fields.<col>.<suffix>, value has no column name: aggregate-function, ignore-retract, distinct, list-agg-delimiter.
  • case 3 — key and value both contain column names: fields.<cols>.sequence-group, fields.<cols>.nested-key.

Impact

After a rename, such options still point at the old column name and are silently persisted. This is already latent for partial-update tables on main (spec/partial_update.rs supports fields.<col>.sequence-group / fields.<col>.aggregate-function): renaming a column carrying these leaves a stale key. It also composes with merge-engine=aggregation (#340), where a renamed aggregation value column would fall back to the default aggregator/delimiter at read time.

Proposed fix

Port case 2 and case 3 of Java applyRenameColumnsToOptions into the Rust RenameColumn handling, with tests covering rename of columns carrying fields.<col>.* options.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions