dosubot[bot] commented on issue #37778: URL: https://github.com/apache/superset/issues/37778#issuecomment-3864514832
<!-- Greeting --> Hi @umoers! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> SQL Server uses the function name CEILING, not CEIL. The error happens because Superset (via its SQL parsing layer, sqlglot) does not automatically translate CEIL to CEILING for SQL Server, and there is no custom mapping for this in Superset's Microsoft SQL Server engine spec. If you see CEIL in generated SQL, that's not valid for SQL Server and will cause the error you described. To work around this, use CEILING explicitly in your custom SQL queries or calculated columns. If Superset is auto-generating CEIL in queries (for example, in calculated metrics), try editing those to use CEILING instead. There is currently no configuration in Superset 6.0.0 to change this behavior—function translation depends on the sqlglot TSQL dialect, and this is a known area of change in recent Superset versions affecting MSSQL function handling ([source](https://github.com/apache/superset/issues/37043)). Keep an eye on future Superset and sqlglot updates for improved function translation support. <!-- 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/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/96f85bf9-abc5-4a73-a2f6-78988ae6d88c?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=SQL%20Server%20uses%20the%20function%20name%20CEILING%2C%20not%20CEIL.%20The%20error%20happens%20because%20Superset%20%28via%20its%20SQL%20parsing%20layer%2C%20sqlglot%29%20does%20not%20automatically%20translate%20CEIL%20to%20CEILING%20for%20SQL%20Server%2C%20and%20there%20is%20no%20custom%20mapping%20for%20this%20in%20Superset%27s%20Microsoft%20SQL%20Server%20engine%20spec.%20If%20you%20see%20CEIL%20in%20generated%20SQL%2C%20that%27s%20not%20valid%20for%20SQL%20Server%20and%20will%20cause%20the%20error%20you%20described.%20%0A%0ATo%20work%20around%20this%2C%20use%20CEILING%20explicitly%20in%20your%20custom%20SQL%20queries%20or%20calculated%20columns.%20If%20Superset%20is%20auto-generating%20CEIL%20in%20queries%20%28for%20example%2C%20in%20calculat ed%20metrics%29%2C%20try%20editing%20those%20to%20use%20CEILING%20instead.%20There%20is%20currently%20no%20configuration%20in%20Superset%206.0.0%20to%20change%20this%20behavior%E2%80%94function%20translation%20depends%20on%20the%20sqlglot%20TSQL%20dialect%2C%20and%20this%20is%20a%20known%20area%20of%20change%20in%20recent%20Superset%20versions%20affecting%20MSSQL%20function%20handling%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/issues/37043%29%29.%20%0A%0AKeep%20an%20eye%20on%20future%20Superset%20and%20sqlglot%20updates%20for%20improved%20function%20translation%20support.) [](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/37778) -- 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]
