File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
datafusion/functions/src/datetime Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ impl ScalarUDFImpl for DatePartFunc {
149149
150150 fn return_field_from_args ( & self , args : ReturnFieldArgs ) -> Result < FieldRef > {
151151 let [ field, _] = take_function_args ( self . name ( ) , args. scalar_arguments ) ?;
152+ let nullable = args. arg_fields [ 1 ] . is_nullable ( ) ;
152153
153154 field
154155 . and_then ( |sv| {
@@ -157,9 +158,9 @@ impl ScalarUDFImpl for DatePartFunc {
157158 . filter ( |s| !s. is_empty ( ) )
158159 . map ( |part| {
159160 if is_epoch ( part) {
160- Field :: new ( self . name ( ) , DataType :: Float64 , true )
161+ Field :: new ( self . name ( ) , DataType :: Float64 , nullable )
161162 } else {
162- Field :: new ( self . name ( ) , DataType :: Int32 , true )
163+ Field :: new ( self . name ( ) , DataType :: Int32 , nullable )
163164 }
164165 } )
165166 } )
You can’t perform that action at this time.
0 commit comments