badalprasadsingh commented on PR #524:
URL: https://github.com/apache/iceberg-go/pull/524#issuecomment-3316312230

   For certain types like `decimal` and `uuid`, their primitive Avro types are 
`fixed`, which is absolutely correct according to the [official Iceberg 
documentation](https://iceberg.apache.org/spec/#avro). However, according to 
`hamba/avro`, their preferred primitive Avro types should be `bytes` and 
`string`, respectively. Therefore, to work with the fixed schema of both types, 
the use of `maps` becomes a necessity in a union schema.
   
   Specifically, for `decimal` and `uuid` in the 
`convertAvroValueToIcebergType` function, we get the decoded values as a 
`map[string]interface{}` for the same reason. For `decimal`, the decoded value 
is returned as a `big.Rat`. To convert a `big.Rat` into a `DecimalLiteral`, we 
need to know its scale, which is why we store the decimal scale in the 
`fieldIDToFixedSize` map before encoding.
   


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to