File tree Expand file tree Collapse file tree
datafusion/functions-aggregate/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,19 +112,19 @@ impl AggregateUDFImpl for ArrayAgg {
112112 }
113113
114114 fn return_field ( & self , arg_fields : & [ FieldRef ] ) -> Result < FieldRef > {
115- // Preserve the nullability of the input field in the list field
116- // If the input is non-nullable, the list itself is non-nullable
117- // If the input is nullable, the list is nullable
115+ // Preserve the nullability of the input field in the aggregate result field
116+ // If the input is non-nullable, the aggregate result field is non-nullable
117+ // If the input is nullable, the aggregate result field is nullable
118118 let input_field = & arg_fields[ 0 ] ;
119119 let list_field = Field :: new_list_field (
120120 input_field. data_type ( ) . clone ( ) ,
121- true , // elements in the list can be null
121+ true , // elements in the list (array elements) can be null
122122 ) ;
123123
124124 Ok ( Arc :: new ( Field :: new (
125125 self . name ( ) ,
126126 DataType :: List ( Arc :: new ( list_field) ) ,
127- input_field. is_nullable ( ) , // preserve input field's nullability
127+ input_field. is_nullable ( ) , // preserve input field's nullability in the aggregate result field
128128 ) ) )
129129 }
130130
You can’t perform that action at this time.
0 commit comments