jbvsmo opened a new issue, #20349:
URL: https://github.com/apache/superset/issues/20349
A clear and concise description of what the bug is.
#### How to reproduce the bug
1. Create a new table chart and pick a timestamp field like `2022-06-10
12:34:56` and select time grain `day` or `month`
2. Select as dimension the same timestamp field
3. Add any metric such as `COUNT(*)`
4. Superset will generate this query:
```
SELECT DATE_TRUNC('day', "OperationDate") AS "OperationDate",
COUNT(*) AS "count"
FROM "no-partitions-queries"."messages_operations_v"
GROUP BY DATE_TRUNC('day', "OperationDate")
ORDER BY "count" DESC
LIMIT 10000;
```
It is not using the name of the column `OperationDate` in the group by and
is rewriting the same expression.
### Expected results
to have this clause:
```
GROUP BY "OperationDate"
```
### Actual results
Query execution error. Details:
VALIDATION ERROR: Expression \'messages_operations_v.OperationDate\' is not
being grouped
> Unexpected error
Error: ('HY000', '[HY000] [Dremio][Connector] (1040) Dremio failed to
execute the query: SELECT DATE_TRUNC(\'day\', "OperationDate") AS
"OperationDate",\n COUNT(*) AS "count"\nFROM
"no-partitions-queries"."messages_operations_v"\nGROUP BY DATE_TRUNC(\'day\',
"OperationDate")\nORDER BY "count" DESC\nLIMIT 10000\n[30038]Query execution
error. Details:[ \nVALIDATION ERROR: Expression
\'messages_operations_v.OperationDate\' is not being grouped\n\nSQL Query
SELECT DATE_...[see log] (1040) (SQLExecDirectW)')
#### Screenshots

### Environment
- browser type and version: Chrome v102.0.5005.61
- superset version: It show Superset 0.0.0dev -- I'm using the latest docker
image
- python version: 3.8.12
- node.js version: none
- any feature flags active: no
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included
it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version
of superset.
- [x] I have checked the issue tracker for the same issue and I haven't
found one similar.
### Additional context
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]