jorisvandenbossche commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1017888011
##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -170,9 +170,10 @@ Result<compute::Expression> FromProto(const
substrait::Expression& expr,
out = compute::field_ref(FieldRef(*out_ref, index));
} else if (out->call() && out->call()->function_name ==
"struct_field") {
// Nested StructFields on top of an arbitrary expression
- std::static_pointer_cast<arrow::compute::StructFieldOptions>(
- out->call()->options)
- ->indices.push_back(index);
+ auto* field_options =
+
checked_cast<compute::StructFieldOptions*>(out->call()->options.get());
+ field_options->field_ref =
+ FieldRef(std::move(field_options->field_ref), index);
Review Comment:
in FromProto, I assume the indices will always be integers (since that's how
substrait's field references work?)
--
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]