[ 
https://issues.apache.org/jira/browse/CALCITE-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816837#comment-16816837
 ] 

Danny Chan commented on CALCITE-2994:
-------------------------------------

The current code already consider structured type [1], so what exactly is the 
problem here ?

[1] 
https://github.com/apache/calcite/blob/38e3c3015b661f8f9dc61d8d0ef4be6186a4bc7a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java#L218

> Least restrictive type among structs does not consider nullability 
> -------------------------------------------------------------------
>
>                 Key: CALCITE-2994
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2994
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>             Fix For: 1.20.0
>
>
> Consider the following high-level example:
> {code:sql}
> CREATE TYPE Coordinates AS (
>   x INT,
>   y INT);
> CREATE TABLE Address (
>   loc1 Coordinates NOT NULL,
>   loc2 Coordinates)
> {code}
> The least restrictive type between loc1 and loc2 is the type of loc2 (i.e., a 
> nullable Coordinates type). 
> The existing code (i.e., RelDataTypeFactory#leastRestrictive) does take into 
> account nullability when the type is structured type (or row type). 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to