You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2024/04/22 09:27:20 UTC
Re: [PR] [Core]Fix Flink batch reads the paimon partition table jobManager oom [paimon]
JingsongLi commented on PR #3245:
URL: https://github.com/apache/paimon/pull/3245#issuecomment-2068919116
You can try:
## SnapshotReaderImpl
```
@Override
public List<BinaryRow> partitions() {
List<ManifestEntry> entryList = scan.plan().files();
return entryList.stream()
.collect(
Collectors.groupingBy(
ManifestEntry::partition,
LinkedHashMap::new,
Collectors.reducing((a, b) -> b)))
.values()
.stream()
.map(Optional::get)
.map(ManifestEntry::partition)
return scan.readSimpleEntries().stream()
.map(SimpleFileEntry::partition)
.distinct()
.collect(Collectors.toList());
}
```
## FlinkCatalog
```
ReadBuilder readBuilder = table.newReadBuilder();
if (partitionSpec != null && partitionSpec.getPartitionSpec() != null) {
readBuilder.withPartitionFilter(partitionSpec.getPartitionSpec());
}
List<BinaryRow> partitions = readBuilder.newScan().listPartitions();
```
--
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-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org