vibhatha commented on code in PR #34050:
URL: https://github.com/apache/arrow/pull/34050#discussion_r1116472107
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -320,6 +320,38 @@ 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));
+
+ ARROW_ASSIGN_OR_RAISE(auto type_nullable,
+ FromProto(cast_exp.type(), ext_set,
conversion_options));
+
+ if (!type_nullable.second &&
+ conversion_options.strictness ==
ConversionStrictness::EXACT_ROUNDTRIP) {
+ return Status::Invalid("Substrait cast type must be of nullable type");
+ }
+
+ if (cast_exp.failure_behavior() ==
+ substrait::Expression_Cast_FailureBehavior::
+
Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_THROW_EXCEPTION) {
Review Comment:
nit
```suggestion
Expression::Cast::FailureBehavior::
Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_THROW_EXCEPTION) {
```
--
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]