rdblue commented on a change in pull request #1815:
URL: https://github.com/apache/iceberg/pull/1815#discussion_r529806851
##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java
##########
@@ -619,7 +625,23 @@ public void alterPartitionColumnStatistics(ObjectPath
tablePath, CatalogPartitio
@Override
public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath)
throws CatalogException {
- throw new UnsupportedOperationException();
+ Table table = icebergCatalog.loadTable(toIdentifier(tablePath));
+ CloseableIterable<FileScanTask> tasks = table.newScan().planFiles();
Review comment:
This needs to be closed when this method is finished:
```java
Set<CatalogPartitionSpec> set = Sets.newHashSet();
try (CloseableIterable<FileScanTask> tasks = table.newScan().planFiles()) {
for (DataFile dataFile : CloseableIterable.transform(tasks,
FileScanTask::file)) {
...
}
}
```
In that code, I've also removed the intermediate list of `DataFile`. The
iterable returned by `planFiles()` is designed to avoid keeping everything in
memory at one time, so you should iterate over that or using a transformed
iterable. Loading all the files into memory will cause this to run out of
memory for large tables.
----------------------------------------------------------------
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]