@@ -1106,26 +1106,27 @@ var valueBlockSizeAnnotator = manifest.SumAnnotator(func(f *manifest.TableMetada
1106
1106
return 0 , false
1107
1107
})
1108
1108
1109
- // pointDeletionsBytesEstimateAnnotator is a manifest.TableAnnotator that annotates
1110
- // B-Tree nodes with the sum of the files' PointDeletionsBytesEstimate. This
1111
- // value may change once a table's stats are loaded asynchronously, so its
1112
- // values are marked as cacheable only if a file's stats have been loaded.
1113
- var pointDeletionsBytesEstimateAnnotator = manifest .SumAnnotator (func (f * manifest.TableMetadata ) (uint64 , bool ) {
1114
- if stats , ok := f .Stats (); ok {
1115
- return stats .PointDeletionsBytesEstimate , true
1116
- }
1117
- return 0 , false
1118
- })
1109
+ type deletionBytes struct {
1110
+ // PointDels contains a sum of TableStats.PointDeletionsBytesEstimate.
1111
+ PointDels uint64
1112
+ // RangeDels contains a sum of TableStats.RangeDeletionsBytesEstimate.
1113
+ RangeDels uint64
1114
+ }
1119
1115
1120
- // rangeDeletionsBytesEstimateAnnotator is a manifest.TableAnnotator that annotates
1121
- // B-Tree nodes with the sum of the files' RangeDeletionsBytesEstimate. This
1122
- // value may change once a table's stats are loaded asynchronously, so its
1123
- // values are marked as cacheable only if a file's stats have been loaded.
1124
- var rangeDeletionsBytesEstimateAnnotator = manifest .SumAnnotator (func (f * manifest.TableMetadata ) (uint64 , bool ) {
1125
- if stats , ok := f .Stats (); ok {
1126
- return stats .RangeDeletionsBytesEstimate , true
1127
- }
1128
- return 0 , false
1116
+ var deletionBytesAnnotator = manifest.NewTableAnnotator [deletionBytes ](manifest.SumAggregator [deletionBytes ]{
1117
+ AddFunc : func (src , dst * deletionBytes ) {
1118
+ dst .PointDels += src .PointDels
1119
+ dst .RangeDels += src .RangeDels
1120
+ },
1121
+ AccumulateFunc : func (f * manifest.TableMetadata ) (v deletionBytes , cacheOK bool ) {
1122
+ if stats , ok := f .Stats (); ok {
1123
+ return deletionBytes {
1124
+ PointDels : stats .PointDeletionsBytesEstimate ,
1125
+ RangeDels : stats .RangeDeletionsBytesEstimate ,
1126
+ }, true
1127
+ }
1128
+ return deletionBytes {}, false
1129
+ },
1129
1130
})
1130
1131
1131
1132
// compressionStatsAnnotator is a manifest.TableAnnotator that annotates B-tree nodes
0 commit comments