TheBuilderJR opened a new issue, #13962:
URL: https://github.com/apache/datafusion/issues/13962
### Describe the bug
For a query like this
```
SELECT
date_trunc('${timeCoersion}', (timestamp_utc AT TIME ZONE
'${timezone}')::timestamptz) AS ts_date,
session_id,
COUNT(*) AS pageviews,
CASE WHEN COUNT(*) = 1 THEN 1 ELSE 0 END AS is_bounce,
MAX(timestamp_utc) AS latest_hit_aux,
MIN(timestamp_utc) AS first_hit_aux
FROM ${"_" + token.replace(/-/g, "_")}
WHERE
${processFilters(filters, useTelemetry)}
timestamp_utc >= TO_TIMESTAMP(${start})
AND timestamp_utc <= TO_TIMESTAMP(${end})
GROUP BY
ts_date,
session_id
```
I would expect the group by to group by the timezone, but instead it uses
utc to group by and only formats the timestamp as the timezone.
### To Reproduce
Run a similar query and notice the group by is incorrect
### Expected behavior
Group by using the actual timezone
### Additional context
_No response_
--
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]