Spec: Float sort order puts `-NaN` first but says it matches Java
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start with the floating-point sorting rule in format/spec.md and compare it with Java's Double.compareTo behavior described in the issue. Review the discussion and proposal in issue #2891 for prior concerns. Done means the spec clearly states that all NaN representations compare equal and sort after Infinity, while stored NaN bits remain unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Apache Iceberg version
main (development)
Query engine
None
Please describe the bug 🐞
The sorting rule orders floats as -NaN < -Infinity < -value < -0 < 0 < value < Infinity < NaN and says this "aligns with the implementation of Java floating-point types comparisons." Java's Double.compareTo treats every NaN as equal and greater than +Infinity, so Java has no -NaN at the low end. The listed order is IEEE 754 totalOrder.
Implementations follow different halves of the sentence. Iceberg Java compares floats with Comparator.naturalOrder(), which is Double.compareTo. iceberg-rust uses total_cmp, which puts negative NaNs first and orders NaNs by payload.
Following totalOrder also makes a computed NaN's position depend on hardware. IEEE 754 doesn't specify the sign of a NaN result. For 0.0 / 0.0, x86 SSE returns 0xfff8000000000000 and AArch64 returns 0x7ff8000000000000, so the same expression sorts first on one writer and last on another. This matters most where position must be exact, such as the ordering keys in the secondary index spec (#16961), which cites this rule.
#2891 proposed removing -NaN and grouping all NaNs after Infinity. @RussellSpitzer supported it, but it was closed without a decision. The concern there was that requiring writers to canonicalize NaN is extra work and discards legitimate NaN bit patterns. #2891 also let NaN representations sort in an arbitrary order, which would leave different NaN bit patterns as distinct keys.
Could the rule say that all NaN representations compare equal and sort after Infinity? This matches Java and the sentence that already claims it does. It constrains only comparison, so stored values keep their bits and writers don't canonicalize.
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Ngôn ngữ chính
- Java
- Star
- 9.4k
- Fork
- 3.7k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 169
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/iceberg
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsCó thể đã có người làm @shivadarshan-devadiga đã nhận 8 ngày trước. Đang mởimprovement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanCó thể đã có người làm @Ankitkj1999 đã nhận 10 ngày trước. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Flink: JdbcLockFactory concurrent lock-table creation can fail with "table already exists" and restart the jobCó thể đã có người làm @adiranjan25 đã nhận 17 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/iceberg#18797 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesCó thể đã có người làm @yusufyildiz34 đã nhận 29 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/iceberg#18632 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListCó thể đã có người làm @mohamed-elbrik đã nhận 34 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/iceberg
Issue tương tự
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Handle TSP error code 212Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
bug module: hybrid priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bancolombia/bin-stash#92 ·
-
Pub/Sub nackSplit drops other splits' empty checkpoint entries and lowers pendingCheckpointsĐang mởbug module:pubsub priority:P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
flink-gcp/flink-connector-gcp#2325 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eclipse-dirigible/dirigible#8877 ·
Maintainer thường phản hồi trong vòng 1 ngày