diff --git a/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java b/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java index 5cd5b24547f9..c1144d944a66 100644 --- a/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java +++ b/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java @@ -420,7 +420,7 @@ public Scan buildCopyOnWriteScan() { @Override public Statistics estimateStatistics() { - return ((SparkScan) build()).estimateStatistics(); + return ((SupportsReportStatistics) build()).estimateStatistics(); } @Override diff --git a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java index bab48d376071..2653b9eab1f5 100644 --- a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java +++ b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java @@ -658,7 +658,7 @@ public Scan buildCopyOnWriteScan() { @Override public Statistics estimateStatistics() { - return ((SparkScan) build()).estimateStatistics(); + return ((SupportsReportStatistics) build()).estimateStatistics(); } @Override diff --git a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java index 17d0283c88a1..8cbb271382a8 100644 --- a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java +++ b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java @@ -700,7 +700,7 @@ public Scan buildCopyOnWriteScan() { @Override public Statistics estimateStatistics() { - return ((SparkScan) build()).estimateStatistics(); + return ((SupportsReportStatistics) build()).estimateStatistics(); } @Override