@@ -894,7 +894,7 @@ pub async fn from_substrait_rex(
894894 Some ( RexType :: ScalarFunction ( f) ) => {
895895 let fn_name = extensions. get ( & f. function_reference ) . ok_or_else ( || {
896896 DataFusionError :: NotImplemented ( format ! (
897- "Aggregated function not found: function reference = {:?}" ,
897+ "Scalar function not found: function reference = {:?}" ,
898898 f. function_reference
899899 ) )
900900 } ) ?;
@@ -912,8 +912,8 @@ pub async fn from_substrait_rex(
912912 Some ( ArgType :: Value ( e) ) => {
913913 from_substrait_rex ( ctx, e, input_schema, extensions) . await
914914 }
915- _ => not_impl_err ! (
916- "Aggregated function argument non- Value type not supported"
915+ t => not_impl_err ! (
916+ "Only Value arguments are supported for scalar functions, got: {t:?} "
917917 ) ,
918918 } ?;
919919 args. push ( arg_expr. as_ref ( ) . clone ( ) ) ;
@@ -938,7 +938,7 @@ pub async fn from_substrait_rex(
938938 ScalarFunctionType :: Op ( op) => {
939939 if f. arguments . len ( ) != 2 {
940940 return not_impl_err ! (
941- "Expect two arguments for binary operator {op:?}"
941+ "Expected two arguments for binary operator {op:?}"
942942 ) ;
943943 }
944944 let lhs = & f. arguments [ 0 ] . arg_type ;
@@ -1464,13 +1464,15 @@ fn from_substrait_literal_with_type(
14641464 } ?;
14651465 let builder = s. fields . iter ( ) . zip ( fields) . try_fold (
14661466 ScalarStructBuilder :: new ( ) ,
1467- |b, ( sv , field) | -> Result < _ > {
1467+ |b, ( lit , field) | -> Result < _ > {
14681468 let sv = from_substrait_literal_with_type (
1469- sv ,
1469+ lit ,
14701470 field. to_owned ( ) . map ( |f| f. data_type ( ) . to_owned ( ) ) . as_ref ( ) ,
14711471 ) ?;
14721472 Ok ( b. with_scalar (
1473- field. unwrap_or_else ( || Field :: new ( "col" , sv. data_type ( ) , true ) ) ,
1473+ field. unwrap_or_else ( || {
1474+ Field :: new ( "col" , sv. data_type ( ) , lit. nullable )
1475+ } ) ,
14741476 sv,
14751477 ) )
14761478 } ,
0 commit comments