adonis0147 commented on a change in pull request #8089:
URL: https://github.com/apache/incubator-doris/pull/8089#discussion_r808631826



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java
##########
@@ -159,6 +159,7 @@ public Column(Column column) {
     public void createChildrenColumn(Type type, Column column) {
         if (type.isArrayType()) {
             Column c = new Column(COLUMN_ARRAY_CHILDREN, ((ArrayType) 
type).getItemType());
+            c.setIsAllowNull(true);

Review comment:
       I'm not sure whether there is a way to declare the item type in array 
type nullable.
   For scalar type, if we declare it without `NOT NULL`, the type is nullable 
by default. If we don't set the item type `isAllowNull` here and insert value 
`[NULL]`, we will get a wrong result, because the item_writer won't append null 
in be.
   
   There are three ways to resolve it:
   1. `Array<int>` indicates the item type is not null by default and add some 
checks to forbid values like `[NULL]` from being inserted.
   2. `Array<int>` indicates the item type is null by default.
   3. Provide some sql syntax to declare whether the item type is nullable or 
not.




-- 
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