duongcongtoai commented on code in PR #10148: URL: https://github.com/apache/datafusion/pull/10148#discussion_r1581831954
########## datafusion/physical-expr/src/scalar_function.rs: ########## @@ -146,11 +146,22 @@ impl PhysicalExpr for ScalarFunctionExpr { // evaluate the function match self.fun { ScalarFunctionDefinition::UDF(ref fun) => { - if self.args.is_empty() { - fun.invoke_no_args(batch.num_rows()) - } else { - fun.invoke(&inputs) + let output = match self.args.is_empty() { + true => fun.invoke_no_args(batch.num_rows()), + false => fun.invoke(&inputs), + }?; + + if fun.validate_number_of_rows() { + let output_size = match &output { + ColumnarValue::Array(array) => array.len(), + ColumnarValue::Scalar(_) => 1, Review Comment: Aha i 'v read duckdb's map definition again ``` A dictionary of multiple named values, each key having the same type and each value having the same type. Keys and values can be any type and can be different types from one another ``` I am new to this kind of project, but i think we don't have and should not have that use case 🤔. Else it will affect alot of execution logic -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org