From 6b8d72bdff61494b780e8601e8d9a05ea223387d Mon Sep 17 00:00:00 2001 From: YeJunHao <41894543+leaves12138@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:42:50 +0800 Subject: [PATCH] [core] Add limit to bundle interface (#4115) --- .../paimon/io/StatsCollectingSingleFileWriter.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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) {