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

support noop group by clause #464

Closed
bluestreak01 opened this issue Jun 29, 2020 · 5 comments
Closed

support noop group by clause #464

bluestreak01 opened this issue Jun 29, 2020 · 5 comments
Assignees
Labels
SQL Issues or changes relating to SQL execution

Comments

@bluestreak01
Copy link
Member

This SQL errors out unnecessarily:

select x, sum(y) from tab group by x

group by x must be consumed and validated to allow friction free user experience

@bluestreak01 bluestreak01 added the SQL Issues or changes relating to SQL execution label Jun 29, 2020
@lbowman
Copy link
Contributor

lbowman commented Jul 1, 2020

@bluestreak01 Is this an intentional change from the docs: http://questdb.io/docs/sqlExtensions#important-differences-from-standard-sql

"We do not support explicit GROUP BY clause."

Is the idea then to validate that the provided group by clause matches the implied grouping and then effectively ignore it?

@TheTanc
Copy link
Contributor

TheTanc commented Jul 1, 2020

Yes this is intentional. We noticed a lot of users were unaware of the implicit grouping. So they tried GROUP BY clauses and got error messages.

As a first step, it could validate the columns and let the implicit group by perform in the background. This would remove 99.99% of the friction and make it easier to migrate existing queries to QuestDB.

@den-crane
Copy link

about migration, Mysql does the opposite. It applies any() if a column not mentioned in group by

select a, sum(b) from (select 1 a, 1 b union all select 333, 1) x;
+------+--------+
| a    | sum(b) |
+------+--------+
|    1 |      2 |
+------+--------+

@bluestreak01
Copy link
Member Author

we do the same, that said it looks like SQL in MySQL has mulfunctioned? There should be two keys in the output, as below?

image

@den-crane
Copy link

by default / with disabled strictness

if one execute select a, sum(b) (without group by section) mysql does select any(a), sum(b) group by 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SQL Issues or changes relating to SQL execution
Projects
No open projects
QuestDB Roadmap
  
Awaiting triage
Development

No branches or pull requests

5 participants