duongcongtoai commented on code in PR #10148: URL: https://github.com/apache/datafusion/pull/10148#discussion_r1581482725
########## datafusion/physical-expr/src/scalar_function.rs: ########## @@ -177,7 +177,18 @@ impl PhysicalExpr for ScalarFunctionExpr { let fun = create_physical_fun(fun)?; (fun)(&inputs) } - ScalarFunctionDefinition::UDF(ref fun) => fun.invoke(&inputs), + ScalarFunctionDefinition::UDF(ref fun) => { + let output = fun.invoke(&inputs)?; + let output_count = match &output { Review Comment: oh actually current arrow_typeof also respect this behavior (added extra test case in arrow_typeof.slt) ``` query T select arrow_typeof(col) from (select 1 as col union select 2 as col) as table_a; ---- Int64 Int64 ``` => So in this case ArrowTypeOfFunc always return a Scalar ``` Ok(ColumnarValue::Scalar(ScalarValue::from(format!( "{input_data_type}" )))) ``` but the rendered record batch shows n rows anyway, does it mean wrong implementation with correct result? -- 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