{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12185","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12185/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12185/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12185/events","html_url":"https://github.com/apache/spark/pull/12185","id":146124549,"number":12185,"title":"[SPARK-14415][SQL] All functions should show usages by command `DESC FUNCTION`","user":{"login":"dongjoon-hyun","id":9700541,"avatar_url":"https://avatars.githubusercontent.com/u/9700541?v=3","gravatar_id":"","url":"https://api.github.com/users/dongjoon-hyun","html_url":"https://github.com/dongjoon-hyun","followers_url":"https://api.github.com/users/dongjoon-hyun/followers","following_url":"https://api.github.com/users/dongjoon-hyun/following{/other_user}","gists_url":"https://api.github.com/users/dongjoon-hyun/gists{/gist_id}","starred_url":"https://api.github.com/users/dongjoon-hyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongjoon-hyun/subscriptions","organizations_url":"https://api.github.com/users/dongjoon-hyun/orgs","repos_url":"https://api.github.com/users/dongjoon-hyun/repos","events_url":"https://api.github.com/users/dongjoon-hyun/events{/privacy}","received_events_url":"https://api.github.com/users/dongjoon-hyun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-04-05T22:30:13Z","updated_at":"2016-04-09T23:28:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12185","html_url":"https://github.com/apache/spark/pull/12185","diff_url":"https://github.com/apache/spark/pull/12185.diff","patch_url":"https://github.com/apache/spark/pull/12185.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently, many functions do now show usages like the followings.\r\n```\r\nscala> sql(\"desc function extended `sin`\").collect().foreach(println)\r\n[Function: sin]\r\n[Class: org.apache.spark.sql.catalyst.expressions.Sin]\r\n[Usage: To be added.]\r\n[Extended Usage:\r\nTo be added.]\r\n```\r\n\r\nThis PR adds descriptions for functions and adds a testcase prevent adding function without usage.\r\n```\r\nscala>  sql(\"desc function extended `sin`\").collect().foreach(println);\r\n[Function: sin]\r\n[Class: org.apache.spark.sql.catalyst.expressions.Sin]\r\n[Usage: sin(x) - Returns the sine of x.]\r\n[Extended Usage:\r\n> SELECT sin(0);\r\n 0.0]\r\n```\r\n\r\nThe only exceptions are `cube`, `grouping`, `grouping_id`, `rollup`, `window`.\r\n\r\n## How was this patch tested?\r\n\r\nPass the Jenkins tests (including new testcases.)"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/207878267","html_url":"https://github.com/apache/spark/pull/12185#issuecomment-207878267","issue_url":"https://api.github.com/repos/apache/spark/issues/12185","id":207878267,"user":{"login":"yhuai","id":2072857,"avatar_url":"https://avatars.githubusercontent.com/u/2072857?v=3","gravatar_id":"","url":"https://api.github.com/users/yhuai","html_url":"https://github.com/yhuai","followers_url":"https://api.github.com/users/yhuai/followers","following_url":"https://api.github.com/users/yhuai/following{/other_user}","gists_url":"https://api.github.com/users/yhuai/gists{/gist_id}","starred_url":"https://api.github.com/users/yhuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhuai/subscriptions","organizations_url":"https://api.github.com/users/yhuai/orgs","repos_url":"https://api.github.com/users/yhuai/repos","events_url":"https://api.github.com/users/yhuai/events{/privacy}","received_events_url":"https://api.github.com/users/yhuai/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T23:28:16Z","updated_at":"2016-04-09T23:28:16Z","body":"Yea. I feel that `calculated from values of a group` is a little bit better.  "}}