ajiteshsingh commented on code in PR #2009:
URL: https://github.com/apache/iceberg-go/pull/2009#discussion_r4020772821


##########
table/evaluators.go:
##########
@@ -843,8 +863,19 @@ func (m *inclusiveMetricsEval) TestRowGroup(rgmeta 
*metadata.RowGroupMetaData, c
                                m.lowerBounds = make(map[int][]byte, 
len(colIndices))
                                m.upperBounds = make(map[int][]byte, 
len(colIndices))
                        }
-                       m.lowerBounds[fieldID] = stats.EncodeMin()
-                       m.upperBounds[fieldID] = stats.EncodeMax()
+
+                       lower, upper := stats.EncodeMin(), stats.EncodeMax()
+                       if intBackedDecimal(stats.Descr()) {
+                               // EncodeMin/EncodeMax hand back a freshly 
allocated buffer, so
+                               // reversing in place cannot disturb the row 
group metadata.
+                               // Iceberg does not require the minimum number 
of bytes, so the

Review Comment:
   Good catch, that was backwards. Reworded to:
   ```go
   // The spec wants minimum-width bounds, but these stay in memory and the
   // decoder accepts any width, so the 4- or 8-byte form needs no trimming.
   ```



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