zeroshade commented on code in PR #460:
URL: https://github.com/apache/iceberg-go/pull/460#discussion_r2153191373


##########
table/evaluators.go:
##########
@@ -732,6 +732,10 @@ func (m *inclusiveMetricsEval) TestRowGroup(rgmeta 
*metadata.RowGroupMetaData, c
                        return false, err
                }
 
+               if stats == nil {
+                       continue
+               }

Review Comment:
   does the `Statistics()` method ever return nil if err is not nil?



##########
table/internal/parquet_files.go:
##########
@@ -452,7 +452,7 @@ func (p parquetFormat) DataFileStatsFromMeta(meta Metadata, 
statsCols map[int]St
                        }
 
                        stats, err := colChunk.Statistics()
-                       if err != nil {
+                       if err != nil || stats == nil {

Review Comment:
   same question as above



##########
table/metadata.go:
##########
@@ -877,8 +881,8 @@ func (c *commonMetadata) Equals(other *commonMetadata) bool 
{
        }
 
        return c.FormatVersion == other.FormatVersion && c.UUID == other.UUID &&
-               ((c.LastPartitionID == other.LastPartitionID) || 
(*c.LastPartitionID == *other.LastPartitionID)) &&
-               ((c.CurrentSnapshotID == other.CurrentSnapshotID) || 
(*c.CurrentSnapshotID == *other.CurrentSnapshotID)) &&
+               equalPtr(c.LastPartitionID, other.LastPartitionID) &&
+               equalPtr(c.CurrentSnapshotID, other.CurrentSnapshotID) &&

Review Comment:
   there's no nil dereference possibility here due to the cases handled above. 
Either both are nil (thus they will not get dereferenced) or both are non-nil 
(and we're safe).



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to