RussellSpitzer commented on code in PR #10659:
URL: https://github.com/apache/iceberg/pull/10659#discussion_r1693301909


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkScan.java:
##########
@@ -189,9 +192,8 @@ protected Statistics estimateStatistics(Snapshot snapshot) {
 
     boolean cboEnabled =
         Boolean.parseBoolean(spark.conf().get(SQLConf.CBO_ENABLED().key(), 
"false"));
-    Map<NamedReference, ColumnStatistics> colStatsMap = null;
+    Map<NamedReference, ColumnStatistics> colStatsMap = Maps.newHashMap();

Review Comment:
   What I meant here was to have it be Collection EmptyMap unless cbo is 
enabled, probably a premature optimization. So feel free to ignore
   
   Ie:
   ```java
   Map colStatsMap;
     if (readConf && cbo)
        colStatsMap = Maps.newHashMap()
     else 
       colStatsMap = Collections.emptyMap()
   ```



-- 
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]

Reply via email to