Repository navigation
fix(table): handle missing or nil stats + metadata field nil comparison - #460
Conversation
laskoviymishka
left a comment
There was a problem hiding this comment.
Thanks! Looks good.
From what I understand, these are just hypothetical panics, but maybe it's possible to add a test here?
zeroshade
left a comment
There was a problem hiding this comment.
Looks great, just a few quirks
| if stats == nil { | ||
| continue | ||
| } |
There was a problem hiding this comment.
does the Statistics() method ever return nil if err is not nil?
There was a problem hiding this comment.
Yes -- I think that this could occur with files from legacy parquet libraries.
|
|
||
| stats, err := colChunk.Statistics() | ||
| if err != nil { | ||
| if err != nil || stats == nil { |
| ((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) && |
There was a problem hiding this 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).
There was a problem hiding this comment.
should we leave this as it was instead since there's no possibility of the nil dereference?
There was a problem hiding this comment.
👍 removed the change here
|
Thanks for this! |
Handles a few potential nil dereferences