rubenada commented on a change in pull request #898: [CALCITE-2464] Allow to 
set nullability for columns of structured types (Ruben Quesada Lopez)
URL: https://github.com/apache/calcite/pull/898#discussion_r258932425
 
 

 ##########
 File path: server/src/main/java/org/apache/calcite/sql/ddl/SqlCreateTable.java
 ##########
 @@ -176,6 +176,9 @@ public void execute(CalcitePrepare.Context context) {
             type = typeEntry.getType().apply(typeFactory);
           }
         }
+        if (type != null && !type.isNullable() && d.strategy == 
ColumnStrategy.NULLABLE) {
 
 Review comment:
   @zabetak I agree this is not the cleanest way to get nullable struct types, 
but as you say, at the point when the struct type is created, the nullability 
info does not get propagated. So, I think this is the simplest solution, 
because it does not require any side changes.
   I have committed a new version that relies on `d.dataType.nullable` instead 
of `d.strategy` to set the correct nullability. Let me know what you think.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to