sfc-gh-rspitzer commented on code in PR #10659:
URL: https://github.com/apache/iceberg/pull/10659#discussion_r1697089697
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkScan.java:
##########
@@ -175,7 +185,45 @@ public Statistics estimateStatistics() {
protected Statistics estimateStatistics(Snapshot snapshot) {
// its a fresh table, no data
if (snapshot == null) {
- return new Stats(0L, 0L);
+ return new Stats(0L, 0L, Collections.emptyMap());
+ }
+
+ boolean cboEnabled =
+ Boolean.parseBoolean(spark.conf().get(SQLConf.CBO_ENABLED().key(),
"false"));
+ Map<NamedReference, ColumnStatistics> colStatsMap = null;
Review Comment:
Thinking back to this change, may be cleaner to just set this to empty map
and the reassign to Maps.newHashMap on 195 as is.
colStatsMap = Collections.emptyMap
if (report & cbo) {
colStatsMap = Maps.newHashMap
}
--
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]