Skip to content

Commit

Permalink
[core] Drop stats for deleted data files to reduce memory
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Dec 4, 2024
1 parent 11cebd4 commit 9d2a63a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ public FilesIterator(
if (filter != null) {
snapshotReader.withFilter(filter);
}
// drop stats to reduce memory
snapshotReader.dropStats();
this.streamingMode = isStreaming;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ protected AbstractFileStoreWrite(
int writerNumberMax,
boolean legacyPartitionName) {
this.snapshotManager = snapshotManager;
this.scan = scan;
// Statistic is useless in writer
this.scan = scan.dropStats();
this.indexFactory = indexFactory;
this.dvMaintainerFactory = dvMaintainerFactory;
this.totalBuckets = totalBuckets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ trait PaimonCommand extends WithFileStoreTable with ExpressionHelper with SQLCon
condition: Expression,
output: Seq[Attribute]): Seq[DataSplit] = {
// low level snapshot reader, it can not be affected by 'scan.mode'
val snapshotReader = table.newSnapshotReader()
// dropStats after filter push down
val snapshotReader = table.newSnapshotReader().dropStats()
if (condition != TrueLiteral) {
val filter =
convertConditionToPaimonPredicate(condition, output, rowType, ignoreFailure = true)
Expand Down

0 comments on commit 9d2a63a

Please sign in to comment.