{"action":"closed","issue":{"url":"https://api.github.com/repos/cloudera/ibis/issues/91","labels_url":"https://api.github.com/repos/cloudera/ibis/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/cloudera/ibis/issues/91/comments","events_url":"https://api.github.com/repos/cloudera/ibis/issues/91/events","html_url":"https://github.com/cloudera/ibis/issues/91","id":69922750,"number":91,"title":"TopK-like expressions, a better way to model in expression IR? ","user":{"login":"wesm","id":329591,"avatar_url":"https://avatars.githubusercontent.com/u/329591?v=3","gravatar_id":"","url":"https://api.github.com/users/wesm","html_url":"https://github.com/wesm","followers_url":"https://api.github.com/users/wesm/followers","following_url":"https://api.github.com/users/wesm/following{/other_user}","gists_url":"https://api.github.com/users/wesm/gists{/gist_id}","starred_url":"https://api.github.com/users/wesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesm/subscriptions","organizations_url":"https://api.github.com/users/wesm/orgs","repos_url":"https://api.github.com/users/wesm/repos","events_url":"https://api.github.com/users/wesm/events{/privacy}","received_events_url":"https://api.github.com/users/wesm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudera/ibis/labels/complexity-high","name":"complexity-high","color":"e11d21"},{"url":"https://api.github.com/repos/cloudera/ibis/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"wesm","id":329591,"avatar_url":"https://avatars.githubusercontent.com/u/329591?v=3","gravatar_id":"","url":"https://api.github.com/users/wesm","html_url":"https://github.com/wesm","followers_url":"https://api.github.com/users/wesm/followers","following_url":"https://api.github.com/users/wesm/following{/other_user}","gists_url":"https://api.github.com/users/wesm/gists{/gist_id}","starred_url":"https://api.github.com/users/wesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesm/subscriptions","organizations_url":"https://api.github.com/users/wesm/orgs","repos_url":"https://api.github.com/users/wesm/repos","events_url":"https://api.github.com/users/wesm/events{/privacy}","received_events_url":"https://api.github.com/users/wesm/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cloudera/ibis/milestones/4","html_url":"https://github.com/cloudera/ibis/milestones/0.4","labels_url":"https://api.github.com/repos/cloudera/ibis/milestones/4/labels","id":1091848,"number":4,"title":"0.4","description":"","creator":{"login":"wesm","id":329591,"avatar_url":"https://avatars.githubusercontent.com/u/329591?v=3","gravatar_id":"","url":"https://api.github.com/users/wesm","html_url":"https://github.com/wesm","followers_url":"https://api.github.com/users/wesm/followers","following_url":"https://api.github.com/users/wesm/following{/other_user}","gists_url":"https://api.github.com/users/wesm/gists{/gist_id}","starred_url":"https://api.github.com/users/wesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesm/subscriptions","organizations_url":"https://api.github.com/users/wesm/orgs","repos_url":"https://api.github.com/users/wesm/repos","events_url":"https://api.github.com/users/wesm/events{/privacy}","received_events_url":"https://api.github.com/users/wesm/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":58,"state":"open","created_at":"2015-04-30T22:52:43Z","updated_at":"2015-08-07T04:17:40Z","due_on":"2015-08-07T07:00:00Z","closed_at":null},"comments":1,"created_at":"2015-04-21T18:50:34Z","updated_at":"2015-08-07T04:17:40Z","closed_at":"2015-08-07T04:17:40Z","body":"<a href=\"http://github.mtv.cloudera.com/wesm\"><img src=\"https://gravatar.com/avatar/d95cdeb33b3463eba00e4064fbd030d6?d=https%3A%2F%2Fidenticons.github.com%2Ff3f27a324736617f20abbf2ffd806f6d.png&r=x\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [wesm](http://github.mtv.cloudera.com/wesm)**\n_Thursday Jan 29, 2015 at 18:52 GMT_\n_Originally opened as http://github.mtv.cloudera.com/wesm/ibis/issues/91_\n\n----\n\nThe initial cut of the TopK filter wraps the operation in a BooleanArray: http://github.mtv.cloudera.com/wesm/ibis/commit/ad53ba7c5a3cef5d1d758008812e1b9039d05c7c . This isn't exactly legit, because composing that filter with other comparisons will make SQL translation pretty difficult.\r\n\r\nI posit that TopK and other to-be-written analytical operations should be a new kind of thing, call it `AnalyticExpr`, that can be treated as different things depending on the context in which it's used. For example, a user might want to evaluate `table.field.topk(10, by=table.foo.sum())` by itself, producing a list of values from the `field` column. If `topk` produces a BooleanArray, this is then a little nonsensical. \n"}}