{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/7580","labels_url":"https://api.github.com/repos/apache/spark/issues/7580/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/7580/comments","events_url":"https://api.github.com/repos/apache/spark/issues/7580/events","html_url":"https://github.com/apache/spark/pull/7580","id":96439235,"number":7580,"title":"[SPARK-8231][SQL][WIP] Add array_contains","user":{"login":"EntilZha","id":1382460,"avatar_url":"https://avatars.githubusercontent.com/u/1382460?v=3","gravatar_id":"","url":"https://api.github.com/users/EntilZha","html_url":"https://github.com/EntilZha","followers_url":"https://api.github.com/users/EntilZha/followers","following_url":"https://api.github.com/users/EntilZha/following{/other_user}","gists_url":"https://api.github.com/users/EntilZha/gists{/gist_id}","starred_url":"https://api.github.com/users/EntilZha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EntilZha/subscriptions","organizations_url":"https://api.github.com/users/EntilZha/orgs","repos_url":"https://api.github.com/users/EntilZha/repos","events_url":"https://api.github.com/users/EntilZha/events{/privacy}","received_events_url":"https://api.github.com/users/EntilZha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":98,"created_at":"2015-07-21T23:32:05Z","updated_at":"2015-07-27T21:06:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7580","html_url":"https://github.com/apache/spark/pull/7580","diff_url":"https://github.com/apache/spark/pull/7580.diff","patch_url":"https://github.com/apache/spark/pull/7580.patch"},"body":"PR for work on https://issues.apache.org/jira/browse/SPARK-8231\r\n\r\nCurrently, I have an initial implementation for contains. Based on discussion on JIRA, it should behave same as Hive: https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayContains.java#L102-L128\r\n\r\nMain points are:\r\n1. If the array is empty, null, or the value is null, return false\r\n2. If there is a type mismatch, throw error\r\n3. If comparison is not supported, throw error\r\n\r\nThus far, I have 1 implemented, however the codegen is failing. A nudge in the right direction would be helpful. I am also uncertain if I should be directly outputting the code or using a helper function. I am directly outputting the code because my understanding is if the return value should not be null if any of the arguments are null, then it needs to be custom.\r\n\r\nI have an idea of how to do 2 based on other code I have seen, and google probably knows how to find out 3.\r\n\r\nAdditionally, still need to:\r\n1. Add docs\r\n2. Add python API"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/125342434","html_url":"https://github.com/apache/spark/pull/7580#issuecomment-125342434","issue_url":"https://api.github.com/repos/apache/spark/issues/7580","id":125342434,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","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":"2015-07-27T21:06:17Z","updated_at":"2015-07-27T21:06:17Z","body":" Merged build triggered."}}