{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/14850","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/14850/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/14850/comments","events_url":"https://api.github.com/repos/apache/spark/issues/14850/events","html_url":"https://github.com/apache/spark/pull/14850","id":173585023,"number":14850,"title":"[SPARK-17279][SQL] better error message for exceptions during ScalaUDF execution","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars.githubusercontent.com/u/3182036?v=3","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-27T08:12:44Z","updated_at":"2016-09-02T06:36:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14850","html_url":"https://github.com/apache/spark/pull/14850","diff_url":"https://github.com/apache/spark/pull/14850.diff","patch_url":"https://github.com/apache/spark/pull/14850.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nIf `ScalaUDF` throws exceptions during executing user code, sometimes it's hard for users to figure out what's wrong, especially when they use Spark shell. An example\r\n```\r\norg.apache.spark.SparkException: Job aborted due to stage failure: Task 12 in stage 325.0 failed 4 times, most recent failure: Lost task 12.3 in stage 325.0 (TID 35622, 10.0.207.202): java.lang.NullPointerException\r\n\tat line8414e872fb8b42aba390efc153d1611a12.$read$$iwC$$iwC$$iwC$$iwC$$anonfun$2.apply(<console>:40)\r\n\tat line8414e872fb8b42aba390efc153d1611a12.$read$$iwC$$iwC$$iwC$$iwC$$anonfun$2.apply(<console>:40)\r\n\tat org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)\r\n...\r\n```\r\nWe should catch these exceptions and rethrow them with better error message, to say that the exception is happened in scala udf.\r\n\r\nThis PR also does some clean up for `ScalaUDF` and add a unit test suite for it.\r\n\r\n\r\n## How was this patch tested?\r\n\r\nthe new test suite"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/244295064","html_url":"https://github.com/apache/spark/pull/14850#issuecomment-244295064","issue_url":"https://api.github.com/repos/apache/spark/issues/14850","id":244295064,"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-02T06:36:33Z","updated_at":"2016-09-02T06:36:33Z","body":"**[Test build #64833 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64833/consoleFull)** for PR 14850 at commit [`4efb6fc`](https://github.com/apache/spark/commit/4efb6fc86b5fdcb7023aa9a2ee7063d4338b51da).\n * This patch **fails Spark unit tests**.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}