Skip to content

Commit 2462dd0

Browse files
committed
Update return_field_from_args signature
1 parent f777629 commit 2462dd0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

datafusion/expr/src/async_udf.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use crate::{ReturnFieldArgs, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl};
1919
use arrow::array::ArrayRef;
20-
use arrow::datatypes::{DataType, Field, SchemaRef};
20+
use arrow::datatypes::{DataType, Field, FieldRef, SchemaRef};
2121
use async_trait::async_trait;
2222
use datafusion_common::config::ConfigOptions;
2323
use datafusion_common::error::Result;
@@ -52,15 +52,15 @@ pub trait AsyncScalarUDFImpl: Debug + Send + Sync {
5252
///
5353
/// By default, this function calls [`Self::return_type`] with the
5454
/// types of each argument.
55-
fn return_field_from_args(&self, args: ReturnFieldArgs) -> Result<Field> {
55+
fn return_field_from_args(&self, args: ReturnFieldArgs) -> Result<FieldRef> {
5656
let data_types = args
5757
.arg_fields
5858
.iter()
5959
.map(|f| f.data_type())
6060
.cloned()
6161
.collect::<Vec<_>>();
6262
let return_type = self.return_type(&data_types)?;
63-
Ok(Field::new(self.name(), return_type, true))
63+
Ok(Arc::new(Field::new(self.name(), return_type, true)))
6464
}
6565

6666
/// The ideal batch size for this function.
@@ -131,7 +131,7 @@ impl ScalarUDFImpl for AsyncScalarUDF {
131131
self.inner.return_type(arg_types)
132132
}
133133

134-
fn return_field_from_args(&self, args: ReturnFieldArgs) -> Result<Field> {
134+
fn return_field_from_args(&self, args: ReturnFieldArgs) -> Result<FieldRef> {
135135
self.inner.return_field_from_args(args)
136136
}
137137

0 commit comments

Comments
 (0)