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

[jira] [Created] (CALCITE-4263) Clarify RelNode#estimateRowCount behavior with regards to nulls

Vladimir Sitnikov created CALCITE-4263:
------------------------------------------

             Summary: Clarify RelNode#estimateRowCount behavior with regards to nulls
                 Key: CALCITE-4263
                 URL: https://issues.apache.org/jira/browse/CALCITE-4263
             Project: Calcite
          Issue Type: Sub-task
          Components: core
    Affects Versions: 1.25.0
            Reporter: Vladimir Sitnikov


{{RelNode#estimateRowCount}} implementation must return non-nullable value, and it often uses metadata which might return {{null}}

For instance,
{code:java}
class Correlate {
  @Override public double estimateRowCount(RelMetadataQuery mq) {
    double leftRowCount = mq.getRowCount(left); // <-- NPE here
    switch (joinType) {
    case SEMI:
    case ANTI:
      return leftRowCount;
    default:
      return leftRowCount * mq.getRowCount(right); // <-- NPE here
    }
  }
{code}

There should be documentation on the desired behavior in case metadata returns "unknown", and the code needs adjustment as lot of the implementation perform blind unboxing.



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