You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/11/10 23:04:18 UTC

Re: [PR] Convert Null to Int32(None) for MakeArray at type coercion step [arrow-datafusion]

alamb commented on code in PR #7995:
URL: https://github.com/apache/arrow-datafusion/pull/7995#discussion_r1380730813


##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
             .collect::<Result<Vec<_>>>()?;
     }
 
+    // Converting `Null` to Int32(None) to avoid handling `Null` in array functions

Review Comment:
   It seems very strange to me that there are three special cases for `if *fun == BuiltinScalarFunction::MakeArray {` that all do similar things 🤔 



##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
             .collect::<Result<Vec<_>>>()?;
     }
 
+    // Converting `Null` to Int32(None) to avoid handling `Null` in array functions

Review Comment:
   I feel like the fact this is special casing NULLs when nothing else in DataFusion needs to do the same, is an indication something is not quite right with this architecture. Is there any way we can remove these special cases?



##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
             .collect::<Result<Vec<_>>>()?;
     }
 
+    // Converting `Null` to Int32(None) to avoid handling `Null` in array functions

Review Comment:
   It seems very strange to me that there are three special cases for `if *fun == BuiltinScalarFunction::MakeArray {` that all do similar things 🤔 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org