Revanth14 commented on code in PR #2164:
URL: https://github.com/apache/iceberg-go/pull/2164#discussion_r4235527028


##########
table/writer.go:
##########
@@ -239,6 +239,26 @@ type dataFileWriter interface {
        writeFile(ctx context.Context, partitionValues map[int]any, task 
WriteTask) (iceberg.DataFile, error)
 }
 
+// positionDeleteMetricsProps mirrors Java's MetricsConfig.forPositionDelete:
+// position delete files keep full file_path and pos bounds whatever the table
+// metrics settings are, so readers and conflict checks can resolve the data
+// file a delete file targets from equal file_path bounds.
+var positionDeleteMetricsProps = iceberg.Properties{
+       DefaultWriteMetricsModeKey:                 
string(tblutils.MetricModeNone),
+       MetricsModeColumnConfPrefix + ".file_path": 
string(tblutils.MetricModeFull),
+       MetricsModeColumnConfPrefix + ".pos":       
string(tblutils.MetricModeFull),
+}
+
+// metricsPropsFor returns the properties that drive column metrics for files
+// of the given content type.
+func metricsPropsFor(content iceberg.ManifestEntryContent, props 
iceberg.Properties) iceberg.Properties {
+       if content == iceberg.EntryContentPosDeletes {
+               return positionDeleteMetricsProps
+       }
+
+       return props

Review Comment:
   Added `TestMetricsPropsFor`, which covers data, equality deletes and 
position deletes.



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