You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (Jira)" <ji...@apache.org> on 2020/11/02 23:10:00 UTC

[jira] [Updated] (CALCITE-4372) Correct specification getCumulativeCost and getNonCumulativeCost so it should always produce non-nullable value

     [ https://issues.apache.org/jira/browse/CALCITE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Sitnikov updated CALCITE-4372:
---------------------------------------
    Description: 
Currently javadoc says {{getNonCumulativeCost}} can return {{null}}, however, a lot of usages assume the resulting value is not null.

For instance, FLINK-11973 is relevant here.

Even though plugins can install custom {{getNonCumulativeCost}} handlers, we should make {{get*CumulativeCost}} non-nullable, so {{RelOptPlanner.getCost}} could be declared and implemented as non-nullable (which is the way the current code behaves)

It does not look right if we declare that "metadata can return null", and then Volcano fails with NPE :(

  was:
Currently javadoc says {{getNonCumulativeCost}} can return {{null}}, however, a lot of usages assume the resulting value is not null.

For instance, FLINK-11973 is relevant here.

Even though plugins can install custom {{getNonCumulativeCost}} handlers, we should make {{get*CumulativeCost}} non-nullable, so {{RelOptPlanner.getCost}} could be declared and implemented as non-nullable (which is the way the current code behaves)


> Correct specification getCumulativeCost and getNonCumulativeCost so it should always produce non-nullable value
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4372
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4372
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Vladimir Sitnikov
>            Priority: Major
>
> Currently javadoc says {{getNonCumulativeCost}} can return {{null}}, however, a lot of usages assume the resulting value is not null.
> For instance, FLINK-11973 is relevant here.
> Even though plugins can install custom {{getNonCumulativeCost}} handlers, we should make {{get*CumulativeCost}} non-nullable, so {{RelOptPlanner.getCost}} could be declared and implemented as non-nullable (which is the way the current code behaves)
> It does not look right if we declare that "metadata can return null", and then Volcano fails with NPE :(



--
This message was sent by Atlassian Jira
(v8.3.4#803005)