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
❯ explain verbose select floor(-1);
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
| plan_type | plan |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
| initial_logical_plan | Projection: floor(Int64(-1)) |
| | EmptyRelation |
| logical_plan after inline_table_scan | SAME TEXT AS ABOVE |
| logical_plan after type_coercion | Projection: floor(CAST(Int64(-1) AS Float64)) |
| | EmptyRelation |
| logical_plan after count_wildcard_rule | SAME TEXT AS ABOVE |
| analyzed_logical_plan | SAME TEXT AS ABOVE |
| logical_plan after eliminate_nested_union | SAME TEXT AS ABOVE |
| logical_plan after simplify_expressions | Projection: Float64(-1) AS floor(Int64(-1)) |
| | EmptyRelation |
| logical_plan after unwrap_cast_in_comparison | SAME TEXT AS ABOVE |
| logical_plan after replace_distinct_aggregate | SAME TEXT AS ABOVE |
| logical_plan after eliminate_join | SAME TEXT AS ABOVE
Activity
Ted-Jiang commentedon Jan 9, 2024
seems cast in some place
alamb commentedon Jan 9, 2024
If you are saying that
floor(decimal)should returndecimalthat makes sense to memaruschin commentedon Jan 10, 2024
@alamb, @Ted-Jiang, hi! I created draft PR
if the idea is ok, would like to compare all return types in pg and fixed them
Ted-Jiang commentedon Jan 10, 2024
Yes, basiclly all
numerictype should have the return type same as input.And i have check the
numerictype list is same as pg.theirix commentedon Feb 15, 2026
The floor and ceil udfs now support decimal return type via #18979.
Non-trivial functions like pow, log, etc. are also supported (linked in the parent EPIC).
So I think this issue is fixed and could be closed
Jefffrey commentedon Feb 18, 2026
Looks like we're consistent with integers too:
DF:
Thanks for checking @theirix