alec-heif commented on issue #6210:
URL: https://github.com/apache/iceberg/issues/6210#issuecomment-1319134076

   somewhat disturbingly, the [unit test 
](https://github.com/apache/iceberg/blob/master/python/tests/avro/test_decoder.py#L166)coverage
 for this function also verifies the (incorrect) behavior:
   
   ```    
   mis = MemoryInputStream(b"\xBC\x7D")
   decoder = BinaryDecoder(mis)
   assert decoder.read_date_from_int() == date(1991, 12, 27)
   ```
   
   I believe that `0xBC7D0000` should not be 1991-12-27
   
   1. lsb `0xbc == 188`
   2. 2nd lsb `0x7d == 125`
   3. `(125 * 256) + 188 == 32188` which is 32188 days, or `2058-02-16` 
   


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