wypoon commented on pull request #1508: URL: https://github.com/apache/iceberg/pull/1508#issuecomment-701043239
> > There is currently no obvious way to get from snapshot to table metadata > > Yes, we will need to have a way to get the right schema from table metadata by ID. I think what might make sense for now is to pass a `Function<Long, Schema>` in that does the lookup by snapshot ID. Then the `schemaForSnapshot` method could be package-private and passed into the `Snapshot` through its constructor. All of this would be package-private so we can change it later as we need to. It seems to me that it'd be simpler if in the future, `Snapshot` would have a `schemaId()` method rather than a `schema()` method; since the places that need to obtain a schema for a `Snapshot` already have a reference to `TableMetadata` at hand, and only need to call `Snapshot.schemaId()` and then use it to look up the schema in the `TableMetadata`. So the implementation of `getSchemaForSnapshot(long)` in `BaseTable` can stay the way it is now, and change later when `Snapshot.schemaId()` becomes available. What do you think? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
