jayzhan211 commented on code in PR #13756:
URL: https://github.com/apache/datafusion/pull/13756#discussion_r1887750679
##########
datafusion/functions-nested/src/extract.rs:
##########
@@ -993,3 +993,84 @@ where
let data = mutable.freeze();
Ok(arrow::array::make_array(data))
}
+
+#[cfg(test)]
+mod tests {
+ use super::array_element_udf;
+ use arrow_schema::{DataType, Field};
+ use datafusion_common::{Column, DFSchema, ScalarValue};
+ use datafusion_expr::expr::ScalarFunction;
+ use datafusion_expr::{cast, Expr, ExprSchemable};
+ use std::collections::HashMap;
+
+ #[test]
+ fn test_array_element_return_type() {
+ let complex_type = DataType::FixedSizeList(
Review Comment:
> This is perhaps the key distinction -- should get_expr_type be applying
coercion rules? Or should we insist that the caller applies coercion rules
first before calling ExprSchema?
The main issue is that type coercion for function inputs happens after the
function is defined. If we had a way to handle coercion before the function is
defined, it would significantly simplify the function signature.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]