SQL file tests with a tolerance pass when only one side is NaN

オープン 初心者向け
#7,672 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
scala, spark
領域
testing

調査の方向性

まず CometTestBase.scala を読み、query tolerance=... を使う SQL ファイルテストで float と double の結果を比較する checkSparkAnswerWithTolerance を見つけてください。NaN の比較を更新し、両方の値が NaN の場合、または両方が許容誤差内の数値の場合にのみペアが一致するようにしてください。一方だけが NaN のケースと、両方が NaN で一致するケースを含む回帰テストで確認してください。

索引モデルが issue の本文から書いたものです。

説明

requires-triage
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時間
マージ済み PR(30日)
155

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion-comet のほかの issue

apache/datafusion-comet の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。