Yibo-Dong opened a new issue, #19306:
URL: https://github.com/apache/iceberg/issues/19306
### Apache Iceberg version
main (development)
### Query engine
Spark
### Please describe the bug 🐞
With the default catalog settings (`cache-enabled=true`), the `partitions`
metadata table keeps the partition type from its first query. After `ADD
PARTITION FIELD`, it does not show the new field, so different partitions
appear as duplicate rows and `WHERE partition.b = ...` fails with
`FIELD_NOT_FOUND`. `position_deletes` fails the same way with a
`NullPointerException` in `PartitionSpec.rawPartitionType`. `REFRESH TABLE`
fixes it. Reproduced on `main` (3bfa3e4, 2026-12-01) and 1.12.0, Spark 3.5.5.
This does not occur with the setting off, so I believe it's different from
#19270
### Reproduction
```sql
CREATE TABLE local.db.t (id INT, p INT) USING iceberg PARTITIONED BY (p);
INSERT INTO local.db.t VALUES (1, 1);
SELECT partition FROM local.db.t.partitions;
ALTER TABLE local.db.t ADD PARTITION FIELD bucket(4, id) AS b;
INSERT INTO local.db.t VALUES (2, 1);
SELECT partition FROM local.db.t.partitions ORDER BY 1;
REFRESH TABLE local.db.t;
SELECT partition FROM local.db.t.partitions ORDER BY 1;
```
### Expected
| Query | Result |
|---|---|
| `partitions` after `ADD PARTITION FIELD` | `{"p":1,"b":null}`,
`{"p":1,"b":0}` |
### Actual
| Query | Result |
|---|---|
| `partitions` after `ADD PARTITION FIELD` | `{"p":1}`, `{"p":1}` |
| `partitions` after `REFRESH TABLE` | `{"p":1,"b":null}`, `{"p":1,"b":0}` |
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from
the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
--
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]