{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/22518","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/22518/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/22518/comments","events_url":"https://api.github.com/repos/apache/spark/issues/22518/events","html_url":"https://github.com/apache/spark/pull/22518","id":362615598,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MjgzNTU4","number":22518,"title":"[SPARK-25482][SQL] ReuseSubquery can be useless when the subqueries have the same id","user":{"login":"mgaido91","id":8821783,"node_id":"MDQ6VXNlcjg4MjE3ODM=","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":2,"created_at":"2018-09-21T13:26:03Z","updated_at":"2018-09-21T13:28:28Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22518","html_url":"https://github.com/apache/spark/pull/22518","diff_url":"https://github.com/apache/spark/pull/22518.diff","patch_url":"https://github.com/apache/spark/pull/22518.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nWhen a `ExecSubqueryExpression` is copied, it may happen that there are two instances with the same `exprId`. This can happen for instance when a filter containing a scalar subquery is pushed to a DataSource. In this scenario, `ReuseSubquery` becomes useless, as replacing the `SubqueryExec` is ignored since the new plan is equal to the previous one.\r\n\r\nThe PR avoids this problem by creating a new `ExprId` for the subquery expression when it is changed in `ReuseSubquery`, so that the changes are not ignored.\r\n\r\n## How was this patch tested?\r\n\r\nadded UT"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/423530924","html_url":"https://github.com/apache/spark/pull/22518#issuecomment-423530924","issue_url":"https://api.github.com/repos/apache/spark/issues/22518","id":423530924,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzUzMDkyNA==","user":{"login":"SparkQA","id":8108735,"node_id":"MDQ6VXNlcjgxMDg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/8108735?v=4","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":"2018-09-21T13:28:28Z","updated_at":"2018-09-21T13:28:28Z","author_association":"NONE","body":"**[Test build #96427 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/96427/testReport)** for PR 22518 at commit [`36fa664`](https://github.com/apache/spark/commit/36fa664c6d251901270984115ff2ebfd1b665fca)."}}
{"actor":{"display_login":"SparkQA"}}