rtpsw commented on code in PR #13468:
URL: https://github.com/apache/arrow/pull/13468#discussion_r914060552


##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -160,9 +160,18 @@ Result<compute::Expression> FromProto(const 
substrait::Expression& expr,
       ARROW_ASSIGN_OR_RAISE(auto decoded_function,
                             
ext_set.DecodeFunction(scalar_fn.function_reference()));
 
-      std::vector<compute::Expression> arguments(scalar_fn.args_size());
-      for (int i = 0; i < scalar_fn.args_size(); ++i) {
-        ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(scalar_fn.args(i), 
ext_set));
+      std::vector<compute::Expression> arguments(scalar_fn.arguments_size());
+      for (int i = 0; i < scalar_fn.arguments_size(); ++i) {
+        const auto& argument = scalar_fn.arguments(i);
+        switch (argument.arg_type_case()) {
+          case substrait::FunctionArgument::kValue: {
+            ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(argument.value(), 
ext_set));
+            break;
+          }
+          default:
+            return Status::NotImplemented(
+                "only value arguments are currently supported for functions");

Review Comment:
   The Arrow code could include in the message the value converted to a string 
if it is known given the Substrait version the code was built with, and 
otherwise include the number of the value and explain it is unknown and coming 
from a different version of Substrait. All this enum-handling is for a separate 
issue, of course.



-- 
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]

Reply via email to