[
https://issues.apache.org/jira/browse/FLINK-25300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Francesco Guardiani updated FLINK-25300:
----------------------------------------
Description:
Right now when the user tries to invoke {{FLOOR}} and {{CEIL}} on any integral
number, a call to {{Math.floor}}/{{Math.ceil}} is not generated, thanks to the
code in {{FloorCeilMethodGen}}, which optimizes and removes the call itself.
We should rather implement a rule in the planner (or reuse the expression
reducer rule) that removes {{FLOOR}} and {{CEIL}} in case its arguments are
integral types, that is TINYINT, SMALLINT, INT and BIGINT. This allows users to
see this optimization in the planner.
was:
Right now when the user tries to invoke {{FLOOR}} and {{CEIL}} on any integral
number, a call to {{Math.floor}}/{{Math.ceil}} is generated, which is noop and
possibly might end up in incorrect results.
We should rather implement a rule in the planner (or reuse the expression
reducer rule) that removes {{FLOOR}} and {{CEIL}} in case its arguments are
integral types, that is TINYINT, SMALLINT, INT and BIGINT
> Remove CEIL and FLOOR call with one argument for integral values
> ----------------------------------------------------------------
>
> Key: FLINK-25300
> URL: https://issues.apache.org/jira/browse/FLINK-25300
> Project: Flink
> Issue Type: Technical Debt
> Components: Table SQL / Runtime
> Reporter: Francesco Guardiani
> Priority: Minor
>
> Right now when the user tries to invoke {{FLOOR}} and {{CEIL}} on any
> integral number, a call to {{Math.floor}}/{{Math.ceil}} is not generated,
> thanks to the code in {{FloorCeilMethodGen}}, which optimizes and removes the
> call itself.
> We should rather implement a rule in the planner (or reuse the expression
> reducer rule) that removes {{FLOOR}} and {{CEIL}} in case its arguments are
> integral types, that is TINYINT, SMALLINT, INT and BIGINT. This allows users
> to see this optimization in the planner.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)