[
https://issues.apache.org/jira/browse/CALCITE-7295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7295.
----------------------------------
Fix Version/s: 1.42.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/51965cfbcba638ed9335e5d3cc7b560003d5f85c]
Thank you for the contribution [~thomas.rebele]
> RexSimplify should simplify a division with a NULL argument
> -----------------------------------------------------------
>
> Key: CALCITE-7295
> URL: https://issues.apache.org/jira/browse/CALCITE-7295
> Project: Calcite
> Issue Type: Task
> Reporter: Thomas Rebele
> Assignee: Thomas Rebele
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> The SQL standard states that arithmetic operations with a NULL argument
> should evaluate to NULL. If one of the arguments is NULL, the division will
> not be carried out, so there is no risk of division-by-zero. So RexSimplify
> could simplify expressions if one of their arguments is NULL. Here some
> examples:
> * {{null + a/4}}
> * {{a/null}}
> * {{{}null/0{}}}, which gets simplified to {{null}} by PostgreSQL, Oracle,
> SQLite, MariaDB, and MySQL.
> This ticket aims to improve RexSimplify to support these kind of statements.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)