codeant-ai-for-open-source[bot] commented on PR #38617:
URL: https://github.com/apache/superset/pull/38617#issuecomment-4053137122
## **Sequence Diagram**
This PR fixes hour-level time bucketing by changing the MySQL template to
use a casted date wrapper, which remains intact during SQL compilation.
StarRocks inherits the same expression, ensuring both engines generate valid
hour bucket SQL for time-series charts.
```mermaid
sequenceDiagram
participant User
participant SupersetBackend as Backend
participant EngineSpec
participant SQLCompiler
participant Database
User->>Backend: Request chart query with hour time grain
Backend->>EngineSpec: Resolve hour time grain template
EngineSpec-->>Backend: Return DATE_ADD with CAST DATE wrapper
Backend->>SQLCompiler: Compile query through subquery path
SQLCompiler-->>Backend: Keep casted date wrapper in final SQL
Backend->>Database: Execute hour bucket aggregation query
Database-->>Backend: Return time bucketed results
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]