{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12322","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12322/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12322/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12322/events","html_url":"https://github.com/apache/spark/pull/12322","id":147624954,"number":12322,"title":"[SPARK-14554][SQL] Dataset.map may generate wrong java code for wide table","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars.githubusercontent.com/u/3182036?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-12T03:53:02Z","updated_at":"2016-04-12T03:57:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12322","html_url":"https://github.com/apache/spark/pull/12322","diff_url":"https://github.com/apache/spark/pull/12322.diff","patch_url":"https://github.com/apache/spark/pull/12322.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nIn https://github.com/apache/spark/pull/12047/files#diff-94a1f59bcc9b6758c4ca874652437634R529, we may split field expressions codes in `CreateExternalRow` to support wide table. However, after we support whole stage codegen for typed operations, the `CreateExternalRow` may also appear in whole stage codegen.\r\n\r\nThe problem is, in whole stage codegen, the input for expressions is not always the input row, but can be `CodeGenContext.currentVars`, which doesn't work well with `CodeGenContext.splitExpressions`.\r\n\r\nThis PR stops splitting field expressions codes in `CreateExternalRow` if it's being whole stage codegened, but we need a better way to fix this problem instead of avoiding it.\r\n\r\n## How was this patch tested?\r\n\r\nnew test in DatasetSuite.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/208693002","html_url":"https://github.com/apache/spark/pull/12322#issuecomment-208693002","issue_url":"https://api.github.com/repos/apache/spark/issues/12322","id":208693002,"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-04-12T03:57:33Z","updated_at":"2016-04-12T03:57:33Z","body":"**[Test build #55584 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55584/consoleFull)** for PR 12322 at commit [`0ad1194`](https://github.com/apache/spark/commit/0ad119490ac5fba06d6cdeda1d4a9e9e0f8c0c8e)."}}