jayzhan211 commented on code in PR #9108: URL: https://github.com/apache/arrow-datafusion/pull/9108#discussion_r1499396259
########## datafusion/physical-expr/src/array_expressions.rs: ########## @@ -433,6 +435,7 @@ pub fn array_element(args: &[ArrayRef]) -> Result<ArrayRef> { let indexes = as_int64_array(&args[1])?; general_array_element::<i64>(array, indexes) } + DataType::Null => Ok(args[0].clone()), Review Comment: > in coercion step could filter if the function accepts the NULL type while in array_expressions it determines what the function should return Does it mean we still need to do the null handling in `array_expression`? Take `array_append` for example, if we find null, we convert it to i64(None) and process it later on. ideally, nulls should be handled in type coercion. And, `array_expression` can be *simple* that just focuses on processing the result and not handling type or signature-related issues. If doing the checking again in `array_expression` is just because it is a public function, I think we should come out with a way that the checking can be somewhat reused in both places. Before that, maybe we just leave the checking in `coercion` step. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org