Skip to content
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

SQL ungrouped summarize should always return 1 row #62

Open
machow opened this issue May 21, 2019 · 1 comment
Open

SQL ungrouped summarize should always return 1 row #62

machow opened this issue May 21, 2019 · 1 comment

Comments

@machow
Copy link
Owner

machow commented May 21, 2019

Note that currently, if you do an ungrouped summarize, no GROUP BY is created.
However, this creates the issue where assigning a literal in a summarize, will be the length of all rows in table.

Reduces to one row

summarize(tbl, y = n(_)) >> show_query()
SELECT count(*) AS y 
FROM siuba_019

Does not

summarize(tbl, y = 1) >> show_query()
@machow machow added the be:sql label Jun 21, 2019
@machow
Copy link
Owner Author

machow commented Jul 19, 2019

I tried adding a trivial grouping operation, in the case where there are no groups. Worked on postgres butfailed at least on sqlite. Checking dbplyr's behavior, it looks like this is an outstanding issue there, too. Going to remove from sprint.

Example query:

SELECT 1 as y
FROM users GROUP BY TRUE

@machow machow added the .icebox label Sep 15, 2019
@machow machow added this to siuba Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant