Skip to content

Reject invalid bucket and truncate transform parameters #2473

@fallintoplace

Description

@fallintoplace

Problem

Transform::from_str currently accepts invalid parameterized transform strings. For example, bucket[0] and truncate[0] deserialize successfully even though applying those transforms can later panic due to modulo or division by zero. The parser also accepts malformed strings such as bucket10 and truncate10 because it strips the transform prefix and trims brackets loosely.

Expected behavior

Parameterized transform parsing should require exact Iceberg syntax and validate the parameter value:

  • accept bucket[N] and truncate[W] when the value is greater than zero
  • reject zero values such as bucket[0] and truncate[0]
  • reject malformed syntax such as bucket10, truncate10, or trailing characters after the closing bracket

Impact

Invalid table metadata or user-provided transform strings can be accepted and fail later during transform evaluation. Rejecting them during parsing gives callers a normal validation error instead of allowing a later runtime panic.

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