File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
datafusion/functions-nested/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,10 @@ impl ScalarUDFImpl for MapKeysFunc {
9494 fn return_type ( & self , arg_types : & [ DataType ] ) -> Result < DataType > {
9595 let [ map_type] = take_function_args ( self . name ( ) , arg_types) ?;
9696 let map_fields = get_map_entry_field ( map_type) ?;
97+ // internal array nullability is true to be in sync with DuckDB
9798 Ok ( DataType :: List ( Arc :: new ( Field :: new_list_field (
9899 map_fields. first ( ) . unwrap ( ) . data_type ( ) . clone ( ) ,
99- false ,
100+ true ,
100101 ) ) ) )
101102 }
102103
@@ -121,7 +122,8 @@ fn map_keys_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
121122 } ;
122123
123124 Ok ( Arc :: new ( ListArray :: new (
124- Arc :: new ( Field :: new_list_field ( map_array. key_type ( ) . clone ( ) , false ) ) ,
125+ // internal array nullability is true to be in sync with DuckDB
126+ Arc :: new ( Field :: new_list_field ( map_array. key_type ( ) . clone ( ) , true ) ) ,
125127 map_array. offsets ( ) . clone ( ) ,
126128 Arc :: clone ( map_array. keys ( ) ) ,
127129 map_array. nulls ( ) . cloned ( ) ,
You can’t perform that action at this time.
0 commit comments