diff --git a/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreWrite.java b/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreWrite.java index 79ee3e1f4706..43957de8d6c1 100644 --- a/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreWrite.java +++ b/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreWrite.java @@ -102,7 +102,7 @@ protected AbstractFileStoreWrite( boolean legacyPartitionName) { this.snapshotManager = snapshotManager; // Statistic is useless in writer - this.scan = scan.dropStats(); + this.scan = scan == null ? null : scan.dropStats(); this.indexFactory = indexFactory; this.dvMaintainerFactory = dvMaintainerFactory; this.totalBuckets = totalBuckets;