yuribogomolov opened a new issue, #31192:
URL: https://github.com/apache/superset/issues/31192
### Bug description
### Summary:
After upgrading Superset from version 4.0.2 to 4.1.1, all time-series charts
with a time grain fail with Apache Pinot. The issue arises because the new
query format introduced in Superset 4.1.1 includes an alias that cannot be
parsed by Pinot.
### Steps to Reproduce:
- Set up Superset 4.1.1 with Apache Pinot as the database backend.
- Create a time-series chart using a time grain (e.g., daily).
- Observe that the query execution fails.
### Expected Behavior:
The query should execute successfully, similar to how it worked in Superset
4.0.2.
### Actual Behavior:
The query fails due to the conflict between the original column
`day_epoch_ms` and alias with the same name being created in the SELECT
statement, which is not supported by Pinot.
Superset 4.1.1 query:
```
SELECT CAST(DATE_TRUNC('day', CAST(DATETIMECONVERT(day_epoch_ms,
'1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS
TIMESTAMP)) AS TIMESTAMP) AS day_epoch_ms,
sum(COUNT) AS "Total"
FROM "default".orders
GROUP BY CAST(DATE_TRUNC('day', CAST(DATETIMECONVERT(day_epoch_ms,
'1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS
TIMESTAMP)) AS TIMESTAMP)
ORDER BY sum(COUNT) DESC
LIMIT 10000;
```
Superset 4.0.2 query:
```
SELECT CAST(DATE_TRUNC('day', CAST(DATETIMECONVERT(day_epoch_ms,
'1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS
TIMESTAMP)) AS TIMESTAMP),
sum(COUNT) AS sum_1
FROM "default".orders
GROUP BY CAST(DATE_TRUNC('day', CAST(DATETIMECONVERT(day_epoch_ms,
'1:MILLISECONDS:EPOCH', '1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS
TIMESTAMP)) AS TIMESTAMP)
ORDER BY sum(COUNT) DESC
LIMIT 10000;
```
### Additional Notes:
- A [similar issue](https://github.com/apache/superset/issues/20349) has
been reported for Dremio and Drill databases. This suggests that the scope of
this regression is likely broader than just Pinot.
- The regression breaks time-series visualizations, significantly impacting
users relying on Superset for time-grain aggregations.
### Screenshots/recordings
_No response_
### Superset version
4.1.0
### Python version
3.11
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [X] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
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]