alamb commented on code in PR #14276:
URL: https://github.com/apache/datafusion/pull/14276#discussion_r1937090320
##########
datafusion/functions/src/core/named_struct.rs:
##########
@@ -203,12 +139,28 @@ impl ScalarUDFImpl for NamedStructFunc {
))))
}
- fn invoke_batch(
- &self,
- args: &[ColumnarValue],
- _number_rows: usize,
- ) -> Result<ColumnarValue> {
- named_struct_expr(args)
+ fn invoke_with_args(&self, args: ScalarFunctionArgs) ->
Result<ColumnarValue> {
+ let DataType::Struct(fields) = args.return_type else {
+ return internal_err!("incorrect named_struct return type");
+ };
+
+ assert_eq!(
+ fields.len(),
+ args.args.len() / 2,
+ "return type field count != argument count / 2"
+ );
+
+ let values: Vec<ColumnarValue> = args
Review Comment:
😍
--
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]