[
https://issues.apache.org/jira/browse/CALCITE-4222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladimir Sitnikov updated CALCITE-4222:
---------------------------------------
Priority: Blocker (was: Major)
> 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
> Priority: Blocker
>
> 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)