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

Stamatis Zampetakis commented on CALCITE-4099:
----------------------------------------------

After CALCITE-3224, various entries were removed from NullPolicy.

{code:java}
/**
 * Describes when a function/operator will return null.
 *
 * <p>STRICT and ANY are similar. STRICT says f(a0, a1) will NEVER return
 * null if a0 and a1 are not null. This means that we can check whether f
 * returns null just by checking its arguments. Use STRICT in preference to
 * ANY whenever possible.</p>
 */
public enum NullPolicy {
  /** Returns null if and only if one of the arguments are null. */
  STRICT,
  /** Returns null if one of the arguments is null, and possibly other times. */
  SEMI_STRICT,
  /** If any of the arguments are null, return null. */
  ANY,
  /** If the first argument is null, return null. */
  ARG0,
  NONE
}
{code}
As it is right now NullPolicy is really close to Strong.Policy and after 
CALCITE-7264 they will be even closer. 

This is a good moment to bring them together and just keep one or the other. We 
could eventually plug these to {{ReturnTypeInference}} but it doesn't 
necessarily have to happen now. Any thoughts?

> Unify Strong.Policy and NullPolicy
> ----------------------------------
>
>                 Key: CALCITE-4099
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4099
>             Project: Calcite
>          Issue Type: Task
>          Components: core
>            Reporter: Ruben Q L
>            Priority: Minor
>
> (discussion about this ticket started in CALCITE-4094)
> {{Strong.Policy}} and {{NullPolicy}} are two different enum that represent 
> grosso-modo the same thing. The former is mostly used on the simplifier, and 
> the latter on the code generation.
> To be studied if we could unify both entities and make it available through 
> the SqlOperator.



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

Reply via email to