aokolnychyi commented on a change in pull request #3661:
URL: https://github.com/apache/iceberg/pull/3661#discussion_r764360674
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkBatchScan.java
##########
@@ -209,15 +210,19 @@ private int batchSize(boolean isParquetOnly, boolean
isOrcOnly) {
@Override
public Statistics estimateStatistics() {
+ return estimateStatistics(table.currentSnapshot());
+ }
+
+ protected Statistics estimateStatistics(Snapshot snapshot) {
// its a fresh table, no data
- if (table.currentSnapshot() == null) {
+ if (snapshot == null) {
return new Stats(0L, 0L);
}
// estimate stats using snapshot summary only for partitioned tables
(metadata tables are unpartitioned)
if (!table.spec().isUnpartitioned() && filterExpressions.isEmpty()) {
LOG.debug("using table metadata to estimate table statistics");
- long totalRecords =
PropertyUtil.propertyAsLong(table.currentSnapshot().summary(),
+ long totalRecords = PropertyUtil.propertyAsLong(snapshot.summary(),
Review comment:
Should have the missing part now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]