apache / apache/iceberg-rust

Reject invalid bucket and truncate transform parameters

Open
#2,473 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.4k
Forks
567
Avg merge
2d 2h
Merged PRs (30d)
93

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

Start at Transform::from_str and inspect the existing parameterized-transform parsing and its tests. Verify that bucket[N] and truncate[W] accept only positive values and that malformed or trailing input is rejected. Done means invalid strings return a normal validation error instead of being accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.