{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/21403","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/21403/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/21403/comments","events_url":"https://api.github.com/repos/apache/spark/issues/21403/events","html_url":"https://github.com/apache/spark/pull/21403","id":325483588,"number":21403,"title":"[SPARK-24341][WIP][SQL] Support IN subqueries with struct type","user":{"login":"mgaido91","id":8821783,"avatar_url":"https://avatars1.githubusercontent.com/u/8821783?v=4","gravatar_id":"","url":"https://api.github.com/users/mgaido91","html_url":"https://github.com/mgaido91","followers_url":"https://api.github.com/users/mgaido91/followers","following_url":"https://api.github.com/users/mgaido91/following{/other_user}","gists_url":"https://api.github.com/users/mgaido91/gists{/gist_id}","starred_url":"https://api.github.com/users/mgaido91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgaido91/subscriptions","organizations_url":"https://api.github.com/users/mgaido91/orgs","repos_url":"https://api.github.com/users/mgaido91/repos","events_url":"https://api.github.com/users/mgaido91/events{/privacy}","received_events_url":"https://api.github.com/users/mgaido91/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-22T22:19:02Z","updated_at":"2018-05-29T09:50:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/21403","html_url":"https://github.com/apache/spark/pull/21403","diff_url":"https://github.com/apache/spark/pull/21403.diff","patch_url":"https://github.com/apache/spark/pull/21403.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nUsing struct types in subqueries with the `IN` clause can generate invalid plans in `RewritePredicateSubquery`. Indeed, we do not support the cases when the outer value is a struct or the output of the inner subquery is a struct. We only support the case when the output value is a simple value or a struct created in that place and the output of the subquery is a simple value or a list of values. \r\n\r\n## How was this patch tested?\r\n\r\nAdded UT\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/392719349","html_url":"https://github.com/apache/spark/pull/21403#issuecomment-392719349","issue_url":"https://api.github.com/repos/apache/spark/issues/21403","id":392719349,"user":{"login":"juliuszsompolski","id":25019163,"avatar_url":"https://avatars0.githubusercontent.com/u/25019163?v=4","gravatar_id":"","url":"https://api.github.com/users/juliuszsompolski","html_url":"https://github.com/juliuszsompolski","followers_url":"https://api.github.com/users/juliuszsompolski/followers","following_url":"https://api.github.com/users/juliuszsompolski/following{/other_user}","gists_url":"https://api.github.com/users/juliuszsompolski/gists{/gist_id}","starred_url":"https://api.github.com/users/juliuszsompolski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliuszsompolski/subscriptions","organizations_url":"https://api.github.com/users/juliuszsompolski/orgs","repos_url":"https://api.github.com/users/juliuszsompolski/repos","events_url":"https://api.github.com/users/juliuszsompolski/events{/privacy}","received_events_url":"https://api.github.com/users/juliuszsompolski/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T09:50:39Z","updated_at":"2018-05-29T09:50:39Z","author_association":"CONTRIBUTOR","body":"I think that the way the columns are defined in the subquery should define the semantics.\r\nE.g.:\r\n`(a, b) IN (select c, d from ...)` - unpack (a, b) and treat it as a multi column comparison as in current semantics.\r\n`(a, b) IN (select (c, d) from ..)` - keep it packed and treat it as a single column IN.\r\n`(a, b, c) IN (select (d, e), f from ..)` or similar combinations - catch it in analysis as ambiguous\r\n`(a, b, c) IN (select (d, e), f, g from ..)` - but this is valid as long as `a` matches the type of `(d, e)`"}}
{"actor":{"display_login":"juliuszsompolski"}}