You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Casting rounded float to string returns "0E0" instead of "0.0" #3947
Activity
yuancu commentedon Aug 5, 2025
Root cause:
Calcite's builtin cast operator leverages the following implementation ( from
https://github.com/apache/calcite/blob/cfaadedd8fd34c480395f9e843a73bf4bb8fe459/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java#L4430)
If the input equals to 0, it returns a hard-coded
0E0.yuancu commentedon Aug 6, 2025
Btw, I found that casting decimal to string also has special rules in Calcite:
This may not be a bug, but it does cause disparity with the behavior of v2.
LantaoJin commentedon Aug 7, 2025
Em, I think we should fix them both. ".99" is a not making sense. If we fix "0E0" to "0.0", no reason to keep the ".0". @yuancu