laskoviymishka commented on code in PR #875:
URL: https://github.com/apache/iceberg-go/pull/875#discussion_r3074078181


##########
table/internal/utils.go:
##########
@@ -236,7 +236,7 @@ func (d *DataFileStatistics) PartitionValue(field 
iceberg.PartitionField, sc *ic
        return lowerT.Val.Any()
 }
 
-func (d *DataFileStatistics) ToDataFile(schema *iceberg.Schema, spec 
iceberg.PartitionSpec, path string, format iceberg.FileFormat, content 
iceberg.ManifestEntryContent, filesize int64, partitionValues map[int]any) 
iceberg.DataFile {
+func (d *DataFileStatistics) ToDataFile(schema *iceberg.Schema, spec 
iceberg.PartitionSpec, path string, format iceberg.FileFormat, content 
iceberg.ManifestEntryContent, filesize int64, partitionValues map[int]any, 
sortOrderID int) iceberg.DataFile {

Review Comment:
   nit: this signature became very heavy, worth to refactor, can be follow up.



##########
table/arrow_utils.go:
##########
@@ -1617,6 +1617,7 @@ func positionDeleteRecordsToDataFiles(ctx 
context.Context, rootLocation string,
                                        FileCount:   fileCount,
                                        Schema:      
iceberg.PositionalDeleteSchema,
                                        Batches:     batch,
+                                       SortOrderID: meta.defaultSortOrderID,

Review Comment:
   same issue in the unpartitioned position-delete path. Missing SortOrderID: 
meta.defaultSortOrderID. 



##########
table/internal/interfaces.go:
##########
@@ -117,6 +117,10 @@ type WriteFileInfo struct {
        WriteProps       any
        Content          iceberg.ManifestEntryContent
        EqualityFieldIDs []int
+       // SortOrderID is the sort order id used when writing the data file.
+       // Used to populate the manifest entry's sort_order_id. Defaults to
+       // table.UnsortedSortOrderID (0) for unsorted writes.

Review Comment:
   this comment smell fishy to me, why only this field must have such 
descriptive comment?



##########
table/equality_delete_writer.go:
##########


Review Comment:
   unpartitioned write task missing sort-order definition.



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