kevinjqliu opened a new pull request, #667:
URL: https://github.com/apache/iceberg-python/pull/667

   Resolves #594 (and part of #511) 
   
   TODO:
   * Add doc in `api.md`
   
   This PR creates a metadata table for "Metadata Log Entries", similar to [its 
spark 
equivalent](https://iceberg.apache.org/docs/nightly/spark-queries/#metadata-log-entries)
 (`metadata_log_entries`). 
   
   To query the metadata table, use 
   ```
   tbl.inspect.metadata_log_entries()
   ```
   
   References
   * #524 (snapshots metadata table) 
   * #602 (references metadata table)
   * #551 (entries metadata table)
   
   Spark metadata log entries table is implemented in 
[`MetadataLogEntriesTable.java`](https://github.com/apache/iceberg/blob/1e35bf96ecacd5c5175116f40fa3e097991d04d2/core/src/main/java/org/apache/iceberg/MetadataLogEntriesTable.java#L61)
   
   The metadata log entries log is modified during `TableMetadata` creation, in 
which the current metadata log entry is appended 
([1](https://github.com/apache/iceberg/blob/1e35bf96ecacd5c5175116f40fa3e097991d04d2/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1454-L1457),
 
[2](https://github.com/apache/iceberg/blob/1e35bf96ecacd5c5175116f40fa3e097991d04d2/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1670-L1698),
 
[3](https://github.com/apache/iceberg/blob/1e35bf96ecacd5c5175116f40fa3e097991d04d2/core/src/main/java/org/apache/iceberg/TableMetadata.java#L956))
   
   Get `Snapshot` by timestamp (`_snapshot_as_of_timestamp_ms`) is modeled 
after [`snapshotIdAsOfTime` from 
Java](https://github.com/apache/iceberg/blob/1e35bf96ecacd5c5175116f40fa3e097991d04d2/core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java#L339-L359)
   
   There's an issue with reading V1 spec where the `sequence-number` is `None` 
instead of `0`. According to the Iceberg spec, when reading v1 metadata for v2, 
`Snapshot` field `sequence-number` must default to 0 
([source](https://iceberg.apache.org/spec/#version-2)).
    


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to