{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11274","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11274/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11274/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11274/events","html_url":"https://github.com/apache/spark/pull/11274","id":134933054,"number":11274,"title":"[SPARK-13404] [SQL] Create variables for input row when it's actually used","user":{"login":"davies","id":40902,"avatar_url":"https://avatars.githubusercontent.com/u/40902?v=3","gravatar_id":"","url":"https://api.github.com/users/davies","html_url":"https://github.com/davies","followers_url":"https://api.github.com/users/davies/followers","following_url":"https://api.github.com/users/davies/following{/other_user}","gists_url":"https://api.github.com/users/davies/gists{/gist_id}","starred_url":"https://api.github.com/users/davies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davies/subscriptions","organizations_url":"https://api.github.com/users/davies/orgs","repos_url":"https://api.github.com/users/davies/repos","events_url":"https://api.github.com/users/davies/events{/privacy}","received_events_url":"https://api.github.com/users/davies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-19T18:01:46Z","updated_at":"2016-03-01T06:44:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11274","html_url":"https://github.com/apache/spark/pull/11274","diff_url":"https://github.com/apache/spark/pull/11274.diff","patch_url":"https://github.com/apache/spark/pull/11274.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nRight now, we create the variables in the first operator (usually InputAdapter), they could be wasted if most of rows after filtered out immediately.\r\n\r\nThis PR change to defer that until they are used by following operators.\r\n\r\nThis PR also change the `if` from \r\n```\r\nif (cond) {\r\n  xxx\r\n}\r\n```\r\nto \r\n```\r\nif (!cond) continue;\r\nxxx\r\n```\r\nThe new one could help to reduce the nested indents for multiple levels of Filter and BroadcastHashJoin.\r\n\r\nIt also added some comments for operators.\r\n\r\n## How was the this patch tested?\r\n\r\nUnit tests. Manually ran TPCDS Q55, this PR improve the performance about 6% (scale=10, from 4.9s to 4.6s)\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/190576044","html_url":"https://github.com/apache/spark/pull/11274#issuecomment-190576044","issue_url":"https://api.github.com/repos/apache/spark/issues/11274","id":190576044,"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-03-01T06:44:46Z","updated_at":"2016-03-01T06:44:46Z","body":"**[Test build #2595 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2595/consoleFull)** for PR 11274 at commit [`ca8fe0f`](https://github.com/apache/spark/commit/ca8fe0f5f55cabb1bb5903c3e85c150b31eaa7c7)."}}