JTaky opened a new pull request, #7688:
URL: https://github.com/apache/paimon/pull/7688
## Motivation
When committing Iceberg metadata via the REST catalog, `commitMetadataImpl`
takes the `!withBase` code path if the base metadata check fails. In this path,
a log statement calls `currentSnapshot().snapshotId()` on both the existing and
new table metadata. However, `currentSnapshot()` returns null when a table
exists but has no snapshots (e.g., a freshly created or empty table), causing a
`NullPointerException` that fails the entire commit.
```
Caused by: java.lang.NullPointerException
at
org.apache.paimon.iceberg.IcebergRestMetadataCommitter.commitMetadataImpl(IcebergRestMetadataCommitter.java:161)
```
## Implementation
Added null guards for `metadata.currentSnapshot()` and
`newMetadata.currentSnapshot()` in the log statement, logging `"No snapshot"`
when the snapshot is absent.
--
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]