jackylee-ch opened a new pull request, #3162:
URL: https://github.com/apache/iceberg-rust/pull/3162
## Which issue does this PR close?
None — filed directly.
## What changes are included in this PR?
`ExpressionEvaluator::starts_with` matched only `(String, String)` and fell
through to
`Ok(false)`. In this visitor `false` means "this data file cannot match", so
a `StartsWith`
predicate on a non-string partition column silently pruned files that do
contain matching rows.
It is reachable: `Reference::new("a").starts_with(Datum::binary(b"ab"))`
binds without error, and
with an identity-partitioned `binary` column a file whose partition value is
`X'616263'` was
dropped from the scan.
Now it returns the same error the other four visitors already return for
this input —
`inclusive_metrics_evaluator.rs:308`, `row_group_metrics_evaluator.rs:347`,
`page_index_evaluator.rs:586`, `manifest_evaluator.rs:331`.
## Are these changes tested?
Yes — `test_expr_starts_with_non_string_errors` covers `StartsWith` and
`NotStartsWith` on a binary
partition; it returns `false` on the parent commit. `cargo test --release -p
iceberg --lib expr::`
→ 287 passed.
## AI Disclosure
Written with AI assistance (Claude Code); I reviewed the change and ran the
tests above.
Worth a reviewer's attention: this turns `NOT STARTS WITH` on a non-string
column from "no pruning"
into an error. Java rejects the predicate earlier, when binding, so
validating in
`BinaryExpression::bind` would be a reasonable follow-up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]