Skip to content

Commit

Permalink
Use table name as cache key explicitly
Browse files Browse the repository at this point in the history
Make it more obvious that the cache key for `snapshotIds` is correct.
  • Loading branch information
findepi committed Aug 3, 2021
1 parent 722c9fa commit dd113a3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,8 @@ public TableStatistics getTableStatistics(ConnectorSession session, ConnectorTab

private Optional<Long> getSnapshotId(org.apache.iceberg.Table table, Optional<Long> snapshotId)
{
return snapshotIds.computeIfAbsent(table.toString(), ignored -> snapshotId
// table.name() is an encoded version of SchemaTableName
return snapshotIds.computeIfAbsent(table.name(), ignored -> snapshotId
.map(id -> IcebergUtil.resolveSnapshotId(table, id))
.or(() -> Optional.ofNullable(table.currentSnapshot()).map(Snapshot::snapshotId)));
}
Expand Down

0 comments on commit dd113a3

Please sign in to comment.