{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15059","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15059/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15059/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15059/events","html_url":"https://github.com/apache/spark/pull/15059","id":176409301,"number":15059,"title":"[SPARK-17506][SQL] Improve the check double values equality rule.","user":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-12T15:40:38Z","updated_at":"2016-09-12T20:29:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15059","html_url":"https://github.com/apache/spark/pull/15059","diff_url":"https://github.com/apache/spark/pull/15059.diff","patch_url":"https://github.com/apache/spark/pull/15059.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nIn `ExpressionEvalHelper`, we check the equality between two double values by comparing whether the expected value is within the range [target - tolerance, target + tolerance], but this can cause a negative false when the compared numerics are very large. \r\nBefore：\r\n```\r\nval1 = 1.6358558070241E306\r\nval2 = 1.6358558070240974E306\r\nExpressionEvalHelper.compareResults(val1, val2)\r\nfalse\r\n```\r\nIn fact, `val1` and `val2` are but with different precisions, we should tolerant this case by comparing with percentage range, eg.,expected is within range [target - target * tolerance_percentage, target + target * tolerance_percentage].\r\nAfter:\r\n```\r\nval1 = 1.6358558070241E306\r\nval2 = 1.6358558070240974E306\r\nExpressionEvalHelper.compareResults(val1, val2)\r\ntrue\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nExsiting testcases."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/246481289","html_url":"https://github.com/apache/spark/pull/15059#issuecomment-246481289","issue_url":"https://api.github.com/repos/apache/spark/issues/15059","id":246481289,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T20:29:30Z","updated_at":"2016-09-12T20:29:30Z","body":"**[Test build #65265 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/65265/consoleFull)** for PR 15059 at commit [`78f3733`](https://github.com/apache/spark/commit/78f37334164a015605d5c23ff7217a131c3ea3a7).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}