{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/16476","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/16476/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/16476/comments","events_url":"https://api.github.com/repos/apache/spark/issues/16476/events","html_url":"https://github.com/apache/spark/pull/16476","id":198927283,"node_id":"MDExOlB1bGxSZXF1ZXN0MTAwMjY5NDQz","number":16476,"title":"[SPARK-19084][SQL] Implement expression field ","user":{"login":"gczsjdy","id":7685352,"node_id":"MDQ6VXNlcjc2ODUzNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7685352?v=4","gravatar_id":"","url":"https://api.github.com/users/gczsjdy","html_url":"https://github.com/gczsjdy","followers_url":"https://api.github.com/users/gczsjdy/followers","following_url":"https://api.github.com/users/gczsjdy/following{/other_user}","gists_url":"https://api.github.com/users/gczsjdy/gists{/gist_id}","starred_url":"https://api.github.com/users/gczsjdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gczsjdy/subscriptions","organizations_url":"https://api.github.com/users/gczsjdy/orgs","repos_url":"https://api.github.com/users/gczsjdy/repos","events_url":"https://api.github.com/users/gczsjdy/events{/privacy}","received_events_url":"https://api.github.com/users/gczsjdy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":39,"created_at":"2017-01-05T10:50:35Z","updated_at":"2018-08-06T21:38:07Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/16476","html_url":"https://github.com/apache/spark/pull/16476","diff_url":"https://github.com/apache/spark/pull/16476.diff","patch_url":"https://github.com/apache/spark/pull/16476.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis is an implementation of expression `field` which is implemented as built-in function by Hive and MySQL.\r\n\r\nfield(expr, expr1, expr2, ... ) is a variable-length(>=2) function that returns the index of expr in (expr1, expr2, ...) list or 0 if not found.\r\n\r\n * It takes at least 2 parameters, and all parameters can be of any type.\r\n * Implicit cast will be done when at least 2 parameters have different types, and it will be based on the first parameter's type.\r\n * If the first parameter is of NumericType, all parameters will be implicitly cast to DoubleType, and those that can't be cast to DoubleType will be regarded as NULL.\r\n * If the first parameter is of any other type, all parameters will be implicitly cast to StringType and the comparison will follow String's comparing rules.\r\n * If the search expression is NULL, the return value is 0 because NULL fails equality comparison with any value.\r\n\r\n## How was this patch tested?\r\n\r\nUnit tests are in ConditionalExpressionSuite & ColumnExpressionSuite."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/410861112","html_url":"https://github.com/apache/spark/pull/16476#issuecomment-410861112","issue_url":"https://api.github.com/repos/apache/spark/issues/16476","id":410861112,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDg2MTExMg==","user":{"login":"AmplabJenkins","id":4031291,"node_id":"MDQ6VXNlcjQwMzEyOTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4031291?v=4","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T21:38:07Z","updated_at":"2018-08-06T21:38:07Z","author_association":"NONE","body":"Can one of the admins verify this patch?"}}
{"actor":{"display_login":"AmplabJenkins"}}