{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/10393","labels_url":"https://api.github.com/repos/apache/spark/issues/10393/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/10393/comments","events_url":"https://api.github.com/repos/apache/spark/issues/10393/events","html_url":"https://github.com/apache/spark/pull/10393","id":123103891,"number":10393,"title":"[SPARK-12441] [SQL] Fixing missingInput in Generate/MapPartitions/AppendColumns/MapGroups/CoGroup","user":{"login":"gatorsmile","id":11567269,"avatar_url":"https://avatars.githubusercontent.com/u/11567269?v=3","gravatar_id":"","url":"https://api.github.com/users/gatorsmile","html_url":"https://github.com/gatorsmile","followers_url":"https://api.github.com/users/gatorsmile/followers","following_url":"https://api.github.com/users/gatorsmile/following{/other_user}","gists_url":"https://api.github.com/users/gatorsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gatorsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatorsmile/subscriptions","organizations_url":"https://api.github.com/users/gatorsmile/orgs","repos_url":"https://api.github.com/users/gatorsmile/repos","events_url":"https://api.github.com/users/gatorsmile/events{/privacy}","received_events_url":"https://api.github.com/users/gatorsmile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-19T18:53:02Z","updated_at":"2015-12-22T22:22:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10393","html_url":"https://github.com/apache/spark/pull/10393","diff_url":"https://github.com/apache/spark/pull/10393.diff","patch_url":"https://github.com/apache/spark/pull/10393.patch"},"body":"When explain any plan with Generate, we will see an exclamation mark in the plan. Normally, when we see this mark, it means the plan has an error. This PR is to correct the `missingInput` in `Generate`.\r\n\r\nFor example, \r\n```scala\r\nval df = Seq((1, \"a b c\"), (2, \"a b\"), (3, \"a\")).toDF(\"number\", \"letters\")\r\nval df2 =\r\n  df.explode('letters) {\r\n    case Row(letters: String) => letters.split(\" \").map(Tuple1(_)).toSeq\r\n  }\r\n\r\ndf2.explain(true)\r\n```\r\nBefore the fix, the plan is like \r\n```\r\n== Parsed Logical Plan ==\r\n'Generate UserDefinedGenerator('letters), true, false, None\r\n+- Project [_1#0 AS number#2,_2#1 AS letters#3]\r\n   +- LocalRelation [_1#0,_2#1], [[1,a b c],[2,a b],[3,a]]\r\n\r\n== Analyzed Logical Plan ==\r\nnumber: int, letters: string, _1: string\r\nGenerate UserDefinedGenerator(letters#3), true, false, None, [_1#8]\r\n+- Project [_1#0 AS number#2,_2#1 AS letters#3]\r\n   +- LocalRelation [_1#0,_2#1], [[1,a b c],[2,a b],[3,a]]\r\n\r\n== Optimized Logical Plan ==\r\nGenerate UserDefinedGenerator(letters#3), true, false, None, [_1#8]\r\n+- LocalRelation [number#2,letters#3], [[1,a b c],[2,a b],[3,a]]\r\n\r\n== Physical Plan ==\r\n!Generate UserDefinedGenerator(letters#3), true, false, [number#2,letters#3,_1#8]\r\n+- LocalTableScan [number#2,letters#3], [[1,a b c],[2,a b],[3,a]]\r\n```\r\n\r\n**Updates**: The same issues are also found in the other four Dataset operators: `MapPartitions`/`AppendColumns`/`MapGroups`/`CoGroup`. Fixed all these four. "},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/166749223","html_url":"https://github.com/apache/spark/pull/10393#issuecomment-166749223","issue_url":"https://api.github.com/repos/apache/spark/issues/10393","id":166749223,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T22:22:30Z","updated_at":"2015-12-22T22:22:30Z","body":"Build finished. Test FAILed."}}