dedyoc commented on issue #4294:
URL:
https://github.com/apache/iceberg-python/issues/4294#issuecomment-6702950868
Hello,
I'd like to work on this and wanted to check the approach first.
So before revisiting the cache approach from #3302, I'd open a smaller PR
with the alternative @geruh suggested in there:
```python
@property
def table_metadata(self) -> TableMetadata:
if not self._updates:
return self._table.metadata
return update_table_metadata(self._table.metadata, self._updates)
```
This change is simple but effective enough. In a plain append, the
table_metadata reads happen before anything is staged, so they no longer deep
copy. I tested the issue's repro.py on main, append at 800 snapshots goes down
from 541ms to 82ms.
This doesn't cover transactions that already have updates staged. If you'd
like that handled too, I can bring the caching from #3302/#3784 into this PR.
--
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]