New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: table.sort_by().count() generates incorrect code #1180

Closed
cpcloud opened this Issue Oct 21, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@cpcloud
Member

cpcloud commented Oct 21, 2017

In [1]: con = ibis.postgres.connect(database='ibis_testing')

In [2]: t = con.table('batting')

In [3]: print(t.sort_by(ibis.desc(t.playerID)).count().compile().compile())
SELECT count(%(count_1)s) AS count 
FROM batting AS t0 ORDER BY t0."playerID" DESC

This is incorrect, because ORDER BY in an aggregation is meaningless without a GROUP BY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment