diff --git a/paimon-core/src/main/java/org/apache/paimon/io/StatsCollectingSingleFileWriter.java b/paimon-core/src/main/java/org/apache/paimon/io/StatsCollectingSingleFileWriter.java index 705204dfd62e..2f4190a049dc 100644 --- a/paimon-core/src/main/java/org/apache/paimon/io/StatsCollectingSingleFileWriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/io/StatsCollectingSingleFileWriter.java @@ -73,6 +73,15 @@ public void write(T record) throws IOException { } } + @Override + public void writeBundle(BundleRecords bundle) throws IOException { + Preconditions.checkState( + simpleStatsExtractor != null, + "Can't write bundle without simpleStatsExtractor, we may lose all the statistical information"); + + super.writeBundle(bundle); + } + public SimpleColStats[] fieldStats() throws IOException { Preconditions.checkState(closed, "Cannot access metric unless the writer is closed."); if (simpleStatsExtractor != null) {