Skip to main content

Module partition_compat

Module partition_compat 

Source
Expand description

Rejects an ALTER TABLE whose column type changes would break the persisted partition expressions of a region, before any region is altered.

Bounds keep the type they were written with. Row routing compares them with row values as Values, which only stays valid across a timestamp unit widening; scans coerce the bound to the common comparison type, which can overflow (a millisecond bound in year 3000 cast to nanoseconds).

partition depends on this crate, so the Persisted* types mirror the JSON of partition::partition::PartitionBound and partition::expr::PartitionExpr. A test in partition runs real serialized expressions through this validator.

StructsΒ§

PersistedPartitionExpr πŸ”’

EnumsΒ§

PersistedOp πŸ”’
PersistedOperand πŸ”’
PersistedPartitionBound πŸ”’

FunctionsΒ§

changed_column_types πŸ”’
Returns the columns present in both schemas whose type differs, as (old, new).
incompatible πŸ”’
validate_comparison πŸ”’
validate_expr πŸ”’
validate_operand πŸ”’
validate_region_partition_bounds
Returns an error naming the first region whose partition expression can’t take the type changes in changed_columns.
value_to_scalar_value πŸ”’
Converts a bound the same way as partition::expr::Operand::try_as_logical_expr. Returns None for values that can’t be partition bounds.