From 91161185ce53abbaaee992ebc1d412052e87852b Mon Sep 17 00:00:00 2001 From: Yufei Gu Date: Thu, 27 Jul 2023 17:26:28 -0700 Subject: [PATCH] Spark: Fix the ChangelogScan casting issue (#8167) --- .../java/org/apache/iceberg/spark/source/SparkScanBuilder.java | 2 +- .../java/org/apache/iceberg/spark/source/SparkScanBuilder.java | 2 +- .../java/org/apache/iceberg/spark/source/SparkScanBuilder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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