You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (Jira)" <ji...@apache.org> on 2021/04/28 02:48:00 UTC
[jira] [Commented] (CALCITE-4263) Clarify RelNode#estimateRowCount
behavior with regards to nulls
[ https://issues.apache.org/jira/browse/CALCITE-4263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17334417#comment-17334417 ]
Chunwei Lei commented on CALCITE-4263:
--------------------------------------
+1
> 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
> Priority: Blocker
>
> {{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)