thisisnic commented on code in PR #34050:
URL: https://github.com/apache/arrow/pull/34050#discussion_r1116311190


##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -320,6 +320,30 @@ Result<compute::Expression> FromProto(const 
substrait::Expression& expr,
       return function_converter(substrait_call);
     }
 
+    case substrait::Expression::kCast: {
+      const auto& cast_exp = expr.cast();
+      ARROW_ASSIGN_OR_RAISE(auto input,
+                            FromProto(cast_exp.input(), ext_set, 
conversion_options));
+
+      // need to convert from the Substrait type spec to the relevant Arrow 
thing
+      // do we need a switch/case or can we just get code similar to the below 
FromProto?

Review Comment:
   Thanks! I went for the simpler solution you suggestion for the moment - 
rejecting the plan if we try to cast to a non-nullable field when strictness is 
set to `EXACT_ROUNDTRIP`.



##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -989,7 +1011,6 @@ Result<std::unique_ptr<substrait::Expression>> ToProto(
   }
 
   auto out = std::make_unique<substrait::Expression>();
-

Review Comment:
   My mistake, added back in!



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