{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/presto/issues/2466","labels_url":"https://api.github.com/repos/facebook/presto/issues/2466/labels{/name}","comments_url":"https://api.github.com/repos/facebook/presto/issues/2466/comments","events_url":"https://api.github.com/repos/facebook/presto/issues/2466/events","html_url":"https://github.com/facebook/presto/pull/2466","id":59912150,"number":2466,"title":"Fix planner bug when mixing window functions and implicit coercions","user":{"login":"martint","id":14387,"avatar_url":"https://avatars.githubusercontent.com/u/14387?v=3","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-03-05T06:39:12Z","updated_at":"2015-03-05T23:48:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/presto/pulls/2466","html_url":"https://github.com/facebook/presto/pull/2466","diff_url":"https://github.com/facebook/presto/pull/2466.diff","patch_url":"https://github.com/facebook/presto/pull/2466.patch"},"body":"A query that has:\r\n- window functions\r\n- implicit coercions\r\n- wildcard field references (e.g., SELECT *)\r\n\r\nSuch as:\r\n\r\n```\r\nSELECT *, 1.0 * count(*) OVER () FROM (VALUES 1);\r\n```\r\n\r\nFails during planning with the following error:\r\n\r\n```\r\njava.lang.IllegalStateException: No mapping for field '0'\r\n\tat com.google.common.base.Preconditions.checkState(Preconditions.java:197)\r\n\tat com.facebook.presto.sql.planner.TranslationMap.rewrite(TranslationMap.java:114)\r\n\tat com.facebook.presto.sql.planner.PlanBuilder.rewrite(PlanBuilder.java:72)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.project(QueryPlanner.java:210)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.visitQuerySpecification(QueryPlanner.java:128)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.visitQuerySpecification(QueryPlanner.java:70)\r\n\tat com.facebook.presto.sql.tree.QuerySpecification.accept(QuerySpecification.java:98)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.RelationPlanner.visitQuerySpecification(RelationPlanner.java:416)\r\n\tat com.facebook.presto.sql.planner.RelationPlanner.visitQuerySpecification(RelationPlanner.java:97)\r\n\tat com.facebook.presto.sql.tree.QuerySpecification.accept(QuerySpecification.java:98)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.planQueryBody(QueryPlanner.java:141)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.visitQuery(QueryPlanner.java:97)\r\n\tat com.facebook.presto.sql.planner.QueryPlanner.visitQuery(QueryPlanner.java:70)\r\n\tat com.facebook.presto.sql.tree.Query.accept(Query.java:80)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.RelationPlanner.visitQuery(RelationPlanner.java:403)\r\n\tat com.facebook.presto.sql.planner.RelationPlanner.visitQuery(RelationPlanner.java:97)\r\n\tat com.facebook.presto.sql.tree.Query.accept(Query.java:80)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.LogicalPlanner.createRelationPlan(LogicalPlanner.java:176)\r\n\tat com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:80)\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/presto/issues/comments/77478060","html_url":"https://github.com/facebook/presto/pull/2466#issuecomment-77478060","issue_url":"https://api.github.com/repos/facebook/presto/issues/2466","id":77478060,"user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T23:48:36Z","updated_at":"2015-03-05T23:48:36Z","body":"looks good"}}