Details

    • Sub-task
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 1.25.0
    • None
    • core
    • None

    Description

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

      For instance,

      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
          }
        }
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladimirsitnikov Vladimir Sitnikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: