RussellSpitzer commented on code in PR #4560:
URL: https://github.com/apache/iceberg/pull/4560#discussion_r855527496
##########
core/src/main/java/org/apache/iceberg/PartitionsTable.java:
##########
@@ -93,16 +96,77 @@ private static StaticDataTask.Row
convertPartition(Partition partition) {
return StaticDataTask.Row.of(partition.key, partition.recordCount,
partition.fileCount, partition.specId);
}
- private static Iterable<Partition> partitions(StaticTableScan scan) {
+ private static Iterable<Partition> partitions(Table table, StaticTableScan
scan) {
CloseableIterable<FileScanTask> tasks = planFiles(scan);
+ Types.StructType normalizedPartitionType =
Partitioning.partitionType(table);
+ PartitionMap partitions = new PartitionMap();
+
+ LoadingCache<Integer, Integer[]> originalPartitionFieldPositionsBySpec =
Caffeine.newBuilder().build(specId ->
Review Comment:
I think the number of partition specs should be very small so I would
probably just use a
Maps.newHashMap()
Then .computeIfAbsent
Not that I think there is somethign wrong with Caffine, just seems a bit
heavy weight to me in this use case
##########
core/src/main/java/org/apache/iceberg/PartitionsTable.java:
##########
@@ -93,16 +96,77 @@ private static StaticDataTask.Row
convertPartition(Partition partition) {
return StaticDataTask.Row.of(partition.key, partition.recordCount,
partition.fileCount, partition.specId);
}
- private static Iterable<Partition> partitions(StaticTableScan scan) {
+ private static Iterable<Partition> partitions(Table table, StaticTableScan
scan) {
CloseableIterable<FileScanTask> tasks = planFiles(scan);
+ Types.StructType normalizedPartitionType =
Partitioning.partitionType(table);
+ PartitionMap partitions = new PartitionMap();
+
+ LoadingCache<Integer, Integer[]> originalPartitionFieldPositionsBySpec =
Caffeine.newBuilder().build(specId ->
Review Comment:
I think the number of partition specs should be very small so I would
probably just use a
Maps.newHashMap()
Then .computeIfAbsent
Not that I think there is something wrong with Caffeine, just seems a bit
heavy weight to me in this use case
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]