Details
-
Sub-task
-
Status: Open
-
Blocker
-
Resolution: Unresolved
-
1.25.0
-
None
-
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
- relates to
-
CALCITE-4215 Ensure org.apache.calcite.schema.Statistic uses null vs emptyList appropriately
- Open