vibhatha commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1017911300


##########
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:
   Yes that's what I am referring to, Substrait doesn't consider names, only 
integers (position basically). 
   But want to see @westonpace thoughts on this too. 



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