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/03 06:54:00 UTC

[jira] [Created] (CALCITE-4222) Clarify if null elements are allowed in RelTraitSet

Vladimir Sitnikov created CALCITE-4222:
------------------------------------------

             Summary: Clarify if null elements are allowed in RelTraitSet
                 Key: CALCITE-4222
                 URL: https://issues.apache.org/jira/browse/CALCITE-4222
             Project: Calcite
          Issue Type: Sub-task
          Components: core
    Affects Versions: 1.25.0
            Reporter: Vladimir Sitnikov


Currently, one-half of the methods in {{RelTraitSet}} fails with NPE, and another half does have some null-checks. Then there are {{getDefault()}} and {{isDefault()}}

AFAIK the only way to create a traitset with null element currently is to implement {{org.apache.calcite.plan.RelTraitDef#getDefault}} to return {{null}} (which never happens in Calcite code).
However, such a traitset would likely fail with NPE in {{org.apache.calcite.plan.RelTraitSet#satisfies}} quite fast.

{{RelCollationTraitDef}} and {{RelDistributionTraitDef}} have non-null default value which might interfere with collation and distribution metadata. For instance, {{distribution}} metadata might return null, and then it would fail with NPE when replacing distribution trait.




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