{"action":"created","issue":{"url":"https://api.github.com/repos/raw-db/ldb/issues/25","labels_url":"https://api.github.com/repos/raw-db/ldb/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/raw-db/ldb/issues/25/comments","events_url":"https://api.github.com/repos/raw-db/ldb/issues/25/events","html_url":"https://github.com/raw-db/ldb/issues/25","id":100808607,"number":25,"title":"Crash when converting queries with unique and avg into a logical plan ","user":{"login":"nfsantos","id":776333,"avatar_url":"https://avatars.githubusercontent.com/u/776333?v=3","gravatar_id":"","url":"https://api.github.com/users/nfsantos","html_url":"https://github.com/nfsantos","followers_url":"https://api.github.com/users/nfsantos/followers","following_url":"https://api.github.com/users/nfsantos/following{/other_user}","gists_url":"https://api.github.com/users/nfsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfsantos/subscriptions","organizations_url":"https://api.github.com/users/nfsantos/orgs","repos_url":"https://api.github.com/users/nfsantos/repos","events_url":"https://api.github.com/users/nfsantos/events{/privacy}","received_events_url":"https://api.github.com/users/nfsantos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-13T16:08:06Z","updated_at":"2015-08-17T16:21:36Z","closed_at":null,"body":"The LDB OQL to logical plan compiler fails in the queries `unique(select year from authors)` and `avg(select year from authors)`. These queries also crash when used with `bin/plan`. However, they work with the GCC executor.\r\n\r\n```\r\nroot@9ccf50c0e575:/raw/ldb# ./bin/plan  Publications\r\ncpu_info sees 1 sockets and 8 cores\r\nprint  unique(select year from authors);\r\n\r\nComprehension Calculus Form\r\neq(compr(sum,1,iterate(_X0,compr(bag,project(authors,year,long),iterate(authors,\r\nauthors),true,true))),\r\n   1)\r\n\r\nType of the Query\r\nboolean\r\n\r\nOptimized Algebraic Form\r\neq(reduce(sum,get(bag,authors,_X8,and()),_X7,1,and()),1)\r\neq(reduce(sum,get(bag,authors,_X8,and()),_X7,1,and()),1)unexpected node\r\nAborted\r\n```"},"comment":{"url":"https://api.github.com/repos/raw-db/ldb/issues/comments/131878375","html_url":"https://github.com/raw-db/ldb/issues/25#issuecomment-131878375","issue_url":"https://api.github.com/repos/raw-db/ldb/issues/25","id":131878375,"user":{"login":"bgaidioz","id":10529136,"avatar_url":"https://avatars.githubusercontent.com/u/10529136?v=3","gravatar_id":"","url":"https://api.github.com/users/bgaidioz","html_url":"https://github.com/bgaidioz","followers_url":"https://api.github.com/users/bgaidioz/followers","following_url":"https://api.github.com/users/bgaidioz/following{/other_user}","gists_url":"https://api.github.com/users/bgaidioz/gists{/gist_id}","starred_url":"https://api.github.com/users/bgaidioz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgaidioz/subscriptions","organizations_url":"https://api.github.com/users/bgaidioz/orgs","repos_url":"https://api.github.com/users/bgaidioz/repos","events_url":"https://api.github.com/users/bgaidioz/events{/privacy}","received_events_url":"https://api.github.com/users/bgaidioz/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T16:21:36Z","updated_at":"2015-08-17T16:21:36Z","body":"This is because the node which is generated is an expression (eq(x,y) instead of a normal algebra node. Solution is to make algebra nodes and regular expressions being the same type of node and have the scala executor deal with both. See with Miguel who had already implemented some changes in this view."}}