SQL file tests with a tolerance pass when only one side is NaN
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
先阅读 CometTestBase.scala,并找到 checkSparkAnswerWithTolerance。它会比较使用 query tolerance=... 的 SQL 文件测试中的 float 和 double 结果。更新 NaN 比较逻辑,使一对值仅在两者都是 NaN,或两者都是容差范围内的数字时才匹配。通过一个覆盖单侧 NaN 的回归用例和一个两侧均为 NaN 的匹配用例进行验证。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
checkSparkAnswerWithTolerance in CometTestBase.scala skips the comparison of a float or double pair whenever either side is NaN. It only compares values when !actual.isNaN && !expected.isNaN, so a NaN from Comet against a number from Spark, or the other way round, passes. A SQL file test with query tolerance=... uses this check, so it cannot catch a kernel that returns NaN where Spark does not.
Steps to reproduce
A query tolerance=1e-6 over ln(x) where Comet returns NaN on some rows and Spark returns a value passes. The plain query form of the same test fails with "Results do not match".
Expected behavior
The pair should match only when both sides are NaN, or both are numbers within the tolerance: if (actual.isNaN || expected.isNaN) assert(actual.isNaN && expected.isNaN).
Additional context
Found while reproducing the wrong ln results in #7671.
- 主要语言
- Scala
- 星标
- 1.3k
- 派生
- 418
- 平均合并
- 3 天 18 小时
- 30 天内合并 PR
- 155
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-comet 的其他 Issue
-
area:expressions bug priority:high
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion-comet#7583 ·
维护者通常 2 天内回复
-
bug priority:medium
难度 2/5 1-3 小时 新手友好度 73/100
apache/datafusion-comet#7559 · 2 条评论 ·
维护者通常 2 天内回复
-
area:writer bug priority:low
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#7558 ·
维护者通常 2 天内回复
-
Comet Native Executors: run a query in Spark when Comet is turned off可能已有人在做 @andygrove 于 11 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#7557 ·
维护者通常 2 天内回复
-
area:writer enhancement requires-triage
难度 2/5 1-3 小时 新手友好度 62/100
apache/datafusion-comet#7463 ·
维护者通常 2 天内回复
查看 apache/datafusion-comet 的全部 Issue
相似的 Issue
-
area:scripts priority:P2 status:backlog
难度 2/5 1-3 小时 新手友好度 78/100
KD5UJC-XYZ/scarab#1170 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 91/100
rchillyard/TableParser#132 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
zio/zio-telemetry#1288 ·
维护者通常 1 天内回复
-
? - Needs Triage audit audit_4.3.0 audit_5.0.0
难度 2/5 1-3 小时 新手友好度 80/100
NVIDIA/cudf-spark#16965 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
valkey-io/valkey-glide#7745 ·
维护者通常 1 天内回复