{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/153385444","pull_request_review_id":79381197,"id":153385444,"diff_hunk":"@@ -167,9 +160,20 @@ object GenerateUnsafeProjection extends CodeGenerator[Seq[Expression], UnsafePro\n         }\n     }\n \n+    val writeFieldsCode = if (isTopLevel && row == null) {","path":"sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala","position":13,"original_position":46,"commit_id":"af7fb8d5f3ce91e49ef26289a7f40bc71c0b17ec","original_commit_id":"cae5f74076bfa74c91700fe03b19158c5aa5f4f4","user":{"login":"viirya","id":68855,"avatar_url":"https://avatars1.githubusercontent.com/u/68855?v=4","gravatar_id":"","url":"https://api.github.com/users/viirya","html_url":"https://github.com/viirya","followers_url":"https://api.github.com/users/viirya/followers","following_url":"https://api.github.com/users/viirya/following{/other_user}","gists_url":"https://api.github.com/users/viirya/gists{/gist_id}","starred_url":"https://api.github.com/users/viirya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viirya/subscriptions","organizations_url":"https://api.github.com/users/viirya/orgs","repos_url":"https://api.github.com/users/viirya/repos","events_url":"https://api.github.com/users/viirya/events{/privacy}","received_events_url":"https://api.github.com/users/viirya/received_events","type":"User","site_admin":false},"body":" The `INPUT_ROW` of this local codegen context is not changed in `GenerateUnsafeProjection`. If it is `null`, the generated code will become:\r\n\r\n```scala\r\nclass SpecificUnsafeProjection extends ${classOf[UnsafeProjection].getName} {\r\n  ...\r\n  public UnsafeRow apply(InternalRow null) {  // InternalRow ${ctx.INPUT_ROW} here.\r\n    ${eval.code.trim}\r\n    return ${eval.value};\r\n  }\r\n  ...\r\n}\r\n```","created_at":"2017-11-28T03:07:26Z","updated_at":"2017-11-28T03:07:26Z","html_url":"https://github.com/apache/spark/pull/19827#discussion_r153385444","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/19827","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/153385444"},"html":{"href":"https://github.com/apache/spark/pull/19827#discussion_r153385444"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/19827"}},"in_reply_to_id":153234263},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/19827","id":154842680,"html_url":"https://github.com/apache/spark/pull/19827","diff_url":"https://github.com/apache/spark/pull/19827.diff","patch_url":"https://github.com/apache/spark/pull/19827.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/19827","number":19827,"state":"open","locked":false,"title":"[SPARK-22617][SQL] make splitExpressions extract current input of the context","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars3.githubusercontent.com/u/3182036?v=4","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nMostly when we call `CodegenContext.splitExpressions`, we want to split the code into methods and pass the current inputs of the codegen context to these methods so that the code in these methods can still be evaluated.\r\n\r\nThis PR makes the expectation clear, while still keep the advanced version of `splitExpressions` to customize the inputs to pass to generated methods.\r\n\r\n## How was this patch tested?\r\n\r\nexisting test","created_at":"2017-11-27T15:42:19Z","updated_at":"2017-11-28T03:07:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af972b2e02b2158170656798162f7d1de901c0a2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/19827/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/19827/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/19827/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/af7fb8d5f3ce91e49ef26289a7f40bc71c0b17ec","head":{"label":"cloud-fan:codegen","ref":"codegen","sha":"af7fb8d5f3ce91e49ef26289a7f40bc71c0b17ec","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars3.githubusercontent.com/u/3182036?v=4","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"repo":{"id":19689699,"name":"spark","full_name":"cloud-fan/spark","owner":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars3.githubusercontent.com/u/3182036?v=4","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cloud-fan/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/cloud-fan/spark","forks_url":"https://api.github.com/repos/cloud-fan/spark/forks","keys_url":"https://api.github.com/repos/cloud-fan/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloud-fan/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloud-fan/spark/teams","hooks_url":"https://api.github.com/repos/cloud-fan/spark/hooks","issue_events_url":"https://api.github.com/repos/cloud-fan/spark/issues/events{/number}","events_url":"https://api.github.com/repos/cloud-fan/spark/events","assignees_url":"https://api.github.com/repos/cloud-fan/spark/assignees{/user}","branches_url":"https://api.github.com/repos/cloud-fan/spark/branches{/branch}","tags_url":"https://api.github.com/repos/cloud-fan/spark/tags","blobs_url":"https://api.github.com/repos/cloud-fan/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloud-fan/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloud-fan/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloud-fan/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloud-fan/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/cloud-fan/spark/languages","stargazers_url":"https://api.github.com/repos/cloud-fan/spark/stargazers","contributors_url":"https://api.github.com/repos/cloud-fan/spark/contributors","subscribers_url":"https://api.github.com/repos/cloud-fan/spark/subscribers","subscription_url":"https://api.github.com/repos/cloud-fan/spark/subscription","commits_url":"https://api.github.com/repos/cloud-fan/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloud-fan/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloud-fan/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloud-fan/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloud-fan/spark/contents/{+path}","compare_url":"https://api.github.com/repos/cloud-fan/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloud-fan/spark/merges","archive_url":"https://api.github.com/repos/cloud-fan/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloud-fan/spark/downloads","issues_url":"https://api.github.com/repos/cloud-fan/spark/issues{/number}","pulls_url":"https://api.github.com/repos/cloud-fan/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/cloud-fan/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/cloud-fan/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloud-fan/spark/labels{/name}","releases_url":"https://api.github.com/repos/cloud-fan/spark/releases{/id}","deployments_url":"https://api.github.com/repos/cloud-fan/spark/deployments","created_at":"2014-05-12T07:32:26Z","updated_at":"2017-06-22T06:57:26Z","pushed_at":"2017-11-28T01:51:44Z","git_url":"git://github.com/cloud-fan/spark.git","ssh_url":"git@github.com:cloud-fan/spark.git","clone_url":"https://github.com/cloud-fan/spark.git","svn_url":"https://github.com/cloud-fan/spark","homepage":null,"size":261500,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"2dbe275b2d26035b610ed8385d88e3c9562eaf19","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2017-11-28T02:59:45Z","pushed_at":"2017-11-28T02:33:18Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":266879,"stargazers_count":15238,"watchers_count":15238,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14162,"mirror_url":"git://git.apache.org/spark.git","archived":false,"open_issues_count":388,"forks":14162,"open_issues":388,"watchers":15238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/19827"},"html":{"href":"https://github.com/apache/spark/pull/19827"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/19827"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/19827/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/19827/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/19827/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/af7fb8d5f3ce91e49ef26289a7f40bc71c0b17ec"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"viirya"}}