ninidhiaeddine opened a new pull request, #4059:
URL: https://github.com/apache/calcite/pull/4059

   CALCITE-6702: Strong Policy for the `SqlStdOperatorTable.POWER` Function is 
wrongly assigned `AS_IS` when it should be `ANY`.
   
   **Context:**
   In various SQL db implementations, the `POWER(a, b)` function returns `NULL` 
when either or both operands are null.
   ```
   SELECT POWER(NULL, 2) AS "ALIAS1"; -- => Returns NULL
   SELECT POWER(2, NULL) AS "ALIAS2"; -- => Returns NULL
   SELECT POWER(NULL ,NULL) AS "ALIAS3"; -- => Returns NULL
   ```
   
   These are all the cases I could think of:
   
![image](https://github.com/user-attachments/assets/1d6ee100-65a4-4c87-9c87-d7c893c2393b)
   
   This means that the correct null policy for the `POWER` function is `ANY` 
instead of `AS_IS`, since this expression is `NULL` **if and only if** at least 
one of its arguments is `NULL`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to