nastra commented on code in PR #118:
URL: https://github.com/apache/iceberg-go/pull/118#discussion_r1719867920


##########
manifest.go:
##########
@@ -583,6 +597,51 @@ func avroColMapToMap[K comparable, V any](c *[]colMap[K, 
V]) map[K]V {
        return out
 }
 
+func avroPartitionData(input map[string]any) map[string]any {
+       // hamba/avro2 will unmarshal a map[string]any such that
+       // each entry will actually be a map[string]interface{} with the key
+       // being the avro type.
+       //
+       // This means that partition data that looks like:
+       //
+       //  [{"field-id": 1000, "name": "ts", "type": {"type": "int", 
"logicalType": "date"}}]
+       //
+       // Becomes:
+       //
+       //  map[string]any{"ts": map[string]any{"int.date": time.Time{}}}
+       //
+       // so we need to simplify our map and make partition data handling 
easier
+       out := map[string]any{}
+       for k, v := range input {
+               switch v := v.(type) {
+               case map[string]any:
+                       for typname, val := range v {
+                               switch typname {
+                               case "int.date":

Review Comment:
   can you elaborate where this string representation is coming from?



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