the-onewho-knocks opened a new issue, #1349:
URL: https://github.com/apache/iceberg-go/issues/1349
### Apache Iceberg version
main (development)
### Please describe the bug 🐞
# Equality-delete scan planning can panic when partition values are
non-comparable
## Summary
`table/scanner.go` performs direct `!=` comparisons on partition values
during equality-delete scan planning. While this works for comparable Go types,
it panics when partition values are non-comparable (for example, slices).
As a result, scan planning can crash instead of returning a normal error.
---
## Impact
- Equality-delete scan planning can panic unexpectedly.
- Any scan path that calls `partitionsMatch` is affected.
- Causes a runtime panic (`comparing uncomparable type`) instead of graceful
error handling.
- This is a correctness and stability issue.
---
## Affected Location
```
table/scanner.go
Lines: 547-558
```
---
## Root Cause
The implementation compares partition values using Go's `!=` operator.
Example:
```go
if left != right {
...
}
```
However, Go only allows `==` and `!=` on **comparable** types.
Examples of non-comparable types include:
- `[]T` (slices)
- `map[K]V`
- functions
Attempting to compare these values results in a runtime panic:
```
panic: runtime error: comparing uncomparable type []string
```
---
## Expected Behavior
Partition matching should safely handle every supported partition value type.
For non-comparable values, the scanner should:
- use an appropriate typed comparison, or
- detect unsupported/non-comparable values and return a normal error.
Scan planning should never panic because of partition value comparison.
---
## Actual Behavior
When a partition value contains a non-comparable Go type, equality-delete
planning crashes with a runtime panic similar to:
```
panic: runtime error: comparing uncomparable type
```
instead of returning an error.
---
--
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]