clintropolis commented on code in PR #15962:
URL: https://github.com/apache/druid/pull/15962#discussion_r1530966917


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidSqlValidator.java:
##########
@@ -432,11 +456,18 @@ private RelDataType validateTargetType(
         fields.add(Pair.of(colName, sourceField.getType()));
         continue;
       }
-      RelDataType relType = 
typeFactory.createSqlType(SqlTypeName.get(sqlTypeName));
-      fields.add(Pair.of(
-          colName,
-          typeFactory.createTypeWithNullability(relType, true)
-      ));
+      if (NullHandling.replaceWithDefault()) {

Review Comment:
   for string types, default value mode treats `null` and `''` interchangeably, 
so it probably should be marked as nullable? tbh its not super well defined, 
but we do always mark string values as nullable in default value mode since the 
empty strings behave as null.
   
   For numbers though default value mode effectively means that they don't 
exist.
   
   This default value mode is deprecated now, so we probably don't have to 
spend too much time thinking about how things should behave, so we should 
probably match the computed schema stuff (strings always nullable in either 
mode, numbers only nullable in sql compatible mode)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to