dosubot[bot] commented on issue #35792: URL: https://github.com/apache/superset/issues/35792#issuecomment-3431500985
<!-- Greeting --> Hi @phlppnhllngr! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team. <!-- Answer --> This issue is caused by the way Superset's DB2 engine spec generates SQL for time grains: it uses expressions like `CAST({col} as TIMESTAMP) - HOUR({col}) HOURS - MINUTE({col}) MINUTES ...`, which is not valid DB2 syntax and leads to SQL parse errors when selecting a time grain such as "Day" in charts. This logic has not changed between 4.1.1 and 5.0.0, so it's not a new regression but a pre-existing bug that may be more visible in 5.0.0 due to stricter error handling. There is currently no official fix or workaround documented, and resolving this would require updating the DB2 time grain expressions in the engine spec to produce valid DB2 SQL. For now, avoiding time grain selection or customizing the engine spec code are the only options if you need this functionality to work correctly. [Reference: DB2 engine spec code](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/db_engine_specs/db2.py) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/307ab88d-1b8e-45dc-99aa-1f775e4e8052?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35792) -- 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]
