Hi JB,

I've opened a small PR in the Iceberg repository [1] to clarify a point
from our earlier discussion.

Additionally, the initial PR in the Iceberg Verification repository [2] is
nearly ready to be finalized.

If you have a chance, I'd really appreciate your review and approval, if
everything looks good. No pressure, of course.

I'm happy to address any feedback or provide further clarification if
needed.


[1] https://github.com/apache/iceberg/pull/18874
[2] https://github.com/apache/iceberg-verification/pull/17


Best regards,
Roman

>
> Hi everyone,
>
> While reviewing the partition transform fixtures in Pull request [1], @
> laskoviymishk <https://github.com/laskoviymishka>a and I noticed that
> Appendix B [2] requires converting nanosecond timestamps to microseconds
> before bucket hashing, but does not specify how to round negative values.
>
> For 1969-12-31T23:59:59.999999999 (−1 ns), floor division hashes −1 µs
> and gives bucket[100] = 12;
>
> truncation toward zero hashes 0 µs and gives 76.
>
> Iceberg Java [3], Go [4], and Rust [5] use floor division. Rust recently
> changed its implementation to match Java [6].
>
> Could Appendix B [2] be updated with next sentence?
>
> For bucket hashing, convert nanoseconds since the Unix epoch to
> microseconds by dividing by 1,000 and rounding toward negative infinity.
>
> That would give the pre-epoch conformance case an explicit spec basis.
>
> [1]
> https://github.com/apache/iceberg-verification/pull/17#discussion_r4472635274
> [2] https://iceberg.apache.org/spec/#appendix-b-32-bit-hash-requirements
> [3]
> https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/util/DateTimeUtil.…
> <https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/util/DateTimeUtil.java>
> [4] https://github.com/apache/iceberg-go/blob/main/transforms.go
> [5]
> https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/src/transform/bucket.rs
> [6] https://github.com/apache/iceberg-rust/pull/2891
>
> Thanks for attention,
> Roman
>

Reply via email to