Spec: Float sort order puts `-NaN` first but says it matches Java
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- documentation
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 9.4k
- Forks
- 3.7k
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 169
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/iceberg
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsPosiblemente ocupada @shivadarshan-devadiga la tomó hace 7 días. Abiertoimprovement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanPosiblemente ocupada @Ankitkj1999 la tomó hace 9 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Flink: JdbcLockFactory concurrent lock-table creation can fail with "table already exists" and restart the jobPosiblemente ocupada @adiranjan25 la tomó hace 16 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/iceberg#18797 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesPosiblemente ocupada @yusufyildiz34 la tomó hace 29 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/iceberg#18632 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListPosiblemente ocupada @mohamed-elbrik la tomó hace 34 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/iceberg
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
speakeasy-api/speakeasy#2159 ·
Los mantenedores suelen responder en 1 día
-
area: cli
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
vitruv-tools/NeoJoin#415 ·
Los mantenedores suelen responder en 1 día
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
account assessment course feature lecture
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
[Bug] 连接达梦时报错,agent 进程启动即退Abiertobug db/dameng user-priority/P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
t8y2/dbx#15534 · 1 comentario ·
Los mantenedores suelen responder en 1 día