{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/5075","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/5075/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5075/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/5075/events","html_url":"https://github.com/prestodb/presto/issues/5075","id":149957514,"number":5075,"title":"Explain plan for windows shows wrong output types","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/prestodb/presto/labels/RELEASE-BLOCKER","name":"RELEASE-BLOCKER","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"raghavsethi","id":715788,"avatar_url":"https://avatars.githubusercontent.com/u/715788?v=3","gravatar_id":"","url":"https://api.github.com/users/raghavsethi","html_url":"https://github.com/raghavsethi","followers_url":"https://api.github.com/users/raghavsethi/followers","following_url":"https://api.github.com/users/raghavsethi/following{/other_user}","gists_url":"https://api.github.com/users/raghavsethi/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavsethi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavsethi/subscriptions","organizations_url":"https://api.github.com/users/raghavsethi/orgs","repos_url":"https://api.github.com/users/raghavsethi/repos","events_url":"https://api.github.com/users/raghavsethi/events{/privacy}","received_events_url":"https://api.github.com/users/raghavsethi/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2016-04-21T03:55:25Z","updated_at":"2016-04-21T04:42:52Z","closed_at":null,"body":"Window functions are showing the wrong output types.  I'm not sure if this is a bigger issue but I think it could result in incorrect results if any code is depending on this.\r\n\r\nHere is the new explain plain:\r\n```\r\npresto:tiny> explain (type distributed) SELECT *, 1.0 * sum(x) OVER () FROM (VALUES 1) t(x);\r\n                        Query Plan                        \r\n----------------------------------------------------------\r\n Fragment 0 [SINGLE]                                      \r\n     Output layout: [x, expr_3]                           \r\n     Output partitioning: SINGLE []                       \r\n     - Output[x, _col1] => [x:bigint, expr_3:double]      \r\n             _col1 := expr_3                              \r\n         - Project => [x:bigint, expr_3:double]           \r\n                 expr_3 := (1.0 * CAST(\"expr\" AS DOUBLE)) \r\n             - Window[] => [x:bigint, expr:double]     <===== HERE   \r\n                     expr := sum(\"x\")                     \r\n                 - Project => [x:bigint]                  \r\n                         x := CAST(\"field\" AS BIGINT)     \r\n                     - Values => [field:integer]          \r\n                             (1)                          \r\n```\r\n\r\nHere is an explain plan from the last release:\r\n```\r\npresto:tiny> explain (type distributed) SELECT *, 1.0 * sum(x) OVER () FROM (VALUES 1) t(x);\r\n                        Query Plan                        \r\n----------------------------------------------------------\r\n Fragment 0 [SINGLE]                                      \r\n     Output layout: [field, expr_3]                       \r\n     Output partitioning: SINGLE []                       \r\n     - Output[x, _col1] => [field:bigint, expr_3:double]  \r\n             x := field                                   \r\n             _col1 := expr_3                              \r\n         - Project => [field:bigint, expr_3:double]       \r\n                 expr_3 := (1.0 * CAST(\"expr\" AS DOUBLE)) \r\n             - Window[] => [field:bigint, expr:bigint]     <===== HERE       \r\n                     expr := sum(\"field\")                 \r\n                 - Values => [field:bigint]               \r\n                         (1)                              \r\n```"},"comment":{"url":"https://api.github.com/repos/prestodb/presto/issues/comments/212741224","html_url":"https://github.com/prestodb/presto/issues/5075#issuecomment-212741224","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5075","id":212741224,"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},"created_at":"2016-04-21T04:42:52Z","updated_at":"2016-04-21T04:42:52Z","body":"Yeah, L391 does the same thing."}}