badalprasadsingh commented on code in PR #524:
URL: https://github.com/apache/iceberg-go/pull/524#discussion_r2324024131
##########
table/internal/utils.go:
##########
@@ -234,20 +235,53 @@ 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, filesize int64)
iceberg.DataFile {
+func (d *DataFileStatistics) ToDataFile(schema *iceberg.Schema, spec
iceberg.PartitionSpec, path string, format iceberg.FileFormat, filesize int64,
partitionValues map[int]any) iceberg.DataFile {
var fieldIDToPartitionData map[int]any
+ fieldIDToLogicalType := make(map[int]avro.LogicalType)
+ fieldIDToFixedSize := make(map[int]int)
Review Comment:
The `fieldIDToLogicalType` stores the mapping between Iceberg field IDs and
their corresponding Avro logical types. It is required for proper `Partition
Field Type Mapping` and `Avro Serialization`
`fieldIDToFixedSize` stores the byte size for fixed-length types. For
decimal types it stores the calculated byte size based on decimal precision and
for `fixed types` it stores the fixed length from the schema.
Creating a separate map for them eases the use-case.
--
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]