{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12128","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12128/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12128/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12128/events","html_url":"https://github.com/apache/spark/pull/12128","id":145348252,"number":12128,"title":"[SPARK-14335][SQL] Describe function command returns wrong output","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-04-02T07:43:03Z","updated_at":"2016-04-04T08:00:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12128","html_url":"https://github.com/apache/spark/pull/12128","diff_url":"https://github.com/apache/spark/pull/12128.diff","patch_url":"https://github.com/apache/spark/pull/12128.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\n…because some of built-in functions are not in function registry.\r\n\r\nThis fix tries to fix issues in `describe function` command where some of the outputs\r\nstill shows Hive's function because some built-in functions are not in FunctionRegistry.\r\n\r\nThe following built-in functions have been added to FunctionRegistry:\r\n```\r\n-\r\n!\r\n*\r\n/\r\n&\r\n%\r\n^\r\n+\r\n<\r\n<=\r\n<=>\r\n=\r\n==\r\n>\r\n>=\r\n|\r\n~\r\nand\r\nin\r\nlike\r\nnot\r\nor\r\nrlike\r\nwhen\r\n```\r\n\r\nThe following listed functions are not added, but hard coded in `commands.scala` (@hvanhovell):\r\n```\r\n!=\r\n<>\r\nbetween\r\ncase\r\n```\r\nBelow are the existing result of the above functions that have not been added:\r\n```\r\nspark-sql> describe function `!=`;\r\nFunction: <>\r\nClass: org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNotEqual\r\nUsage: a <> b - Returns TRUE if a is not equal to b\r\n```\r\n```\r\nspark-sql> describe function `<>`;\r\nFunction: <>\r\nClass: org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNotEqual\r\nUsage: a <> b - Returns TRUE if a is not equal to b\r\n```\r\n```\r\nspark-sql> describe function `between`;\r\nFunction: between\r\nClass: org.apache.hadoop.hive.ql.udf.generic.GenericUDFBetween\r\nUsage: between a [NOT] BETWEEN b AND c - evaluate if a is [not] in between b and c\r\n```\r\n```\r\nspark-sql> describe function `case`;\r\nFunction: case\r\nClass: org.apache.hadoop.hive.ql.udf.generic.GenericUDFCase\r\nUsage: CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END - When a = b, returns c; when a = d, return e; else return f\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nExisting tests passed."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/205182405","html_url":"https://github.com/apache/spark/pull/12128#issuecomment-205182405","issue_url":"https://api.github.com/repos/apache/spark/issues/12128","id":205182405,"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-04-04T08:00:04Z","updated_at":"2016-04-04T08:00:04Z","body":"**[Test build #54834 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/54834/consoleFull)** for PR 12128 at commit [`f318e8c`](https://github.com/apache/spark/commit/f318e8c3208c3bf5aed6d2202fb71052410aab81).\n * This patch **fails Spark unit tests**.\n * This patch merges cleanly.\n * This patch adds no public classes."}}