{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13392","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13392/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13392/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13392/events","html_url":"https://github.com/apache/spark/pull/13392","id":157372936,"number":13392,"title":"[SPARK-15647] [SQL] Fix Boundary Cases in OptimizeCodegen Rule","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":13,"created_at":"2016-05-29T07:03:00Z","updated_at":"2016-05-31T14:23:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13392","html_url":"https://github.com/apache/spark/pull/13392","diff_url":"https://github.com/apache/spark/pull/13392.diff","patch_url":"https://github.com/apache/spark/pull/13392.patch"},"body":"#### What changes were proposed in this pull request?\r\n\r\nThe following condition in the Optimizer rule `OptimizeCodegen` is not right.\r\n```Scala\r\nbranches.size < conf.maxCaseBranchesForCodegen\r\n```\r\n\r\n- The number of branches in case when clause should be `branches.size + elseBranch.size`. \r\n- `maxCaseBranchesForCodegen` is the maximum boundary for enabling codegen. Thus, we should use `<=` instead of `<`.\r\n\r\nThis PR is to fix this boundary case and also add missing test cases for verifying the conf `MAX_CASES_BRANCHES`.\r\n\r\n#### How was this patch tested?\r\nAdded test cases in `SQLConfSuite`"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/222704213","html_url":"https://github.com/apache/spark/pull/13392#issuecomment-222704213","issue_url":"https://api.github.com/repos/apache/spark/issues/13392","id":222704213,"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},"created_at":"2016-05-31T14:23:23Z","updated_at":"2016-05-31T14:23:23Z","body":"retest this please"}}
{"actor":{"display_login":"gatorsmile"}}