[ 
https://issues.apache.org/jira/browse/CALCITE-7295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18038932#comment-18038932
 ] 

Thomas Rebele commented on CALCITE-7295:
----------------------------------------

I've updated the description to make the goal of this ticket clearer. As far as 
I understand it, the first two examples ({{null + a/4}} and {{a/null}}) are not 
impacted by division-by-zero. Can we agree that both should simplify to 
{{null}}?

Shall we simplify {{null/0}} to {{null}} as well? I've tested PostgreSQL, 
Oracle, SQLite, MariaDB, and MySQL, and all simplify it to {{null}}. I can 
search the links to the fiddles if necessary.

I'm not sure whether CALCITE-7270 is impacted at all, as the ticket is about a 
SAFE_DIVIDE operator, while this ticket (CALCITE-7295) aims to improve the 
simplification of the standard DIVIDE operations.

> 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
>
> Some expressions, such as
>  * {{null + a/4}}
>  * {{a/null}}
>  * {{null/0}}, which gets simplified to {{null}} by PostgreSQL, Oracle, 
> SQLite, MariaDB, and MySQL,
> are not simplified. This ticket aims to improve RexSimplify to support these 
> kind of statements.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to