[
https://issues.apache.org/jira/browse/CALCITE-4085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148167#comment-17148167
]
Stamatis Zampetakis commented on CALCITE-4085:
----------------------------------------------
Hey [~dwysakowicz], I don't think that there is some part of the standard that
explicitly states that attributes are nullable but I think it is implicitly
derived by the definition of the _mutator_ and _observer_ methods; an exert for
these methods is present in CALCITE-2464. In CALCITE-2464 there is also a link
to a book that explains a bit more nullability of structured types in standard
SQL.
As you said Calcite already goes a bit beyond the standard and allows to define
nullabilty at any level. There are also projects that use Calcite to query java
objects totally outside the context of a transactional DBMS thus I am not
against the idea of preserving nullability. As [~rubenql] pointed out the main
concern in this case is backwards compatibility. If we change the existing
behavior what happens on downstream projects?
> Improve nullability support for fields of structured type
> ---------------------------------------------------------
>
> Key: CALCITE-4085
> URL: https://issues.apache.org/jira/browse/CALCITE-4085
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Dawid Wysakowicz
> Assignee: Dawid Wysakowicz
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> As discussed in
> https://lists.apache.org/thread.html/r602ac95fff23dd1ef974fb396df7be061ab861384ec42f5c57ce0bc2%40%3Cdev.calcite.apache.org%3E
> I would like to change the way a type of a field of a record is derived at
> couple of locations. This helps frameworks such as Apache Flink to build
> support for nullable records with not null fields.
> I suggest to change:
> * SqlDotOperator#deriveType
> * SqlItemOperator#inferReturnType
> * AliasNamespace#validateImpl
> * RexBuilder#makeFieldAccessInternal
> * SqlValidatorImpl.DeriveTypeVisitor#visit(SqlIdentifier)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)